O
O
OstriySous2020-12-01 22:21:54
autohotkey
OstriySous, 2020-12-01 22:21:54

Why doesn't the simplest script in AHK work?

Greetings, I wrote a simple script that clamps the spacebar for 6 seconds when you press F3. Please tell me why, when you press F3 (waited from 9 to 11 minutes of the hour), the space is not clamped?

~F3:: Suspend, Toggle
Loop
Sleep 1000  ; Keep it down for six second.
{
if(A_Min = 10)
{
Send {Space down}  ; Press down the key.
Sleep 6000  ; Keep it down for six second.
Send {Space up}  ; Release the key.
}
}

End::
ExitApp

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
a1987zz, 2020-12-02
@a1987zz

~F3::
Suspend, Toggle
Loop {
Sleep 1000 ; Keep it down for six seconds.
if (A_Min = 10) {
Send {Space down} ; Press down the key.
Sleep 6000 ; Keep it down for six seconds.
Send {Space up} ; Release the key.
}
}
return
End::
ExitApp
return

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question