how to make arrow keystrokes??? Topic is solved
-
- Posts: 3
- Joined: 01 Apr 2023, 15:01
how to make arrow keystrokes???
i have been trying for the past few hours to make a program in ahk that presses the up arrow for 1 second and then presses the down arrow for 1 second until the program is stopped. i have no idea what to do and recently lost the code i was working on, so now im asking for help. please, if you know how to do this, i would love to know how.
Re: how to make arrow keystrokes???
Welcome to this AutoHotkey forum!
Code: Select all
#Requires AutoHotkey v2.0
SoundBeep 1500
SetKeyDelay 50
Loop
For each, key in ['Up', 'Down'] {
end := A_TickCount + 1000
While A_TickCount < end
SendEvent '{' key '}'
}
-
- Posts: 3
- Joined: 01 Apr 2023, 15:01
Re: how to make arrow keystrokes???
sorry for late respone i went back to trying to make my own code lol also thank you for helping!
this is what i made
[Mod edit: [code][/code] tags added.]
for some reason both your code and mine dont work in the emulator im using even when its in focus.
i dont even know how to make it only activate on shift+p
sorry for asking again but could you help?
this is what i made
Code: Select all
;::p
loop {
send {up}
sleep 700
send {down}
sleep 700
}
for some reason both your code and mine dont work in the emulator im using even when its in focus.
i dont even know how to make it only activate on shift+p
sorry for asking again but could you help?
Re: how to make arrow keystrokes??? Topic is solved
Before you go to the emulator, I would test the script in Notepad, to see if it works there. That tells you if you have a working starting point.
Below is an alternative that holds the keys instead of pressing them repeatedly.
Below is an alternative that holds the keys instead of pressing them repeatedly.
Code: Select all
#Requires AutoHotkey v2.0
SoundBeep 1500
Loop
For each, key in ['Up', 'Down']
Send('{' key ' down}'), Sleep(1000), Send('{' key ' up}')
-
- Posts: 3
- Joined: 01 Apr 2023, 15:01
Re: how to make arrow keystrokes???
really sorry for the late response!!!
it worked! thanks you so much!!!
it worked! thanks you so much!!!