* Re: [PATCH v5 0/2] cocoa: keyboard quality of life
[not found] <mailman.16196.1626230271.10239.qemu-devel@nongnu.org>
@ 2021-07-15 20:53 ` Programmingkid
0 siblings, 0 replies; 2+ messages in thread
From: Programmingkid @ 2021-07-15 20:53 UTC (permalink / raw)
To: Gustavo Noronha Silva, QEMU devel list
Cc: peter.maydell, armbru, Gerd Hoffmann, Akihiko Odaki, Eric Blake
> From: Gustavo Noronha Silva <gustavo@noronha.dev.br>
>
> v5 addresses the casting issue pointed out by Akihiko Odaki.
> Sorry it took me so long to update the patches, but here
> they are! Hopefully we can get them in now ;D
>
> Btw I also changed my email address slightly (.dev.br
> instead of .eti.br).
>
> -----
>
> This series adds two new options to the cocoa display:
>
> - full-grab causes it to use a global tap to steal system combos
> away from Mac OS X, so they can be handled by the VM
>
> - swap-option-command does what it says on the tin; while that is
> something you can do at the Mac OS X level or even supported by
> some keyboards, it is much more convenient to have qemu put
> Meta/Super and Alt where they belong if you are running a
> non-Mac VM
>
> Both are off by default. For full-grab in particular, it is off also
> because unfortunately it needs accessibility permissions for input
> grabbing, so it requires more deliberate action by the user anyway.
>
> Gustavo Noronha Silva (2):
> ui/cocoa: capture all keys and combos when mouse is grabbed
> ui/cocoa: add option to swap Option and Command
>
> qapi/ui.json | 22 +++++++++
> qemu-options.hx | 4 ++
> ui/cocoa.m | 129 ++++++++++++++++++++++++++++++++++++++++++++----
> 3 files changed, 146 insertions(+), 9 deletions(-)
>
> --
> 2.30.1 (Apple Git-130)
I could not make the full-grab feature work. I tried this:
./build/qemu-system-ppc -display cocoa,full_grab=on
This is the error message I saw:
qemu-system-ppc: -display cocoa,full_grab=on: Parameter 'full_grab' is unexpected
The command and option key swapping feature does work. This should be a very useful feature to those with a PC keyboard.
I totally suggest that a new menu called Options be made with these features added.
This is how it could look like:
Options
- Full Keyboard Grab
- Swap Command and Option Keys
Right now the user has to restart QEMU if he or she wants to swap the command and options keys to initiate a full keyboard grab. This is not fun. With a menu the user could change these options while QEMU remains running.
This code can be used to add the Options menu:
ui/cocoa.m | 137 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 128 insertions(+), 9 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 9f72844b07..de85305c7a 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1655,6 +1755,14 @@ static void create_initial_menus(void)
[menuItem setSubmenu:menu];
[[NSApp mainMenu] addItem:menuItem];
+ // Options menu
+ menu = [[NSMenu alloc] initWithTitle:@"Options"];
+ [menu addItem: [[[NSMenuItem alloc] initWithTitle:@"Full Keyboard Grab" action:@selector(setFullGrab:) keyEquivalent:@""] autorelease]];
+ [menu addItem: [[[NSMenuItem alloc] initWithTitle:@"Swap Command and Option Keys" action:@selector(setSwapOptionCommand:) keyEquivalent:@""] autorelease]];
+ menuItem = [[[NSMenuItem alloc] initWithTitle:@"Options" action:nil keyEquivalent:@""] autorelease];
+ [menuItem setSubmenu:menu];
+ [[NSApp mainMenu] addItem:menuItem];
+
// Window menu
menu = [[NSMenu alloc] initWithTitle:@"Window"];
[menu addItem: [[[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"] autorelease]]; // Miniaturize
To be able to check and uncheck menu items you could see the method (void)adjustSpeed:(id)sender.
Please let me know if there is anything else I could do to help.
Thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v5 0/2] cocoa: keyboard quality of life
@ 2021-07-13 21:31 gustavo
0 siblings, 0 replies; 2+ messages in thread
From: gustavo @ 2021-07-13 21:31 UTC (permalink / raw)
To: qemu-devel
Cc: 'Peter Maydell ', 'Markus Armbruster ',
'Gerd Hoffmann ', 'Akihiko Odaki ',
'Eric Blake ',
Gustavo Noronha Silva
From: Gustavo Noronha Silva <gustavo@noronha.dev.br>
v5 addresses the casting issue pointed out by Akihiko Odaki.
Sorry it took me so long to update the patches, but here
they are! Hopefully we can get them in now ;D
Btw I also changed my email address slightly (.dev.br
instead of .eti.br).
-----
This series adds two new options to the cocoa display:
- full-grab causes it to use a global tap to steal system combos
away from Mac OS X, so they can be handled by the VM
- swap-option-command does what it says on the tin; while that is
something you can do at the Mac OS X level or even supported by
some keyboards, it is much more convenient to have qemu put
Meta/Super and Alt where they belong if you are running a
non-Mac VM
Both are off by default. For full-grab in particular, it is off also
because unfortunately it needs accessibility permissions for input
grabbing, so it requires more deliberate action by the user anyway.
Gustavo Noronha Silva (2):
ui/cocoa: capture all keys and combos when mouse is grabbed
ui/cocoa: add option to swap Option and Command
qapi/ui.json | 22 +++++++++
qemu-options.hx | 4 ++
ui/cocoa.m | 129 ++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 146 insertions(+), 9 deletions(-)
--
2.30.1 (Apple Git-130)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-15 20:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <mailman.16196.1626230271.10239.qemu-devel@nongnu.org>
2021-07-15 20:53 ` [PATCH v5 0/2] cocoa: keyboard quality of life Programmingkid
2021-07-13 21:31 gustavo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.