diff --git a/exetoso.ahk b/exetoso.ahk index d55a0f6..bdb9f84 100644 --- a/exetoso.ahk +++ b/exetoso.ahk @@ -1,63 +1,90 @@ -CapsLock & j:: - shiftState := GetKeyState("Shift", "P") - ctrlState := GetKeyState("Ctrl", "P") - switch (shiftState + ctrlState) { - case 0: - SendInput {Left} - return - case 1: - SendInput, % ((shiftState == 1) ? ("+{Left}") : ("^{Left}")) - return - case 2: - SendInput ^+{Left} - return - default: - MsgBox % "menudo gilipolls" - return - } - return +; 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 % "menudo gilipolls" +*/ + + +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 % "menudo gilipolls" + return + } + return + } CapsLock & k:: - 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 % "menudo gilipolls" - return + 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 % "menudo gilipolls" + return + } + return } - return - + CapsLock & l:: - shiftState := GetKeyState("Shift", "P") - ctrlState := GetKeyState("Ctrl", "P") - switch (shiftState + ctrlState) { - case 0: - SendInput {Right} - return - case 1: - SendInput, % ((shiftState == 1) ? ("+{Right}") : ("^{Right}")) - return - case 2: - SendInput ^+{Right} - return - default: - MsgBox % "menudo gilipolls" - return + 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 % "menudo gilipolls" + return + } + return } - return - CapsLock & i:: + loop { shiftState := GetKeyState("Shift", "P") ctrlState := GetKeyState("Ctrl", "P") switch (shiftState + ctrlState) { @@ -75,6 +102,7 @@ CapsLock & i:: return } return + } /* myVarWithKeystrokes := "+john+doe{Tab}+pas+sw0rd{Enter}" @@ -94,4 +122,5 @@ case 1: } */ +Esc::ExitApp Esc::ExitApp \ No newline at end of file