Skip to content

Duplicated keyboard events with dead keys in X11 #107

@siiptuo

Description

@siiptuo

When using dead keys, for instance ´ and a to write á, in some keyboard layouts under X11, ReceivedCharacter event is fired twice:

KeyboardInput(Pressed, 21, None)
KeyboardInput(Released, 21, None)
ReceivedCharacter('á')
KeyboardInput(Pressed, 0, None)
ReceivedCharacter('á')
KeyboardInput(Pressed, 0, None)
KeyboardInput(Released, 38, Some(A))

This issue seems to be related to XFilterEvent which is called in the code but doesn't really do anything. Checking the return value and returning early if it's non-zero seems to fix this issue.

Other software simply skip those events altogether or do something more or less complicated. In these examples filtering is also done for all events, not only in key events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - x11Affects the X11 backend, or generally free Unix platforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions