GNOME Bugzilla – Bug 730826
Key combo to send key events to host
Last modified: 2016-03-31 13:22:00 UTC
A key combination that sends key events to the host os, while focusing on the guest os, would increase the useability of Boxes. An example of such a key combination could be right-shift+right-Ctrl, then to for example send a Super keypress to host, the user would type Right-Shift+Right-Ctrl+Super. The key combination should of course be configureable. It would be nice if this was as generic as possible, so events from the mouse, and any other device, really, would be redirected to the host.
An alternative could be to extend the 'release-cursor' spice-gtk binding to also be a grab/ungrab-keyboard shortcut which is always active, even when spice-vdagent is running in the guest.
What I have in mind seems very close to what virtualbox is doing: https://mail.gnome.org/archives/gnome-boxes-list/2014-September/msg00003.html
(In reply to comment #2) > What I have in mind seems very close to what virtualbox is doing: > https://mail.gnome.org/archives/gnome-boxes-list/2014-September/msg00003.html And how does one send 'right ctrl' (or whichever key we choose) to guest? We discussed this during Boxes BoF in GUADEC and IIRC the decision was to bring up and focus the overlay toolbar on user pressing the ungrab shortcut.
*** Bug 733988 has been marked as a duplicate of this bug. ***
*** Bug 731961 has been marked as a duplicate of this bug. ***
See https://bugs.freedesktop.org/show_bug.cgi?id=85331 for wip
(In reply to comment #6) > See https://bugs.freedesktop.org/show_bug.cgi?id=85331 for wip I got 0.27 here and I can't get it to work in Boxes. Does Boxes need to do something to make it work? I tried on a win7 guest. I pressed and release (Left) Ctrl + Alt and then Super key. The main menu on win7 popped up as result.
in theory nothing, have you tried with another spice-gtk client? check how input event is being handled in boxes?
(In reply to comment #8) > in theory nothing, have you tried with another spice-gtk client? check how > input event is being handled in boxes? Same with virt-manager. Tried fullscreen and unfullscreen. The 'Super' key always goes to guest.
(In reply to comment #9) > (In reply to comment #8) > > in theory nothing, have you tried with another spice-gtk client? check how > > input event is being handled in boxes? > > Same with virt-manager. Tried fullscreen and unfullscreen. The 'Super' key > always goes to guest. Oh works fine with spice-gtk from git master. I thought this was under 0.27 already so I was testing against that.
One thing we do need to update on Boxes side is hint about this. Currently we only show "(press [left] Ctrl+Alt keys to ungrab)" when mouse is grabbed and that only happens with server-side mouse. We probably want to show a similar hint when mouse is ungrabbed and display is focused.
Will likely need a bit more from spice-gtk to handle this well: https://bugs.freedesktop.org/show_bug.cgi?id=85331#c5
Decided to create a seperate bug for hinting user since this bug is resolved: https://bugzilla.gnome.org/show_bug.cgi?id=743319 Closing this.
Ctrl+Alt is a *very* common modifier combo used pretty much in every graphics application and the reason we avoided them for GNOME3 for example.
(In reply to comment #14) > Ctrl+Alt is a *very* common modifier combo used pretty much in every graphics > application and the reason we avoided them for GNOME3 for example. In which application does "ctrl+alt" alone does something? (spice-gtk won't do anything if you do ctrl+alt+whatever) but sure, the binding can be configure to something else. What else?
(In reply to comment #15) > In which application does "ctrl+alt" alone does something? (spice-gtk won't do > anything if you do ctrl+alt+whatever) but sure, the binding can be configure to > something else. What else? The combination I speak of is Ctrl+Alt+mouse click (either of the modifier keys). Inkscape, Blender, GIMP, Photoshop and every graphics app I can think of.
(In reply to comment #16) > (In reply to comment #15) > > In which application does "ctrl+alt" alone does something? (spice-gtk won't do > > anything if you do ctrl+alt+whatever) but sure, the binding can be configure to > > something else. What else? > > The combination I speak of is Ctrl+Alt+mouse click (either of the modifier > keys). Inkscape, Blender, GIMP, Photoshop and every graphics app I can think > of. I knew it! You missed the important fact I was trying to clear up for you: Its not pressing of Ctrl+Alt but rather release of these keys so this won't interfere with Ctrl+Alt+key combos of any apps.
(In reply to comment #17) > (In reply to comment #16) > > (In reply to comment #15) > > > In which application does "ctrl+alt" alone does something? (spice-gtk won't do > > > anything if you do ctrl+alt+whatever) but sure, the binding can be configure to > > > something else. What else? > > > > The combination I speak of is Ctrl+Alt+mouse click (either of the modifier > > keys). Inkscape, Blender, GIMP, Photoshop and every graphics app I can think > > of. > > I knew it! You missed the important fact I was trying to clear up for you: Its > not pressing of Ctrl+Alt but rather release of these keys so this won't > interfere with Ctrl+Alt+key combos of any apps. And I missed the fact that you were talking of mouse click rather than key. :) However, its still the same. I just tested that if you press Ctrl+alt+click, it doesn't get counted as spice's ungrab sequence but rather goes to the guest.