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 3074

Summary: Event SDL_KEYDOWN keysym.mod allway return 0
Product: SDL Reporter: zaros64
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: adam, sezeroz
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 7   

Description zaros64 2015-07-25 15:36:22 UTC
Version: SDL 2.0.3 (stable) 
Problem: Event SDL_KEYDOWN keysym.mod allway return 0
Solution: copy line: 740  at file: SDL_keyboard.c 
  modstate = keyboard->modstate; 
to line 756 will fix this.
Comment 1 Adam M. 2016-01-28 03:05:54 UTC
It's not true that keysym.mod is always zero. Rather, keysym.mod seems to be the modifier key state from before the event rather than the "current" value as documented, but only in the case of key down events. For key up events it does give the correct (current) value. As a result, if you simply press and release individual mod keys, .mod is always zero. But if you press multiple keys simultaneously, such as Shift+A or Shift+Ctrl, you'll see that .mod changes.

This is the same problem described in bug #3249. Even though this bug report is older, I'm resolving it as a duplicate because #3249 more correctly characterizes the problem.

*** This bug has been marked as a duplicate of bug 3249 ***