summaryrefslogtreecommitdiff
path: root/ui/sdl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-01-15 16:48:54 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-01-25 15:22:23 +0100
commitf8d2c9369b8302f65f4f43f14ed3987c2268a02a (patch)
treeeb59d0d0e2bbb0dbb0cc6b6b2db42863d20e1c30 /ui/sdl.c
parente52c6ba34149b4f39c3fd60e59ee32b809db2bfa (diff)
downloadqemu-f8d2c9369b8302f65f4f43f14ed3987c2268a02a.tar.gz
sdl: use ctrl-alt-g as grab hotkey
Be consistent with gtk and cocoa. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20180115154855.30850-2-kraxel@redhat.com
Diffstat (limited to 'ui/sdl.c')
-rw-r--r--ui/sdl.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/ui/sdl.c b/ui/sdl.c
index f26048d3a2..0017b4a912 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -323,11 +323,11 @@ static void sdl_update_caption(void)
status = " [Stopped]";
else if (gui_grab) {
if (alt_grab)
- status = " - Press Ctrl-Alt-Shift to exit mouse grab";
+ status = " - Press Ctrl-Alt-Shift-G to exit mouse grab";
else if (ctrl_grab)
- status = " - Press Right-Ctrl to exit mouse grab";
+ status = " - Press Right-Ctrl-G to exit mouse grab";
else
- status = " - Press Ctrl-Alt to exit mouse grab";
+ status = " - Press Ctrl-Alt-G to exit mouse grab";
}
if (qemu_name) {
@@ -531,6 +531,16 @@ static void handle_keydown(SDL_Event *ev)
toggle_full_screen();
gui_keysym = 1;
break;
+ case 0x22: /* 'g' key */
+ if (!gui_grab) {
+ if (qemu_console_is_graphic(NULL)) {
+ sdl_grab_start();
+ }
+ } else if (!gui_fullscreen) {
+ sdl_grab_end();
+ }
+ gui_keysym = 1;
+ break;
case 0x16: /* 'u' key on US keyboard */
if (scaling_active) {
scaling_active = 0;
@@ -666,20 +676,6 @@ static void handle_keyup(SDL_Event *ev)
}
if (!mod_state && gui_key_modifier_pressed) {
gui_key_modifier_pressed = 0;
- if (gui_keysym == 0) {
- /* exit/enter grab if pressing Ctrl-Alt */
- if (!gui_grab) {
- if (qemu_console_is_graphic(NULL)) {
- sdl_grab_start();
- }
- } else if (!gui_fullscreen) {
- sdl_grab_end();
- }
- /* SDL does not send back all the modifiers key, so we must
- * correct it. */
- reset_keys();
- return;
- }
gui_keysym = 0;
}
if (qemu_console_is_graphic(NULL) && !gui_keysym) {