Received: from eggs.gnu.org ([2001:4830:134:3::10]:35453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abK1k-0007dg-Sl for qemu-devel@nongnu.org; Wed, 02 Mar 2016 22:34:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abK1h-0001f7-KS for qemu-devel@nongnu.org; Wed, 02 Mar 2016 22:34:12 -0500 Received: from mail-io0-x22b.google.com ([2607:f8b0:4001:c06::22b]:32802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abK1h-0001f3-Ec for qemu-devel@nongnu.org; Wed, 02 Mar 2016 22:34:09 -0500 Received: by mail-io0-x22b.google.com with SMTP id n190so14467723iof.0 for ; Wed, 02 Mar 2016 19:34:09 -0800 (PST) From: Programmingkid Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Wed, 2 Mar 2016 22:34:07 -0500 Message-Id: Mime-Version: 1.0 (Apple Message framework v1084) Subject: [Qemu-devel] [PATCH] ui/cocoa.m: Allow console selection using keypad number keys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel qemu-devel This patch allows for the user to use the keypad number keys to select a console. Signed-off-by: John Arbuckle --- This patch depends on this patch: = http://patchwork.ozlabs.org/patch/591221/ ui/cocoa.m | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 65301ff..d3310bf 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -562,13 +562,10 @@ QemuCocoaView *cocoaView; =20 // handle control + alt Key Combos (ctrl+alt is reserved = for QEMU) if (([event modifierFlags] & NSControlKeyMask) && ([event = modifierFlags] & NSAlternateKeyMask)) { - switch (keycode) { - - // enable graphic console - case Q_KEY_CODE_1 ... Q_KEY_CODE_9: // '1' to '9' = keys - console_select(keycode - 11); - break; - } + int selected_console =3D atoi([[event characters] + cStringUsingEncoding: + NSASCIIStringEncoding]); + console_select(selected_console - 1); =20 // handle keys for graphic console } else if (qemu_console_is_graphic(NULL)) { --=20 2.7.2