Skip to content

Instantly share code, notes, and snippets.

@pdubroy
Created October 7, 2009 20:27
Show Gist options
  • Save pdubroy/204416 to your computer and use it in GitHub Desktop.
Save pdubroy/204416 to your computer and use it in GitHub Desktop.
AutoHotkey script to make life nicer when running Windows on a MacBook. Built and tested on my mid-2009 13" Unibody MacBook Pro, with Boot Camp 3.0.
; AutoHotkey script to make life nicer when running Windows on a MacBook.
; Built and tested on my mid-2009 13" Unibody MacBook Pro, with Boot Camp 3.0.
; Written by Patrick Dubroy <pdubroy@gmail.com>; please enjoy and modify.
; For common key combinations, make Cmd-<key> the same as Ctrl-<key>
#c::^c ; Copy
#x::^x ; Cut
#v::^v ; Paste
#s::^s ; Save
#f::^f ; Find
; Firefox shortcuts
#t::^t ; New tab
#l::^l ; Search
; According to the Boot Camp documentation, a right click can be done by
; clicking with two fingers (as in OS X), but that doesn't actually seem
; to work. You could click with three fingers, but that's annoying.
; On my machine, when clicking with two fingers, I see the following events:
; R down
; L down
; R up (with timestamp exactly the same as L down)
; L up
;
; This code detects that case, and replaces it with a normal right-click.
~RButton::
lButtonDown := -1
rButtonUp := -1
rButtonDown := A_Tickcount
return
RButton Up::
rButtonUp := A_Tickcount
if (rButtonUp != lButtonDown)
Click up right
return
LButton::
lButtonDown := A_TickCount
if (rButtonUp != -1 and lButtonDown > rButtonUp)
Click down
return
LButton Up::
if (lButtonDown > rButtonUp)
Click up
else
Click up right
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment