Here is my very first Autohotkey V2 script. I want to remap around 50 keys of my keyboard, plus a lot of "modified" states (with Shift, Control, Alt, Shift+Control, Shift+Alt, Control+Alt, Shift+Control+Alt). In total, I expect to have a few hundreds of hotkeys.
I started with remaping only 4 keys (without modifier): j, k, i and l. Here is my script. It seems to works well for now.
My question to experienced Autohotkey V2 users :
Is there a shorter way to get the same result with Autohotkey V2 ?
Do you think it will perform well (be responsive ...) after having added a few hundreds of other hotkeys in my script ?
Code: Select all
#SingleInstance Force
Hotkey "<", RemapAll
Hotkey "< up", RestoreAll
RemapAll(ThisHotkey)
{
Hotkey "j", Key_j, "On"
Hotkey "k", Key_k, "On"
Hotkey "i", Key_i, "On"
Hotkey "l", Key_l, "On"
}
RestoreAll(ThisHotkey)
{
Hotkey "j", "Off"
Hotkey "k", "Off"
Hotkey "i", "Off"
Hotkey "l", "Off"
}
Key_j(ThisHotkey)
{
SendInput "{Left}"
}
Key_k(ThisHotkey)
{
SendInput "{Down}"
}
Key_i(ThisHotkey)
{
SendInput "{Up}"
}
Key_l(ThisHotkey)
{
SendInput "{Right}"
}