aboutsummaryrefslogtreecommitdiff
path: root/ui/curses.c
diff options
context:
space:
mode:
authorAndrew Oates <andrew@aoates.org>2014-05-23 20:16:09 -0400
committerGerd Hoffmann <kraxel@redhat.com>2014-05-26 08:42:42 +0200
commitf5c0ab131265270c1e7852ec0d4e284a219d63d4 (patch)
tree585233ee5c97bd0f397537d9617ad0cc43294075 /ui/curses.c
parent178ac111bca16c08a79b2609ebdc75197bea976a (diff)
input (curses): mask keycodes to remove modifier bits
Without the mask, control bits are passed on in the keycode, generating incorrect PS/2 sequences when SHIFT, ALT, etc are held down. Cc: qemu-stable@nongnu.org Signed-off-by: Andrew Oates <andrew@aoates.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/curses.c')
-rw-r--r--ui/curses.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/curses.c b/ui/curses.c
index b044790e43..de85f7610f 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -288,8 +288,8 @@ static void curses_refresh(DisplayChangeListener *dcl)
qemu_input_event_send_key_number(NULL, GREY | ALT_CODE, true);
}
- qemu_input_event_send_key_number(NULL, keycode, true);
- qemu_input_event_send_key_number(NULL, keycode, false);
+ qemu_input_event_send_key_number(NULL, keycode & KEY_MASK, true);
+ qemu_input_event_send_key_number(NULL, keycode & KEY_MASK, false);
if (keycode & ALTGR) {
qemu_input_event_send_key_number(NULL, GREY | ALT_CODE, false);