qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] new SDL keyboard shortcuts to start and stop VM


From: Mulyadi Santosa
Subject: [Qemu-devel] [PATCH] new SDL keyboard shortcuts to start and stop VM
Date: Sun, 18 Oct 2009 23:24:28 +0700

IMO, it would be faster if we provide keyboard shortcuts that will
stop and resume VM execution right from SDL guest interface, rather
than switching to console monitor first and type "s" or "c"
respectively.

Note: I simply skip checking the keys in encrypted block devices when
resuming the VM. Not sure whether we really need it or not.

Signed-off-by: Mulyadi Santosa <address@hidden>

sdl.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- sdl.c.bak   2009-08-02 16:00:28.000000000 +0700
+++ sdl.c       2009-10-18 22:53:59.000000000 +0700
@@ -440,6 +440,7 @@ static void sdl_refresh(DisplayState *ds
                 if (gui_key_modifier_pressed) {
                     int keycode;
                     keycode = sdl_keyevent_to_keycode(&ev->key);
+                    //fprintf(stderr,"scan code of key pressed is
%d\n",keycode);
                     switch(keycode) {
                     case 0x21: /* 'f' key on US keyboard */
                         toggle_full_screen(ds);
@@ -456,6 +457,14 @@ static void sdl_refresh(DisplayState *ds
                         }
                         gui_keysym = 1;
                         break;
+                    case 0x1f: /* 's' key -- stopping VM */
+                        vm_stop(16); /* 16 is EXCP_INTERRUPT */
+                        gui_keysym = 1;
+                        break;
+                    case 0x2e: /* 'c' key -- resuming VM */
+                        vm_start(); /* we skip checking encrypted
block drive */
+                        gui_keysym = 1;
+                        break;
                     default:
                         break;
                     }




reply via email to

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