qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 04/10] sdl2: turn on keyboard grabs


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 04/10] sdl2: turn on keyboard grabs
Date: Thu, 11 Dec 2014 11:49:27 +0100

Makes quite some keys actually go to the guest instead of
being captured by the host window manager.

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 ui/sdl2.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index b8d592f..9b66017 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -189,11 +189,11 @@ static void sdl_update_caption(struct sdl2_console *scon)
         status = " [Stopped]";
     } else if (gui_grab) {
         if (alt_grab) {
-            status = " - Press Ctrl-Alt-Shift to exit mouse grab";
+            status = " - Press Ctrl-Alt-Shift to exit grab";
         } else if (ctrl_grab) {
-            status = " - Press Right-Ctrl to exit mouse grab";
+            status = " - Press Right-Ctrl to exit grab";
         } else {
-            status = " - Press Ctrl-Alt to exit mouse grab";
+            status = " - Press Ctrl-Alt to exit grab";
         }
     }
 
@@ -785,6 +785,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, 
int no_frame)
                 SDL_GetError());
         exit(1);
     }
+    SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
 
     for (i = 0;; i++) {
         QemuConsole *con = qemu_console_lookup_by_index(i);
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]