Created
March 22, 2013 08:45
-
-
Save nkmrgk/5219834 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeat_key(key, wait) { | |
ToolTip, %A_ThisFunc% %key% (ESC to exit) | |
MouseGetPos, sx, sy | |
escape := 0 | |
Loop { | |
MouseGetPos, mx, my | |
if (sx <> mx || sy <> my) | |
break | |
Send, %key% | |
i := 0 | |
Loop { | |
if (GetKeyState("Ctrl", "P") && GetKeyState("Alt", "P")) { | |
if (GetKeyState("j", "P") && wait >= 128) | |
wait -= 100 | |
if (GetKeyState("k", "P") && wait <= 4096) | |
wait += 100 | |
ToolTip, %A_ThisFunc% %key% %wait%ms | |
} | |
if GetKeyState("ESC", "P") { | |
escape := 1 | |
break | |
} | |
if (i >= wait) | |
break | |
Sleep, 100 | |
i += 100 | |
} | |
if (escape = 1) | |
break | |
} | |
ToolTip | |
} | |
!5::repeat_key("n", 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment