-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update modifiers before propagating key press events #1124
Copy link
Copy link
Closed
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedIssue must be confirmed and researchedDS - waylandAffects the Wayland backend, or generally free Unix platformsAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsAffects the X11 backend, or generally free Unix platformsS - platform parityUnintended platform differencesUnintended platform differences
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedIssue must be confirmed and researchedDS - waylandAffects the Wayland backend, or generally free Unix platformsAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsAffects the X11 backend, or generally free Unix platformsS - platform parityUnintended platform differencesUnintended platform differences
Currently, when receiving
WindowEvent::KeyboardInputevents, it is not possible to detect when all shift keys have been released unless manually tracking the shift key state. This is the case for all modifiers.The cause of this is that the modifiers get updated after the events are sent, which means that shift press key events do not have the modifiers
shiftset, but shift release events always do have them set. As a result, it's impossible to know if RShift is still held when the released event for LShift comes in.My proposal to solve this would be to just update the shift state before sending the key events. This would mean that when LShift comes in and the
shiftmodifier is still set, RShift must still be held.Of course this is a breaking change and I'm not sure what inspired the initial design, which is why I haven't looked into the code changes myself yet. But are there any specific reasons why this would be a bad idea?