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 1626 - Keys don't get released when a window loses focus in X
Summary: Keys don't get released when a window loses focus in X
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-22 11:39 UTC by Sik
Modified: 2013-07-11 00:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sik 2012-10-22 11:39:53 UTC
When a window loses focus in X, it seems like the status of any keys that were pressed is not reset, which results in the program thinking they were never released (I've confirmed this in my program by making it show the status of some keys). Ideally, the program should think all keys are unreleased when the window loses focus.

This bug is really serious with Alt+Tab, since it means the Alt modifier keeps being held down, and any program that relies on modifiers for shortcuts will be unable to detect the shortcuts properly until the user presses the Alt key again (this keeps constantly biting me back as the level editor in my game relies on them, rendering it unusable).

Using Ubuntu 11.04 64-bit.
Comment 1 Ryan C. Gordon 2013-07-11 00:33:28 UTC
This got fixed at some point; getting a FocusOut event in X11 eventually results in an SDL_ResetKeyboard() call, which resets any pressed keys to released.

Confirmed working on a Ubuntu 12.04 install.

--ryan.