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


From: BALATON Zoltan
Subject: Re: [PATCH 2/2] ui/cocoa: add option to swap Option and Command
Date: Mon, 7 Mar 2022 13:25:36 +0100 (CET)

On Mon, 7 Mar 2022, Akihiko Odaki wrote:
On 2022/03/07 16:17, Markus Armbruster wrote:
BALATON Zoltan <balaton@eik.bme.hu> writes:

On Sun, 6 Mar 2022, Akihiko Odaki wrote:
From: Gustavo Noronha Silva <gustavo@noronha.dev.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, disabled by default.

Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gustavo Noronha Silva <gustavo@noronha.dev.br>
Message-Id: <20210713213200.2547-3-gustavo@noronha.dev.br>
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
qapi/ui.json    |  8 ++++++-
qemu-options.hx |  3 ++-
ui/cocoa.m      | 64 ++++++++++++++++++++++++++++++++++++++++++-------
3 files changed, 65 insertions(+), 10 deletions(-)

diff --git a/qapi/ui.json b/qapi/ui.json
index 1e9893419fe..b082e1a7dee 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1270,10 +1270,16 @@
#             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: off)
+#
# Since: 6.1
##
{ 'struct'  : 'DisplayCocoa',
-  'data'    : { '*full-grab'     : 'bool' } }
+  'data'    : { '*full-grab'           : 'bool',
+                '*swap-option-command' : 'bool' } }

This option name is too long to type. Could we abbreviate it somehow?

We've largely avoided abbreviations in the QAPI schema, for better or
worse.

There are already some abreviated options in this file and since users will need to use it to switch this on it's better to have something that can be typed without too much hassle and result in a command that still fits in a window...

Like swap-opt-cmd or swap-alt-meta?

We should stick to how the keys are generally called on this platform.
I can't say (I'm not using it).


The patch series is now in:
20220306231753.50277-1-philippe.mathieu.daude@gmail.com/">https://patchew.org/QEMU/20220306231753.50277-1-philippe.mathieu.daude@gmail.com/

It uses swap-opt-cmd for the name. Please reply to the series if it is problematic.

The more common name for these keys on macOS is option and command although the opt key sometimes also has alt written on it and the code seems to use meta instead of command but I think swap-opt-cmd is simple and clear so unless it's mandatory to have very long options that's not practical for users I'd go with swap-opt-cmd (which is what's in the last patch from Philippe so it should be OK).

Regards,
BALATON Zoltan



reply via email to

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