On X11, avoid false positive key repeats

Instead of a single `bool` indicating that a key press has occured and
no key has been released since then, we store the scancode of the last
pressed key (if it is a key that repeats when held). This fixes a bug
where pressing a new key while one is already held down will be flagged
as a repeat even though it is obviously not a repeat.
This commit is contained in:
Imbris authored and GitHub committed 2023-07-09 17:05:49 +00:00
1 parent bca57ed0b4
commit bd890e69aa
4 files changed
+41 -8

No files matched your search

@@ -354,7 +354,6 @@ impl KbdState {
self.post_init(state, keymap);
}
#[cfg(feature = "wayland")]
pub fn key_repeats(&mut self, keycode: ffi::xkb_keycode_t) -> bool {
unsafe { (XKBH.xkb_keymap_key_repeats)(self.xkb_keymap, keycode) == 1 }
}