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

Android: trigger keyboard events of Android game keys with or without an active joystick #1480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alemart
Copy link
Contributor

@alemart alemart commented Oct 3, 2023

Allegro defines 18 "Android game keys" in keycodes.h. Keyboard events of 10 of them will not be triggered after a successful call to al_install_joystick(), leading to inconsistent behavior. This patch makes events get triggered for these keys as well, regardless if a joystick has been installed or not. It makes behavior consistent and fixes #1479.

@SiegeLord
Copy link
Member

This isn't needed anymore now that #1483 is merged, right?

@alemart
Copy link
Contributor Author

alemart commented Feb 15, 2024

This isn't needed anymore now that #1483 is merged, right?

I think that there is still a design issue that hasn't been addressed. If you agree, I would like to make a change.

Even though the joystick API now supports all buttons, game controllers are still mapped to the keyboard API, and only partially so. Such mapping has no use since #1483 and has an incomplete button set. This behavior isn't documented anywhere and is inconsistent with other platforms. Why keep it? Gamepads are not keyboards.

We could now have users rely on the joystick API to read input from game controllers, as they do in other platforms. We could use the keyboard API to catch input of remote controllers of Smart TVs instead.

In this proposal, devices and APIs will no longer overlap. This is a more useful design in my view. May I proceed with this idea?

@SiegeLord
Copy link
Member

Yeah, let's do that. Thanks for thinking through this!

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.

Android-specific keys never trigger keyboard events
2 participants