Answer the question
In order to leave comments, you need to log in
Why doesn't the script work in AHK?
I wrote a simple script that clamps the spacebar for 6 seconds in 55 minutes, I run it - it doesn’t work, tell me why?
Home::
~F3:: Suspend, Toggle
Loop
{
if(A_Min = 55)
{
Send "{Space down}" ; Press down the up-arrow key.
Sleep 6000 ; Keep it down for one second.
Send "{Space up}" ; Release the up-arrow key.
}
}
Return
End::
ExitApp
Return
Answer the question
In order to leave comments, you need to log in
The quotation marks are Send
not needed in or they need to be preceded by %
. Also read Repeating or Holding Down a Key .
In the existing one, it is Loop
desirable to place a small one Sleep
to reduce the load on the processor.
It is not clear why they are needed Return
after the eternal loop and after ExitApp
.
Also, it will not reach the main code, since, on the one hand, it is not in the auto-execution section (before all hotkeys), and on the other hand, it cannot be called by hotkey either, since there is an implicit before it Return
, since the entry
~F3:: Suspend, Toggle
is abbreviated form
~F3::
Suspend, Toggle
Return
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question