My AutoHotKey mapping file for my gaming PC which lets me use it as if it's a Mac, and handles the mappings you have to handle from typing in Dvorak.

read more
	
#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.



; Mostly standard Mac ones below here
; but translated to Dvorak, as needed

; copy
#j::
Send, ^c
return

; paste
#k::
Send, ^v
return

; cut
#q::
Send, ^x
return

; select all
#a::
Send, ^a
return

; undo (backtick is the escape character)
#`;::
Send, ^z
return

; redo
LShift & `;:: 
GetKeyState, state, LWin
if state = D
Send, ^y
Return

; save
#o::
Send, ^s
return

; find
#u::
Send, ^f
return

; open new tab
#b::
Send, ^t
return

; reload page
#p::
Send, ^r
return

; close window
#,::
Send, ^w
return

; quit 
#'::
Send, !{f4}
return



; Joe's custom arrow remaps
; the close equivalent of what vim
; uses for cursor editing. 

; up arrow
RWin & c::Send,{Up}

; left arrow
RWin & h::Send,{Left}

; right arrow
RWin & n::Send,{Right}

; down arrow
RWin & t::Send,{Down}



; Joe's Additional custom remaps
; such as caps lock related remaps

; double shift to caps lock
LShift & RShift::SetCapsLockState, % GetKeyState("CapsLock","T")?"Off":"On"

; capslock to backspace
CapsLock:: Send {BackSpace}



; taken in part from github here: https://github.com/nathanpeck/autohotkey-windows-10-apple-magic-keyboard/blob/master/AutoHotKey.ahk

; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT (option on Mac)
; ^ = CTRL (control on Mac)
; + = SHIFT (shift on Mac)
; # = WIN (command on Mac)

; --------------------------------------------------------------
; Standard media/function keys all mapped to the right option key
; --------------------------------------------------------------

F7::SendInput {Media_Prev}
F8::SendInput {Media_Play_Pause}
F9::SendInput {Media_Next}
F10::SendInput {Volume_Mute}
F11::SendInput {Volume_Down}
F12::SendInput {Volume_Up}



; Joe's additional media/function keys

; Remap Windows (Apple Command) + Tab to Alt + Tab.
LWin & Tab::AltTab

; Remap Virtual Desktop Viewer (called Task View)
F3::SendInput #{Tab}

; NOTE: was not able to get the desktop to change with control + command + n (it works with right/left arrow)
; Ctrl & n:: 
; GetKeyState, state, RWin
; if state = D
; Send, {LCtrl up}{LWin down}{LCtrl down}{Right}{LWin up}{LCtrl up}
; Return 

; Remap Control + Alt + Delete to Control + Command + Delete
Ctrl & Backspace:: 
GetKeyState, state, LWin
if state = D
run, taskmgr.exe
Return 



; -------------------------------
;  Cursor Movement
;
; cmd + arrows - start & end of lines, with shift for selecting text
; -------------------------------
#Left::SendInput {Home}
#Right::SendInput {End}
+#Left::SendInput +{Home}
+#Right::SendInput +{End}
!Left::SendInput ^{Left}
!Right::SendInput ^{Right}
!+Left::SendInput ^+{Left}
!+Right::SendInput ^+{Right}



; Joe's additional Cursor Movement

; NOTE: tried to get the cursor movement above to work with our 
; rightCommand + h, c, n, t setup, but AutoHotKey says that it can't detect 
; three modifier keys at once in all cases, because not all keyboard hardware supports it
; looks like we got it working with the below, although may not work in all cases we want it to
; namely when we want to introduce highlighting via shift pressing 

; delete an entire word at a time, with option + capslock 
Alt & CapsLock::SendInput ^{BackSpace}

; go to the very end of the line with both commands and h
LWin & h:: 
GetKeyState, state, RWin
if state = D
SendInput {Home}
Return 

; go to the very start of the line with both commands and n
LWin & n:: 
GetKeyState, state, RWin
if state = D
SendInput {End}
Return 

; go back one word with option and right command with h
Alt & h:: 
GetKeyState, state, RWin
if state = D
SendInput ^{Left}
Return 

; go forward one word with option and right command with n
Alt & n:: 
GetKeyState, state, RWin
if state = D
SendInput ^{Right}
Return