JoyCon-Driver icon indicating copy to clipboard operation
JoyCon-Driver copied to clipboard

Add "shake" virtual buttons

Open natinusala opened this issue 6 years ago • 3 comments

It would be a good idea to add "shake" virtual buttons for emulators/games which don't support motion controls. Basically, when the driver detects that one of the Joy Cons was shaken, it presses the appropriate button.

Multiple buttons could be added : one per JoyCon, and one for any Joy Con.

A good example would be the Dolphin Wii emulator, with the WiiMote shake control.

natinusala avatar Nov 01 '17 18:11 natinusala

Thanks for the idea, this would be great for games like super Mario Galaxy on dolphin, the hard part is defining a "shake", I might make a quick hack to make this happen sometime soon but I have some tests coming up and need to study

fossephate avatar Nov 01 '17 20:11 fossephate

I guess a shake is just a quick acceleration defined by a threshold, and throttled by a pause between each acceleration to prevent spamming. If we can configure the acceleration threshold and pause, it can work for every use case.

See this Stack Overflow anwser for a sample code (for Android accelerometer but I guess it's the same here) : https://stackoverflow.com/questions/5271448/how-to-detect-shake-event-with-android

natinusala avatar Nov 01 '17 20:11 natinusala

You can already configure dolphin to shake the WiiMote when you shake your joycon. On the "Motion Controlls and IR" tab I have set Y and Z to 'Slider 0+-' and 'Slider 1+-'. Works like a charm.

Migushthe2nd avatar Nov 30 '17 10:11 Migushthe2nd