AutoHotKey: Send a button when another is held down, and after released
in AutoHotKey I want to write a script that will press a button once when the right mouse b开发者_开发问答utton is held and press another once its released.
I tried writing something (I used numpad0 instead of mousebutton)
Numpad0::
Send {d}
Numpad0 Up::
Send {u}
but, it keeps sending du all the time, instead of just d and a final u.
why is that?
If you're putting your hotkey command on a different line to where the hotkey is declared you need to use a return
statement to end it:
Numpad0::
Send {d}
return
Numpad0 Up::
Send {u}
return
You can also just declare each hotkey on one line without a return
if you're not trying to do too much:
Numpad0:: Send {d}
Numpad0 Up:: Send {u}
精彩评论