1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-27 15:37:29 +03:00
wezterm/window
Wez Furlong 223ba32de2
x11: fix handling of high-speed key events
test scenario is:

```
bash -c "sleep 5; for((i=0;i<30;i++)); do xdotool keydown --delay 0 Shift_L keydown --delay 0 9 keyup --delay 0 Shift_L keyup --delay 0 9; done"
```

That should cause a series of `(` characters to be emitted, but prior to
this commit is was usually mostly `9`'s.

What's changing here is:
* We copy the pertinent fields from the last xcb StateNotify event.
  That ostensibly has the current modifier and layout state, but
  because it comes from the X server, it doesn't factor in knowledge
  from the IME.
* When processing an XCB key event, compute the current modifier
  mask and override the XKB state with it.
* Now XKB will produce correct information about the key syms
* Restore the modifier state from the saved StateNotify information.

refs: https://github.com/wez/wezterm/pull/4151
refs: https://github.com/wez/wezterm/issues/4615
refs: https://github.com/fcitx/fcitx5/issues/893
refs: https://github.com/ibus/ibus/issues/2600
refs: https://github.com/wez/wezterm/issues/3840
2024-01-24 08:04:39 -07:00
..
examples add window:keyboard_modifiers() method 2023-04-16 19:53:32 -07:00
src x11: fix handling of high-speed key events 2024-01-24 08:04:39 -07:00
build.rs macos: handle dead keys without IME 2021-01-31 17:06:30 -08:00
Cargo.toml switch wholesale to my fork xcb-imdkit, as it is not actively maintained 2024-01-23 17:50:04 -07:00
LICENSE.md Add missing license files 2022-08-17 07:19:12 -07:00