Friday, January 29, 2010

Windows Keys Annoying as Guest OS on OSX?

I had this problem working on a Windows XP guest on OSX (in VirtualBox). The Command key on OSX maps to the Windows key on Windows, thereby being supremely annoying.

So I set out to solve the problem, and here is the solution:

  1. Change your Host key on VirtualBox to be the RIGHT command key
  2. Download Autohotkey
  3. Put this script in as the startup script


#SingleInstance force
#r::Send ^r ;reload
#z::Send ^z ; undo
#y::Send ^y ; redo
#f::Send ^f ; find inside apps
#c::Send ^c ; copy
#x::Send ^x ; cut
#v::Send ^v ; paste
#t::Send ^t ; new tab, Firefox
#s::Send ^s ; save inside apps
LWin & Tab::AltTab ; the motherlode, alt-tab!

and you're up and running! Thanks to John T on SuperUser who gave me the initial tip to check out Autohotkey (original question here).

6 comments:

Unknown said...

Oh my! This is so great! Now my work with Windows@VirtualBox is much more effective. I also tuned the script to cover more shortcuts... add these lines, if you want to:


#n::Send ^n ; new document
#w::Send ^{F4} ; close current window / document - sends Ctrl+F4
#F4::Send !{F4} ; close current application - sends Alt+F4
#b::Send ^b ; bold / bookmarks in Firefox
#i::Send ^i ; italic
#u::Send ^u ; underline
#a::Send ^a ; select all

#Left::Send ^{Left} ; Ctrl+Left
#Right::Send ^{Right} ; Ctrl+Right
+#Left::Send +^{Left} ; Shift+Ctrl+Left
+#Right::Send +^{Right} ; Shift+Ctrl+Right
#Up::Send ^{Up} ; Ctrl+Up
#Down::Send ^{Down} ; Ctrl+Down
+#Up::Send +^{Up} ; Shift+Ctrl+Up
+#Down::Send +^{Down} ; Shift+Ctrl+Down


But still tuning... :)

Dan Rosenstark said...

Thanks @Lojza! I'll be adding a lot of those to all of my Windows instances.

IncubuS said...

Thanks!

comatose said...

Three year's I've been dealing with this head trip on a biyearly bases!!! I followed your directions and BAM it worked! THANK YOU for showing me how to change the copy and paste shortcuts in vituralbox windows to command+c and command+c, the same as a Mac. (I wrote all that so the googlebots can help others find this easier, took me a few tries)

comatose said...

Three year's I've been dealing with this head trip on a biyearly bases!!! I followed your directions and BAM it worked! THANK YOU for showing me how to change the copy and paste shortcuts in vituralbox windows to command+c and command+c, the same as a Mac. (I wrote all that so the googlebots can help others find this easier, took me a few tries)

Dan Rosenstark said...

Glad to help, thanks for digging this and commenting.