qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] new SDL keyboard shortcuts to start and stop VM
@ 2009-10-18 16:24 Mulyadi Santosa
  2009-10-19 22:20 ` Anthony Liguori
  0 siblings, 1 reply; 43+ messages in thread
From: Mulyadi Santosa @ 2009-10-18 16:24 UTC (permalink / raw)
  To: qemu-devel

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 <mulyadi.santosa@gmail.com>

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;
                     }

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2009-10-27  9:28 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-18 16:24 [Qemu-devel] [PATCH] new SDL keyboard shortcuts to start and stop VM Mulyadi Santosa
2009-10-19 22:20 ` Anthony Liguori
2009-10-20  3:16   ` Mulyadi Santosa
2009-10-20  7:58     ` Gerd Hoffmann
2009-10-20  8:12     ` Daniel P. Berrange
2009-10-20 10:40   ` Kevin Wolf
2009-10-20 16:59     ` Anthony Liguori
2009-10-20 17:08     ` Daniel P. Berrange
2009-10-20 22:14       ` Mulyadi Santosa
2009-10-21  7:27       ` Kevin Wolf
2009-10-21 13:52         ` Glauber Costa
2009-10-21 16:04           ` Mulyadi Santosa
2009-10-21 16:24             ` Glauber Costa
2009-10-21 16:44               ` Mulyadi Santosa
2009-10-21 16:48                 ` Glauber Costa
2009-10-21 18:35                 ` Jamie Lokier
2009-10-22 14:40                   ` Luiz Capitulino
2009-10-22 15:02                     ` Kevin Wolf
2009-10-22 16:32                       ` Luiz Capitulino
2009-10-22 15:40                     ` Anthony Liguori
2009-10-22 16:38                       ` Luiz Capitulino
2009-10-22 18:32                         ` Anthony Liguori
     [not found]                           ` <m33a5bj851.fsf@neno.mitica>
2009-10-23  7:40                             ` [Qemu-devel] " Kevin Wolf
2009-10-23 11:23                               ` Mulyadi Santosa
2009-10-23 11:45                                 ` Kevin Wolf
2009-10-23 13:59                                   ` Anthony Liguori
2009-10-23 14:36                                     ` Kevin Wolf
2009-10-25 15:28                                     ` Avi Kivity
2009-10-25 15:44                                       ` Luiz Capitulino
2009-10-26 13:45                                       ` Anthony Liguori
2009-10-26 14:13                                         ` Avi Kivity
2009-10-26 15:04                                           ` Anthony Liguori
2009-10-26 15:07                                             ` Avi Kivity
2009-10-26 15:49                                               ` Anthony Liguori
2009-10-26 16:08                                                 ` Avi Kivity
2009-10-26 16:17                                                   ` Anthony Liguori
2009-10-27  9:11                                                   ` Gerd Hoffmann
2009-10-27  9:28                                                     ` Avi Kivity
2009-10-21 16:55           ` [Qemu-devel] " Anthony Liguori
2009-10-21 17:01             ` Mulyadi Santosa
2009-10-21 17:04             ` Glauber Costa
2009-10-21 18:08               ` Anthony Liguori
2009-10-22  7:58                 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).