From 4b01b55f75218cfddcda0d5e9b355a1407053d70 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Fri, 22 Sep 2017 15:03:23 +0200 Subject: [PATCH] seat.keyboard: fix sym peek with +8 offset --- src/seat/keyboard.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/seat/keyboard.rs b/src/seat/keyboard.rs index 0a6ea4c..4855e08 100644 --- a/src/seat/keyboard.rs +++ b/src/seat/keyboard.rs @@ -263,7 +263,9 @@ impl KbdHandle { trace!(self.arc.logger, "Handling keystroke"; "keycode" => keycode, "state" => format_args!("{:?}", state)); let mut guard = self.arc.internal.lock().unwrap(); - let sym = guard.state.key_get_one_sym(keycode); + // Offset the keycode by 8, as the evdev XKB rules reflect X's + // broken keycode system, which starts at 8. + let sym = guard.state.key_get_one_sym(keycode+8); let mods_changed = guard.key_input(keycode, state);