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 3431

Summary: Duplicate SDL_KEYDOWN events for Left Alt and combinations
Product: SDL Reporter: Alex Smith <asmith>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   

Description Alex Smith 2016-09-20 10:31:37 UTC
If the Left Alt key is pressed, or a combination of that and another key is pressed, this will send two SDL_KEYDOWN events.

From what I can tell this is because for some reason X is sending two FocusOut events and a FocusIn event prior to the KeyPress event whenever Left Alt or a combination with it are pressed. On the FocusIn event X11_ReconcileKeyboardState is called, which will call SDL_SendKeyboardKey(SDL_PRESSED, ...) because it will see that the key is pressed. Then SDL_SendKeyboardKey will be called again on the KeyPress, which is treated as a repeat so another SDL_KEYDOWN is sent.

This is happening on Ubuntu 16.04 under Unity, with both SDL 2.0.4 and current HG.