gust...@noronha.eti.br writes: > From: Gustavo Noronha Silva <gust...@noronha.eti.br> > > Applications such as Gnome may use Alt-Tab and Super-Tab for different > purposes, some use Ctrl-arrows so we want to allow qemu to handle > everything when it captures the mouse/keyboard. > > However, Mac OS handles some combos like Command-Tab and Ctrl-arrows > at an earlier part of the event handling chain, not letting qemu see it. > > We add a global Event Tap that allows qemu to see all events when the > mouse is grabbed. Note that this requires additional permissions. > > See: > > https://developer.apple.com/documentation/coregraphics/1454426-cgeventtapcreate?language=objc#discussion > https://support.apple.com/en-in/guide/mac-help/mh32356/mac > > Signed-off-by: Gustavo Noronha Silva <gust...@noronha.eti.br> > --- > qapi/ui.json | 15 ++++++++++ > qemu-options.hx | 3 ++ > ui/cocoa.m | 73 +++++++++++++++++++++++++++++++++++++++++++++++-- > 3 files changed, 89 insertions(+), 2 deletions(-) > > diff --git a/qapi/ui.json b/qapi/ui.json > index 1052ca9c38..77bc00fd0d 100644 > --- a/qapi/ui.json > +++ b/qapi/ui.json > @@ -1088,6 +1088,20 @@ > { 'struct' : 'DisplayCurses', > 'data' : { '*charset' : 'str' } } > > +## > +# @DisplayCocoa: > +# > +# Cocoa display options. > +# > +# @full-grab: Capture all key presses, including system combos. This > +# requires accessibility permissions, since it performs > +# a global grab on key events. (default: off) > +# See > https://support.apple.com/en-in/guide/mac-help/mh32356/mac
Please indent like this # @full-grab: Capture all key presses, including system combos. This # requires accessibility permissions, since it performs # a global grab on key events. (default: off) # See https://support.apple.com/en-in/guide/mac-help/mh32356/mac I hope the link is permanent. > +# > +## > +{ 'struct' : 'DisplayCocoa', > + 'data' : { '*full-grab' : 'bool' } } > + > ## > # @DisplayType: > # > @@ -1153,6 +1167,7 @@ > '*gl' : 'DisplayGLMode' }, > 'discriminator' : 'type', > 'data' : { 'gtk' : 'DisplayGTK', > + 'cocoa' : 'DisplayCocoa', > 'curses' : 'DisplayCurses', > 'egl-headless' : 'DisplayEGLHeadless'} } > With indentation tidied up, QAPI schema Acked-by: Markus Armbruster <arm...@redhat.com>