qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] ui/cocoa: add option to swap Option and Command, enable


From: Markus Armbruster
Subject: Re: [PATCH 2/2] ui/cocoa: add option to swap Option and Command, enable by default
Date: Fri, 30 Apr 2021 09:25:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

gustavo@noronha.eti.br writes:

> From: Gustavo Noronha Silva <gustavo@noronha.eti.br>
>
> On Mac OS X the Option key maps to Alt and Command to Super/Meta. This change
> swaps them around so that Alt is the key closer to the space bar and 
> Meta/Super
> is between Control and Alt, like on non-Mac keyboards.
>
> It is a cocoa display option, enabled by default.
>
> Signed-off-by: Gustavo Noronha Silva <gustavo@noronha.eti.br>
> ---
>  qapi/ui.json    |  7 +++++-
>  qemu-options.hx |  1 +
>  ui/cocoa.m      | 66 +++++++++++++++++++++++++++++++++++++++++--------
>  3 files changed, 63 insertions(+), 11 deletions(-)
>
> diff --git a/qapi/ui.json b/qapi/ui.json
> index 77bc00fd0d..02db684251 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -1098,9 +1098,14 @@
   ##
   # @DisplayCocoa:
   #
   # Cocoa display options.
   #
   # @full-grab:       Capture all key presses, including system combos. This
   #                   requires accessibility permissions, since it performs
>  #                   a global grab on key events. (default: off)
>  #                   See 
> https://support.apple.com/en-in/guide/mac-help/mh32356/mac
>  #
> +# @swap-option-command: Swaps the Option and Command keys so that their key 
> codes

Please use imperative mood consistently: "Swap", like "Capture" above.

> +#                       match their position on non-Mac keyboards and you 
> can use
> +#                       Meta/Super and Alt where you expect them. (default: 
> on)
> +#

Drop the blank comment line, and break your lines a bit earlier.

>  ##

Like this:

   ##
   # @DisplayCocoa:
   #
   # Cocoa display options.
   #
   # @full-grab:       Capture all key presses, including system combos. This
   #                   requires accessibility permissions, since it performs
   #                   a global grab on key events. (default: off)
   #                   See 
https://support.apple.com/en-in/guide/mac-help/mh32356/mac
   #
   # @swap-option-command: Swap the Option and Command keys so that their key
   #                       codes match their position on non-Mac keyboards and
   #                       you can use Meta/Super and Alt where you expect
   #                       them. (default: on)
   ##


>  { 'struct'  : 'DisplayCocoa',
> -  'data'    : { '*full-grab'     : 'bool' } }
> +  'data'    : { '*full-grab'           : 'bool',
> +                '*swap-option-command' : 'bool' } }
>  
>  ##
>  # @DisplayType:

With the doc comment tidied up, QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>




reply via email to

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