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.
When using dead keys, for instance
´andato writeá, in some keyboard layouts under X11,ReceivedCharacterevent is fired twice:This issue seems to be related to
XFilterEventwhich 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.