Opened 8 years ago

Closed 7 years ago

#15938 closed defect (fixed)

Alt key cannot be set as the Host key on a Mac

Reported by: Socratis Owned by:
Component: other Version: VirtualBox 5.1.6
Keywords: Alt key, Host key Cc:
Guest type: other Host type: Mac OS X


You cannot set the "Alt" (Option) key to be the Host key. Probably due to #15771.
Hardware: MacBookPro.

Change History (7)

comment:1 by Dsen, 8 years ago

Thank you for noticing that issue.
I think that's the same problem as #15937, have a look for my answer there.

comment:2 by Socratis, 8 years ago

Yes, it is fixed! Both that and #15937. You can close both bugs. I will update the related posts in the forums. Thank you!

comment:3 by Socratis, 8 years ago


When this bug was "active" I discovered a nice side effect. I set my HostKey to be the RightCommand key. When using OSX guests, I could (for the first time) use the OSX shortcuts LeftCommand-Q for quitting an application and LeftCommand-H for hiding one, in the guest. Before that, these two shortcuts would act on the host (on the VM window itself), quitting or hiding the VM, respectively.

Now that the HostKey issue has been corrected with build 110731 (and later) these shortcuts do not work on the guest, but on the host again. Should I open a new bug or do you think that this behavior is a side effect of the fix that you applied?

comment:4 by Dsen, 8 years ago


Hello again,
Actually your question is quite complex and non-cross-platform. I will explain.

The cross-platform VirtualBox rule is to pass every combination which doesn't contain host-key into the guest if keyboard is captured (and I think you mean exactly the captured keyboard case). So all our cross-platform VM menus have actions controllable with shortcuts which have "Host+" prefix as a strict requirement, e.g. all shortcuts which GUI should handle before passing to the guest are started with host-key.

But on Mac OS X, Qt itself has own Application menu (to make Qt apps look/behave similar to native applications) and assigns own shortcuts to this menu actions. Standard one shortcuts like Cmd+Q / Cmd+H you mentioned, so these shortcuts are being handled by Qt, not GUI itself. By Apple Human Interface Guideline any OSX app should handle these shortcuts on the host side, that's why Qt has that stuff hard-coded.

To summarize, handling native OSX shortcuts on host side (actually those two exactly) is the intended behavior. But the question still there (and I agree), what if user wish those shortcuts to be handled on guest side, not host one. Right now I can't answer that question, but probably the better solution would be to add such shortcuts into the Input menu / Keyboard sub-menu, that way they will be accessible/configurable like similar "Host+" shortcuts we have.

comment:5 by Socratis, 8 years ago

Oh, I hear you loud and clear. I have been pondering about which one should take priority myself, since Apple's HIG instructions are quite clear. I've been living with the status quo for a long time (forever actually). It was simply a nice surprise to see that it was working (not) as intended with the bug present. So:

  • RifhtCmd-Q would quit the VM, as intended by Apple/Qt. RightCmd was the HostKey.
  • LeftCmd-Q would quit applications in the guest (OSX).
  • RightCmd-H would hide the VM, as intended by Apple/Qt.
  • LeftCmd-H would hide an application in the guest (OSX).

Perfect!!! So much so, that I'm officially requesting to re-instate the bug! :D

No, not really, but if you could find a way to make it work as it did in that short-lived period, it would be the best of both worlds. If you can't, we'll go to the standard setup and consider this a nice dream that never materialized.

As for adding shortcuts to the VirtualBox Manager, it would be really borderline, because we're talking only about OSX guests, running on OSX hosts, that are affected. It would be confusing if you were to add something like that to the GUI.

comment:6 by Frank Mehnert, 8 years ago

Fix is part of VBox 5.1.8.

comment:7 by Valery Ushakov, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use