Skip to content

Update modifiers before propagating key press events #1124

@chrisduerr

Description

@chrisduerr

Currently, when receiving WindowEvent::KeyboardInput events, 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 shift set, 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 shift modifier 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedDS - waylandAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsS - platform parityUnintended platform differences

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions