Friday, January 28, 2011

qemu Ctrl-Alt

While have to work with qemu, I noticed nasty thing - when one often
switches backward-and-forward between guest and host, qemu (or guest?)
goes insane about Left Ctrl key and assumes it's pressed constantly.
Boom, believe me or not, guest becomes totally unusable.

By default qemu use LCtrl-LAlt to grab/release input. I changed it
to RALT - it's not that I use this key much anyway, I'm not even sure I
ever did.

"If you can't live with it - patch it!"

---

diff --git a/ui/sdl.c b/ui/sdl.c
index f599d42..606cc36 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -49,7 +49,7 @@ static int gui_noframe;
 static int gui_key_modifier_pressed;
 static int gui_keysym;
 static int gui_fullscreen_initial_grab;
-static int gui_grab_code = KMOD_LALT | KMOD_LCTRL;
+static int gui_grab_code = KMOD_RALT; //KMOD_LALT | KMOD_LCTRL;
 static uint8_t modifiers_state[256];
 static int width, height;
 static SDL_Cursor *sdl_cursor_normal;
@@ -425,7 +425,7 @@ static void sdl_update_caption(void)
         else if (ctrl_grab)
             status = " - Press Right-Ctrl to exit mouse grab";
         else
-            status = " - Press Ctrl-Alt to exit mouse grab";
+            status = " - Press RALT to exit mouse grab"; //" - Press Ctrl-Alt to exit mouse grab";
     }

     if (qemu_name) {

No comments:

Post a Comment