From 19c1b9fd3dd5955893c0d3c187a4180313e9a0f1 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 22 Jan 2019 10:28:14 +0100 Subject: keymap: fix keyup mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is possible that the modifier state on keyup is different from the modifier state on keydown. In that case the keycode lookup can end up with different keys in case multiple keysym -> keycode mappings exist, because it picks the mapping depending on modifier state. To fix that change the lookup logic for keyup events. Instead of looking at the modifier state check the key state and prefer a keycodes where the key is in "down" state right now. Fixes: abb4f2c965 keymap: consider modifier state when picking a mapping Buglink: https://bugs.launchpad.net/bugs/1738283 Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1658676 Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Message-id: 20190122092814.14919-9-kraxel@redhat.com --- ui/keymaps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/keymaps.h') diff --git a/ui/keymaps.h b/ui/keymaps.h index d8652b8a5a..b6d48aac40 100644 --- a/ui/keymaps.h +++ b/ui/keymaps.h @@ -56,7 +56,7 @@ typedef struct kbd_layout_t kbd_layout_t; kbd_layout_t *init_keyboard_layout(const name2keysym_t *table, const char *language, Error **errp); int keysym2scancode(kbd_layout_t *k, int keysym, - QKbdState *kbd); + QKbdState *kbd, bool down); int keycode_is_keypad(kbd_layout_t *k, int keycode); int keysym_is_numlock(kbd_layout_t *k, int keysym); -- cgit v1.2.3