1

in AutoHotKey I want to write a script that will press a button once when the right mouse button 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?

Bg1987
  • 1,129
  • 1
  • 11
  • 25

1 Answers1

0

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}
Gary Hughes
  • 4,400
  • 1
  • 26
  • 40