chrippa / ds4drv

A Sony DualShock 4 userspace driver for Linux
MIT License
1.05k stars 213 forks source link

Add controller "splash" on connection #92

Open poconbhui opened 8 years ago

poconbhui commented 8 years ago

This implements #89.

It's synchronous, so it freezes the controller for the 2 seconds it runs. This is to make sure the splash action and LED actions don't cancel each other out. This sort of makes the LED action obsolete, since it calls device.set_led(*(options.led)) at the end.

Ape commented 8 years ago

I would prefer this happening only when a controller is connected, not when changing the profile. Or, maybe there could also be a quick rumble when you change the profile, but it should be different, probably a lot shorter.

Ape commented 8 years ago

I played with the effect for a bit. I think it could be a lot quicker. In addition, full power big_rumble seems to be a bit annoying, especially if the controller is laying on a hard surface.

I think I like something like this:

splash_time = 0.5
splash_frame_counts = [4, 6, 8, 4]
# ...
big_rumble = 63
small_rumble = 255

I would also somehow use a bit less colors on the led.

We could repeat this every now and then for low battery notification (#90):

splash_time = 0.3
splash_frame_counts = [1, 2, 1, 1]
# ...
big_rumble = 31
small_rumble = 255

After finishing the audio support we could also use notification sounds for these.

poconbhui commented 8 years ago

Oh, I didn't check it with changing profile. Sticking it in the setup section will probably fix that.

poconbhui commented 8 years ago

That should fix splashing only on device connection.

poconbhui commented 8 years ago

That should be the code a little cleaner and your suggestions on splash time and rumbles included. It should be a little easier to see the key frames for the LEDs. Play around with it and see if you can find a less obnoxious combination.

poconbhui commented 7 years ago

Hey, is there anything keeping this from being merged, other than the commits needing a squash?

CorneliaXaos commented 6 years ago

Huh.. I actually implemented something similar to this using custom scripts that ran when bindings were executed. The script does a notify-send to display a message linked to the binding in regards to profile changing or controller disconnection (using PS+Triangle). I wonder if we could do something like that with the notify2 package. Then I wouldn't need my custom scripts. :P