Jikale/exetoso.ahk
2022-10-24 15:25:47 +02:00

126 lines
No EOL
2.4 KiB
AutoHotkey

; UP LEFT DOWN RIGHT
keyboardActions := {"i" : "Up", "j" : "Left", "k" : "Down" , "l" : "Right"}
;keyboardKeys := ["i", "j", "k", "l"]
;actions := ["Up", "Left", "Down", "Right"]
;parseKey(keyboardKey) {
; for key, value in keyboardActions
; if (value == keyboardKey)
; return value
; return 0
;}
/*
CapsLock & i::
CapsLock & j::
CapsLock & k::
CapsLock & l::
MsgBox % "testt"
*/
CapsLock & j::
loop {
ctrlState := GetKeyState("Ctrl", "P")
shiftState := GetKeyState("Shift", "P")
switch (shiftState + ctrlState) {
case 0:
SendInput {Left}
return
case 1:
SendInput, % ((shiftState == 1) ? ("+{Left}") : ("^{Left}"))
return
case 2:
SendInput % ("^+{keyboardActions[""j""]}")
return
default:
MsgBox % "Fail!"
return
}
return
}
CapsLock & k::
loop {
shiftState := GetKeyState("Shift", "P")
ctrlState := GetKeyState("Ctrl", "P")
switch (shiftState + ctrlState) {
case 0:
SendInput {Down}
return
case 1:
SendInput, % ((shiftState == 1) ? ("+{Down}") : ("^{Down}"))
return
case 2:
SendInput ^+{Down}
return
default:
MsgBox % "Fail!"
return
}
return
}
CapsLock & l::
loop {
ctrlState := GetKeyState("Ctrl", "P")
shiftState := GetKeyState("Shift", "P")
switch (shiftState + ctrlState) {
case 0:
SendInput {Right}
return
case 1:
SendInput, % ((shiftState == 1) ? ("+{Right}") : ("^{Right}"))
return
case 2:
SendInput ^+{Right}
return
default:
MsgBox % "Fail!"
return
}
return
}
CapsLock & i::
loop {
shiftState := GetKeyState("Shift", "P")
ctrlState := GetKeyState("Ctrl", "P")
switch (shiftState + ctrlState) {
case 0:
SendInput {Up}
return
case 1:
SendInput, % ((shiftState == 1) ? ("+{Up}") : ("^{Up}"))
return
case 2:
SendInput ^+{Up}
return
default:
MsgBox % "Fail!"
return
}
return
}
/*
myVarWithKeystrokes := "+john+doe{Tab}+pas+sw0rd{Enter}"
^!j::send, %myVarWithKeystrokes%
switch GetKeyState(CapsLock , P)
{
case 0:
MsgBox, You entered "%UserInput%", which is the maximum length of text.
return
case 1:
MsgBox, You entered "%UserInput%" at which time the input timed out.
return
}
*/
Esc::ExitApp
/*Esc::ExitApp*/