So I'm trying to write a simple script in AutoHotKey that will use NumLock (which I have mapped to the capslock in my registry) as a toggle to turn my directional keys into the numpad nab keys. My script is as follows:
GetKeyState, state, NumLock, T
if state = D
{
Up::Numpad8
Down::Numpad2
Left::Numpad4
Right::Numpad6
Enter::Numpad5
}
if state = U
{
$Up::Up
$Down::Down
$Left::Left
$Right::Right
$Enter::Enter
}
Return
However, I get an error saying Up is repeated in line 15. How do I tell AutoHotKey to return my keys to their original key designation? I tried leaving an "else" section blank as opposed to the "if state = U" section, but then the keys remain in their altered state when toggling again. I'm sure there is something simple I am missing.