We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2975 - LSHIFT + numpad bug
Summary: LSHIFT + numpad bug
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.3
Hardware: x86_64 Windows 8
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-02 21:49 UTC by eddietree
Modified: 2017-08-13 00:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eddietree 2015-05-02 21:49:09 UTC
Encountered a bug where if you hold LSHIFT down and press any of the NumPad buttons (0-9), it will unregister the LSHIFT as being not held down anymore even if it is up.

Repro case:
1) hold LSHIFT down (for the entire time)
2) press any button (0-9) on the NumPad
3) observe the LSHIFT button not being considered pressed anymore even thought I am still holding it down.

This is all using the SDL_GetKeyboardState(NULL) to grab keyboard state.
Comment 1 eddietree 2015-05-02 21:51:55 UTC
made a typo on the description, it should be

* it will unregister the LSHIFT as being not held down anymore even if it is held DOWN.
Comment 2 Vikas 2015-07-24 12:09:59 UTC
Please Check SDL wiki
https://wiki.libsdl.org/SDL_GetKeyboardState

It clearly says "This function doesn't take into account whether shift has been pressed or not"
Comment 3 Sam Lantinga 2017-08-13 00:15:21 UTC
This is really weird. I was able to reproduce this, and it turns out that Windows really is sending a key up message for LSHIFT, sending a key down message for the numpad button, sending a key up message for the numpad button and then sending a key down message for LSHIFT.

You can see this yourself using Spy++. Windows is doing this for all applications, not just SDL.