[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6] ui/cocoa.m: Add ability for user to specify
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v6] ui/cocoa.m: Add ability for user to specify mouse ungrab key |
Date: |
Fri, 16 Feb 2018 14:15:40 +0100 |
User-agent: |
NeoMutt/20171215 |
On Sat, Feb 03, 2018 at 12:17:43PM -0500, John Arbuckle wrote:
> Currently the ungrab keys for the Cocoa and GTK interface are Control-Alt-g.
> This combination may not be very fun for the user to have to enter, so we
> now enable the user to specify their own key(s) as the ungrab key(s). The
> list of keys that can be used is found in the file qapi/ui.json under
> QKeyCode.
> The max number of keys that can be used is three.
>
> Syntax: -display cocoa,hotkey-grab=<key-key-key>
>
> Example usage: -display cocoa,hotkey-grab=home
> -display cocoa,hotkey-grab=shift-ctrl
> -display cocoa,hotkey-grab=ctrl-x
> -display cocoa,hotkey-grab=pgup-pgdn
> -display cocoa,hotkey-grab=kp_5-kp_6
> -display cocoa,hotkey-grab=kp_4-kp_5-kp_6
> -display cocoa,hotkey-grab=ctrl-alt
Finally found the time for a closer look and some testing.
Problem is the hotkeys are all forwarded to the guest.
So when using -- for example -- the pgup-pgdn hotkey
and you press the combination the guest will see it.
I see basically two options to deal with that:
(a) Make the code more clever. On pgup keydown event
the code has to figure this might be part of a hotkey
sequence, hold back the event to see what comes next.
- If the next event is pgup keyup -> ok, normal pgup
keypress, forward both keydown and keyup to the guest.
- If the next event is pgdn keydown -> hotkey found.
So do hotkey action, don't forward keydown (and
following keyup) events to the guest.
(b) Restrict allowed hotkeys to modifier key(s) plus one
non-modifier key. Forwarding modifier keydown+keyup
to the guest has typically effects inside the guest,
so we only have to hold back that single non-modifier
key. That is alot easier to implement.
cheers,
Gerd