문제

I need something that repeats the keyboard keys "up, left, down and right" and repeats endlessly until the insert key is pressed to pause it. I'm not sure how i should approach this. Could someone help point me in the right direction?

도움이 되었습니까?

해결책

I am not on a windows computer at the moment, so this code is untested

This is for ahk_L not ahk_basic.

You will need to create a hotkey to start this loop. You should also make sure this runs only on the window you are indending, as well as a way to quickly exit the script, as the script may run away from you, causing you to restart the computer.

; While the physical insert key is up, send the keystrokes
While(!GetKeystate("Insert","D")) {
   Send {Up}{Left}{Right}{Down}
}

If this is for a game, (and I suspect it might be) you might need to use a difrerent send mode. See the Autohotkey FAQ for info on that particualr topic.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top