Skip to content

Instantly share code, notes, and snippets.

@beeman
Created March 19, 2014 16:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beeman/9645745 to your computer and use it in GitHub Desktop.
Save beeman/9645745 to your computer and use it in GitHub Desktop.
AutoHotkey script to make Windows keyboard shortcuts feel more native when working in a VM on a Mac
; AutoHotkey script to make Windows keyboard shortcuts feel more native when working in a VM on a Mac
; Bram Borggreve (c) 2014
; ********************************************************************************
; Some defaults recommended by AutoHotkey. I never ignore recommendations ;-)
; The shortcuts start after the recommendations
; ********************************************************************************
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; ********************************************************************************
; ********************************************************************************
; Make the Mac 'cmd' button perform most of the tasks as ctrl button. Normally the Cmd
; button behaves like it is the Windows key
; For example the Cmd-C keystroke works like Ctrl-C. This way you don't have to think
; about this while switching between the VM and the host, so you can keep focussing on
; the work you are doing.
#q::Send !F4
#w::Send ^w
; #e::Send ^e ; I like to have Cmd behave as the Windows button here. Cmd-E == Explorer
; #r::Send ^r ; I like to have Cmd behave as the Windows button here. Cmd-R == Start -> Run
#t::Send ^t
#y::Send ^y
#u::Send ^u
#i::Send ^i
#o::Send ^o
#p::Send ^p
#a::Send ^a
#s::Send ^s
#d::Send ^d
#f::Send ^f
#g::Send ^g
#h::Send ^h
#j::Send ^j
#k::Send ^k
#l::Send ^l
#z::Send ^z
#x::Send ^x
#c::Send ^c
#v::Send ^v
#b::Send ^b
#n::Send ^n
#m::Send ^m
; ********************************************************************************
; This shortcut sends Cmd+Shift+F work as Ctrl+Shift+F == Format Code in Eclipse
#+f::Send ^+f
; ********************************************************************************
; Fin!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment