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

Summary: LSHIFT + numpad bug
Product: SDL Reporter: eddietree <edwardlee1967>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: vikas.ag
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 8   

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.