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: Akihiko Odaki
Subject: Re: [PATCH 2/2] ui/cocoa: add option to swap Option and Command
Date: Mon, 7 Mar 2022 16:50:01 +0900
User-agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

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.

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.

Regards,
Akihiko Odaki



reply via email to

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