WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
313 stars 46 forks source link

Button-based mouse movement's don't accumulate #383

Open MaverickAdams opened 2 years ago

MaverickAdams commented 2 years ago

My setup

mouse movements are mapped to corresponding arrow keys( up arrow = moving mouse up etc)

Issue

When pressing something like right and up together I'd expect to go diagonally but instead the second input pressed overrides the initial input causing me to go either only right or only up(depending on which got pressed most recently.)

WhiteMagic commented 2 years ago

This isn't so much of a bug but rather simply something that hasn't been implemented for the button controlled mouse movements. Hat and axis inputs handle this properly.

MaverickAdams commented 2 years ago

If the axis inputs handle it properly would it be possible to map a button on a keyboard to those axis inputs? If so how?

WhiteMagic commented 2 years ago

Actually, that will work. You need to add a macro to each arrow direction which sends a physical joystick event on press and a second event on release to reset the joystick axis. Then, on the physical stick's configuration, you can use the "Map to Mouse" option for movements. This, however, will struggle if the physical stick is sending its own axis movements as they will override what you have sent. You also need to use the condition system for the keyboard macros to ensure the axis deflection and reset are sent correctly. The attached images show how this is done for one of the four directions.

stick keyboard_action keyboard_condition s.

MaverickAdams commented 2 years ago

Thanks for this! This is awesome and a step in the right direction :) The only issue now is that with this setup pressing buttons that share an axis will cause issues.

For example, lets say im using "up" to move the y axis up and "down" to move it down. If I hold "up" first and then hold "down" (while still holding the "up" key) and then release the "up" key while still holding the "down" key it will trigger the y axis resetting back to "0.000" which stops the movement until i press a key again. Hopefully that makes sense. If not maybe i can just record a video of the steps or make a png of it.

WhiteMagic commented 2 years ago

You probably could work around this by having the macro that sets the axis back to 0.0 only trigger if the "opposite" direction input is not pressed, but that is getting quite a bit convoluted. Effectively this is where plugins come into play as all this various input interplay is not something the UI is designed to handle.

MaverickAdams commented 2 years ago

That's actually perfect! Thank you so much!