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 4939

Summary: Keys can get stuck in pressed state
Product: SDL Reporter: Rokas Kupstys <rokupstys>
Component: videoAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-2.0.16
Version: 2.0.10   
Hardware: All   
OS: Windows (All)   

Description Rokas Kupstys 2020-01-13 14:00:12 UTC
Steps:
1. Open SDL application and have it's window focused.
2. Press LGUI+v

Result:
Builtin windows clipboard utility pops up and SDLK_LGUI is not reported as released even though GetKeyState(VK_LWIN) does report key as released.

Expected result:
SDL should report SDLK_LGUI as released.

Cause:
Win32 does not send WM_KEYUP message.

Originally reported at: https://github.com/ocornut/imgui/issues/2976
Comment 1 Rokas Kupstys 2020-01-13 14:47:47 UTC
Actually this is true for every key. If key is released while window does not have focus VM_KEYUP will not be sent to that window.
Comment 2 Rokas Kupstys 2020-01-17 11:00:27 UTC
For reference, this is how GLFW fixed it: https://github.com/glfw/glfw/commit/562c17d131bd99d92f1166e2a8a42d7af023d122