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

al_key_down ignores shift for num lock on + key pad press (Windows only) #713

Open
oitofelix opened this issue Jan 14, 2017 · 1 comment

Comments

@oitofelix
Copy link
Contributor

On Windows, al_key_down doesn't detect ALLEGRO_KEY_{L,R}SHIFT press when Num lock is on and ALLEGRO_KEY_PAD_? is pressed simultaneously. This works fine on GNU/Linux, though.

@SiegeLord
Copy link
Member

Windows sends us an extra KEY_UP event when you hit a numpad key while holding shift, as this log from ex_keyboard_events shows:

KEY_DOWN  code=215, char=' ' (   0), modifiers=00000000, [LSHIFT]
KEY_UP    code=215, char=' ' (   0), modifiers=00000000, [LSHIFT]
KEY_DOWN  code=043, char=' ' (   0), modifiers=00000000, [PAD 6]
KEY_CHAR  code=043, char=' ' (   0), modifiers=00000200, [PAD 6]
KEY_UP    code=043, char=' ' (   0), modifiers=00000000, [PAD 6]
KEY_DOWN  code=215, char=' ' (   0), modifiers=00000000, [LSHIFT]
KEY_UP    code=215, char=' ' (   0), modifiers=00000000, [LSHIFT]

That shows me pressing and holding shift, tapping numpad 6 (with numlock on as modifiers show) and then releasing shift. Despite that I get 2 down and up events for the shift key.

As far as I understand this is a limitation of the input API we're using (Win32). It's not obvious what can be done about this.

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

No branches or pull requests

2 participants