From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzYYx-00079o-HB for qemu-devel@nongnu.org; Sun, 18 Oct 2009 12:24:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzYYs-00079D-5M for qemu-devel@nongnu.org; Sun, 18 Oct 2009 12:24:54 -0400 Received: from [199.232.76.173] (port=35108 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzYYs-00079A-0i for qemu-devel@nongnu.org; Sun, 18 Oct 2009 12:24:50 -0400 Received: from mail-px0-f179.google.com ([209.85.216.179]:39444) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzYYr-00017q-M3 for qemu-devel@nongnu.org; Sun, 18 Oct 2009 12:24:49 -0400 Received: by pxi9 with SMTP id 9so638217pxi.4 for ; Sun, 18 Oct 2009 09:24:48 -0700 (PDT) MIME-Version: 1.0 From: Mulyadi Santosa Date: Sun, 18 Oct 2009 23:24:28 +0700 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] [PATCH] new SDL keyboard shortcuts to start and stop VM List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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; }