Answer the question
In order to leave comments, you need to log in
How to make AHK script activation and deactivation?
Hello! I have a question, there is a script for AutoHotKey:
LButton::
Loop
{
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
sleep, -1
If !getkeystate("LButton"
)
Break
}
Return
it simulates pressing the W(sc11) key when the left mouse button is pressed.
I need the script to start working, for example, when the Insert (sc152) key is pressed, and stop working when the same key is pressed. Also, if possible, to make this script work in a specific application.
Answer the question
In order to leave comments, you need to log in
This will only work in notepad:
#If WinActive("ahk_exe notepad.exe")
suspend, on
LButton::
Loop
{
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11 }
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
Send, {sc11}
sleep, -1
If !GetKeystate("LButton")
Break
}
Return
#If
Insert::suspend
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question