Received: from eggs.gnu.org ([2001:4830:134:3::10]:50807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abWZ7-0001ly-PI for qemu-devel@nongnu.org; Thu, 03 Mar 2016 11:57:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abWZ3-00083V-Os for qemu-devel@nongnu.org; Thu, 03 Mar 2016 11:57:29 -0500 Received: from mail-ig0-x233.google.com ([2607:f8b0:4001:c05::233]:36898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abWZ3-000836-GI for qemu-devel@nongnu.org; Thu, 03 Mar 2016 11:57:25 -0500 Received: by mail-ig0-x233.google.com with SMTP id z8so21165724ige.0 for ; Thu, 03 Mar 2016 08:57:25 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: Date: Thu, 3 Mar 2016 11:57:23 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <12E9277C-605D-498E-93CF-38EBE6640C89@gmail.com> References: Subject: Re: [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 On Mar 3, 2016, at 11:53 AM, Peter Maydell wrote: > On 3 March 2016 at 03:34, Programmingkid = wrote: >> This patch allows for the user to use the keypad number keys to = select a >> console. >>=20 >> Signed-off-by: John Arbuckle >>=20 >> --- >> This patch depends on this patch: = http://patchwork.ozlabs.org/patch/591221/ >>=20 >> ui/cocoa.m | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >>=20 >> 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 > Why keypad number keys? I don't think any of our other UI front > ends do that. The usual hotkey is ctrl+alt+number for one of the > number keys on the top row of the keyboard. A number is a number. Should it matter where on the keyboard that number = came from? >=20 >=20 >>=20 >> // handle keys for graphic console >> } else if (qemu_console_is_graphic(NULL)) { >=20 > thanks > -- PMM