Keys := ["1","2","3","4","5","6","7","8","9","0"]
for each, key in Keys
{
Hotkey, ^%key%, Ctrl_Key, On
Hotkey, ^+%key%, Ctrl_Key, On
}
return
Ctrl_Key:
last_Key := ""
Index := ""
last_Key := SubStr(A_ThisHotkey, 0)
If (last_Key = 0)
Index = 5
else
If (last_Key < 6)
Index := last_Key + 1
else
Index := last_Key - 4
Loop %Index%
{
If (last_Key < 6) and (last_Key > 0)
{
If GetKeyState("Shift","P")
Send +^{Left}
else
Send ^{Left}
}
else
{
If GetKeyState("Shift","P")
Send +^{Right}
else
Send ^{Right}
}
}
; Don't repeat the action before key is released:
KeyWait, %last_Key%
return
См. For-Loop , Горячая клавиша и SubStr в документации и не стесняйтесь спрашивать, если вы чего-то не понимаете.