From patchwork Sun Oct 18 16:24:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mulyadi Santosa X-Patchwork-Id: 36339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6342B7B99 for ; Mon, 19 Oct 2009 03:25:27 +1100 (EST) Received: from localhost ([127.0.0.1]:53238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzYZP-0007A1-Kn for incoming@patchwork.ozlabs.org; Sun, 18 Oct 2009 12:25:23 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=oqgfuuXCKR6KW6mikHwJL+Ba28xRTG5zb62LJor/y2s=; b=QVKij5EgM9iY90KrlVa0MKxXgKUwojucrQam8schI+p5WWWdBJlspefMIqgS0qlFOj LuC6UJHH1vjl2iPqaeT9wrxtYlAtAcQ/Xxz6wm3yDtPinT12V3DdDNT+lbdenRM/zzgy C7McdZdEZ5wU/RpCfvLPq+LTdsAJUoHXccaDI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=YOAHmu/kLnLPcAueGjBJY8+UTAxQHLccwmWXSpRvefxFjoBN1GUbZeR1I5IA7KmoSU tqBxq5vzuGbijcSh60oOMMC4t8Sg2u7Cr9fCVp/pUjJFWhFuByugl9dffBX410evF7XP eeFZkuEfthtfs3GGwxqMlNRNZ3al/KZ/OROIA= MIME-Version: 1.0 Received: by 10.143.131.6 with SMTP id i6mr232017wfn.340.1255883088194; Sun, 18 Oct 2009 09:24:48 -0700 (PDT) From: Mulyadi Santosa Date: Sun, 18 Oct 2009 23:24:28 +0700 Message-ID: To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH] new SDL keyboard shortcuts to start and stop VM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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(+) 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; } --- 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 */