#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Event ; input is supposed to be better but event makes windows key better SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;The whole point of the script--keep caps on so backspace is instant SetCapsLockState, alwayson ;end autoexecute section ;Remap left alt to left windows key, and left windows key to left alt. ;You can delete this if you like the default MacBook key positionings. $*LAlt::LWin $*LWin::Alt ;Remap caps lock to backspace. $*CapsLock::Backspace ;Press Right Alt and F12 to enable/disable the remappings, for games/etc. RAlt & F12:: suspend, toggle if GetKeyState("Capslock", "T") { suspend, on SetCapsLockState, AlwaysOff return } else { suspend, off SetCapsLockState, AlwaysOn return } ;Now manually remap all letter keys to send un-caps-locked versions to work around the fact that caps lock is on $+q::send +q $q::send q $+w::SEND +w $w::SEND w $+f::SEND +f $f::SEND f $+p::SEND +p $p::SEND p $+g::SEND +g $g::SEND g $+j::SEND +j $j::SEND j $+l::SEND +l $l::SEND l $+u::SEND +u $u::SEND u $+y::SEND +y $y::SEND y $+a::SEND +a $a::SEND a $+r::SEND +r $r::SEND r $+s::SEND +s $s::SEND s $+t::SEND +t $t::SEND t $+d::SEND +d $d::SEND d $+h::SEND +h $h::SEND h $+n::SEND +n $n::SEND n $+e::SEND +e $e::SEND e $+i::SEND +i $i::SEND i $+o::SEND +o $o::SEND o $+z::SEND +z $z::SEND z $+x::SEND +x $x::SEND x $+c::SEND +c $c::SEND c $+v::SEND +v $v::SEND v $+b::SEND +b $b::SEND b $+k::SEND +k $k::SEND k $+m::SEND +m $m::SEND m