From 68097ed5e5bd5bc5bfead8076dbef700a8537b15 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 18 Jul 2019 14:01:04 +0200 Subject: [PATCH 1/2] curses: assert get_wch return value is okay This prevents the compiler from reporting a possible uninitialized use of maybe_keycode in function curses_refresh. Cc: Gerd Hoffmann Signed-off-by: Paolo Bonzini Message-id: 1563451264-46176-1-git-send-email-pbonzini@redhat.com [ kraxel: whitespace fixup ] Signed-off-by: Gerd Hoffmann --- ui/curses.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/curses.c b/ui/curses.c index a6e260eb96..ec281125ac 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -225,6 +225,8 @@ static wint_t console_getch(enum maybe_keycode *maybe_keycode) case ERR: ret = -1; break; + default: + abort(); } return ret; } From a923b471fc59389e49575f38f4db3cd622619bf5 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 18 Aug 2019 12:50:38 +0200 Subject: [PATCH 2/2] input-linux: add shift+shift as a grab toggle We have ctrl-ctrl and alt-alt; why not shift-shift? That's my preferred grab binding, personally. Signed-off-by: Niklas Haas Message-id: 20190818105038.19520-1-qemu@haasn.xyz Signed-off-by: Gerd Hoffmann --- qapi/ui.json | 3 ++- ui/input-linux.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qapi/ui.json b/qapi/ui.json index 59e412139a..e04525d8b4 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1025,7 +1025,8 @@ # ## { 'enum': 'GrabToggleKeys', - 'data': [ 'ctrl-ctrl', 'alt-alt', 'meta-meta', 'scrolllock', 'ctrl-scrolllock' ] } + 'data': [ 'ctrl-ctrl', 'alt-alt', 'shift-shift','meta-meta', 'scrolllock', + 'ctrl-scrolllock' ] } ## # @DisplayGTK: diff --git a/ui/input-linux.c b/ui/input-linux.c index 59456fe765..a7b280b25b 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -113,6 +113,10 @@ static bool input_linux_check_toggle(InputLinux *il) return il->keydown[KEY_LEFTALT] && il->keydown[KEY_RIGHTALT]; + case GRAB_TOGGLE_KEYS_SHIFT_SHIFT: + return il->keydown[KEY_LEFTSHIFT] && + il->keydown[KEY_RIGHTSHIFT]; + case GRAB_TOGGLE_KEYS_META_META: return il->keydown[KEY_LEFTMETA] && il->keydown[KEY_RIGHTMETA];