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 - Event SDL_KEYDOWN keysym.mod allway return 0
Summary: Event SDL_KEYDOWN keysym.mod allway return 0
Status: RESOLVED DUPLICATE of bug 3249
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.3
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-25 15:36 UTC by zaros64
Modified: 2016-01-28 03:05 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***