Ignore Command-H and Command-Q?

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Bitruder
Posts: 1
Joined: 7. Apr 2010, 15:37
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Gentoo

Ignore Command-H and Command-Q?

Post by Bitruder »

I'm running VirtualBox 3.1.6 in OS X 10.6.3 and I have my host key set to right Alt key. My guest operating system is Gentoo and I have auto keyboard capture turned on. However, when I press Command-H or even Command-Q, Virtualbox itself responds (hides the window or asks if I want to shut down even when it is fullscreen on my second monitor). However, these keys have significance in my guest operating system.

Is there anyway to get Virtualbox to completely ignore these? I only want it to respond to right alt for me!
gmarik
Posts: 1
Joined: 13. Apr 2010, 17:27
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Arch

Re: Ignore Command-H and Command-Q?

Post by gmarik »

I also subscribe for this request

Reopened ticket:
http://www.virtualbox.org/ticket/5684#comment:8

Also worth checking: http://forums.virtualbox.org/viewtopic.php?p=119230
mathmason
Posts: 1
Joined: 20. Sep 2010, 11:26
Primary OS: MS Windows 2003
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Ignore Command-H and Command-Q?

Post by mathmason »

I know this is old, but it may help someone.

You can change these key commands by entering the following at the terminal.

To replace Command-H with something less intrusive such as Command-Control-Option-H enter -

Code: Select all

defaults write org.virtualbox.app.VirtualBoxVM NSUserKeyEquivalents '{"Hide VirtualBox VM"="@~^h";}'
Similarly to replace Command-Q with Command-Control-Option-Q enter -

Code: Select all

defaults write org.virtualbox.app.VirtualBoxVM NSUserKeyEquivalents '{"Quit VirtualBox VM"="@~^q";}'
To replace both (cetting one clears the other) enter -

Code: Select all

defaults write org.virtualbox.app.VirtualBoxVM NSUserKeyEquivalents '{"Quit VirtualBox VM"="@~^q"; "Hide VirtualBox VM" = "@~^h";}'
CoreyOConnor
Posts: 1
Joined: 11. Feb 2012, 20:25

Re: Ignore Command-H and Command-Q?

Post by CoreyOConnor »

I added a patch to the issue above that resolves this issue.
buckett
Posts: 1
Joined: 26. Aug 2013, 17:02

Re: Ignore Command-H and Command-Q?

Post by buckett »

Remapping CMD-H and CMD-Q stops the guest OS window hiding/quiting but doesn't seem to allow these keystrokes to be passed through to the guest.
This is under VirtualBox 4.2.16.
Post Reply