qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ui/cocoa.m: Allow console selection using keypa


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Allow console selection using keypad number keys
Date: Thu, 3 Mar 2016 16:53:19 +0000

On 3 March 2016 at 03:34, Programmingkid <address@hidden> wrote:
> This patch allows for the user to use the keypad number keys to select a
> console.
>
> Signed-off-by: John Arbuckle <address@hidden>
>
> ---
> 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;
>
>              // 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 = atoi([[event characters]
> +                                           cStringUsingEncoding:
> +                                           NSASCIIStringEncoding]);
> +                console_select(selected_console - 1);

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.


>
>              // handle keys for graphic console
>              } else if (qemu_console_is_graphic(NULL)) {

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]