I want to do the following:
a) I hold down '1'.
b) While '1' is being held down I want '2' to be pressed down for two seconds.
c) Afterwards I want '3' to be pressed once followed by a 500ms sleep.
The above repeats until I release '1'.
So far I have the following code:
Code: Select all
1::
while getkeystate("1","p")
{
send {2 down}
sleep 1950
send {2 up}
sleep 50
send 3
sleep 500
return
}
1) '2' is only pressed once. I want it to act as if I am pressing '2' on a notepad so that it would look like 22222222222222222222222222222222222222222223.
2) The script is carried out until the end even if I release my '1' after one second. When I lift '1' one second after it has pressed '2', a moment later it still presses '3'. I want it to end regardless of what sequence it is in immediately when I release '1'.
I'm not too good at articulating my words so please excuse me for any lack on my part.
Thanks in advance!
Kev