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

Map SDL joystick movement to key presses for menu and PDA navigation #953

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SRSaunders
Copy link

@SRSaunders SRSaunders commented Dec 20, 2024

Fixes missing SDL navigation in Flash menus (e.g. PDA) as highlighted within comments for issue #942.

This PR solves the problem by adding K_JOY_STICK*_LEFT/RIGHT/UP/DOWN key injection for SDL when left and right joysticks are moved outside of their dead zones. While the implementation is SDL-specific, it matches the approach taken in Windows and should result in the same behaviour when using a game controller.

Note this results in additional synthetic key presses being generated when using controller joysticks to move around in-game, but this does not seems to cause problems on levels I have tested.

Also suppressed a few more SDL "unknown events" for Joysticks and Controllers.

This PR has been tested on macOS and Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant