Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deactivation of queued joystick axis movement #2713

Merged
merged 1 commit into from Aug 2, 2023

Conversation

kcgen
Copy link
Member

@kcgen kcgen commented Aug 2, 2023

When mapping a host keyboard button to a virtual joystick axis, the prior logic would allow a queue of the same event (ie: holding a given direction) to ignore deactivation of the event (ie: release of the direction).

This change now zeroes the queued action and deactivates when requested.

joytest.zip was used with:

  • Host analog stick driving the axes (native control)
  • Host D-pad mapped to the analog axes
  • Keypad up/down/left/right mapped to the analog axes

When mapping a host keyboard button to a vitual joystick
axis, the prior logic would allow a queue of the same
event (ie: holding a given direction) to ignore
deactivation of the event (ie: release of the
direction).

This change now zeroes the queued action and deactivates
when requested.

Tested with:
 - Host analog stick driving the axes (native control)
 - Host D-pad mapped to the analog axes
 - Keypad up/down/left/right mapped to analog axes
@kcgen kcgen added the SDL SDL integration related issues label Aug 2, 2023
@kcgen kcgen requested a review from johnnovak August 2, 2023 01:50
@kcgen kcgen self-assigned this Aug 2, 2023
Copy link
Member

@johnnovak johnnovak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice quick fix @kcgen 🎉

image

@johnnovak johnnovak merged commit 89d5efb into main Aug 2, 2023
50 checks passed
@kcgen kcgen deleted the kc/virtual-joy-axis-1 branch August 10, 2023 00:23
@johnnovak johnnovak added regression We broke something 😊 bug Something isn't working labels Nov 13, 2023
@johnnovak johnnovak added the input handling Issues related to handling any input (keyboard, mouse, joystick & game controllers) label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input handling Issues related to handling any input (keyboard, mouse, joystick & game controllers) regression We broke something 😊 SDL SDL integration related issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants