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 - Keys can get stuck in pressed state
Summary: Keys can get stuck in pressed state
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.10
Hardware: All Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.16
Depends on:
Blocks:
 
Reported: 2020-01-13 14:00 UTC by Rokas Kupstys
Modified: 2020-07-16 18:29 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 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