qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/7] sdl2: Only accept the hotkeys on the main w


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH 4/7] sdl2: Only accept the hotkeys on the main window
Date: Fri, 3 Nov 2017 10:45:54 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Fri, Nov 03, 2017 at 10:41:35AM +0000, Peter Maydell wrote:
> On 3 November 2017 at 10:35, Gerd Hoffmann <address@hidden> wrote:
> > On Fri, 2017-11-03 at 09:37 +0000, Peter Maydell wrote:
> >> Also I think it would be nice to have written up what the
> >> "expected" set of hotkeys for UI frontends are, so we can
> >> be consistent. I think SDL and gtk are different about what
> >> their ungrab keycombo is, for instance. (I've been assuming
> >> gtk is the "this is the right behaviour" exemplar to follow.)
> >
> > That is another mess I'll plan to look at, because I want rework the
> > display command line switches parsing.  So, the current state is:
> >
> > gtk ungrab is ctrl-alt-g.
> > sdl ungrab is ctrl-alt (by default, but see below).
> > cocoa ungrab is ctl-alt too.
> > For reference: virt-viewer (vnc/spice client) likewise uses ctrl-alt.
> >
> > So it seems gtk is the odd one here.  Possibly due to how hotkeys are
> > implemented in gtk, could be a GtkAccelGroup simply doesn't support
> > modifier-only hotkeys.
> 
> There's a patch in-flight to switch cocoa to ctrl-alt-g.
> (If you think that's a bad idea it would be useful to reply
> to that patch.)
> 
> Using plain ctrl-alt for ungrab has the disadvantage that you
> then can't send the guest any ctrl-alt-anything combos at all,
> I think.

You can deal with that by only processing the  ctrl-alt pair on key
release, and require that the immediately preceeding key press events
were also ctrl-alt.

eg require the specific sequence

  press(ctrl), press(alt), release(alt), release(ctrl)

and thus you can still do 

  press(ctrl), press(alt), press(a), release(a) release(alt), release(ctrl)

and have it go to the guest as normal

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

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