Hello, I am new to AHK, I was trying to make a script but it did not work very well, haha ...
I decided to ask for help here, forgive me if I'm not in the right place, I've never used this forum before, but let's get down to business:
I want to create a script that when I press the P key it sends the command to the computer to press the Up key every 1 second at the time I am pressed, and when I release the P key it stops pressing, for example.
I press P now and it will send the Up command every 1 second as long as I have the P key pressed, when I release the key it cancels, more if i press key P for 10 seconds, press keys up 1 in 1 second, up, 1 second, up, 1 second, up, 1 second, up, 1 second ...
Can anyone help me do this?
Thank you...
Press key from time to time
-
- Posts: 1
- Joined: 17 Dec 2017, 21:36
Re: Press key from time to time
Hope this help.
Check:Loop and GetKeyState
Code: Select all
p::
Loop
{
If GetKeyState("p")
Send 1
Else
Break ; Work until you release the key.
sleep 1000 ; 1 sec wait btw keys
}
return
Check:Loop and GetKeyState
Who is online
Users browsing this forum: No registered users and 75 guests