How to do a always clicking and holding script?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Sinicolinda
Posts: 1
Joined: 19 May 2017, 19:24

How to do a always clicking and holding script?

19 May 2017, 19:38

Im trying to play some android games on PC, but in FPS games you need to click and hold to move camera with your mouse.
I dont want to always hold the mouse button, so how to do a script to always click and hold?
I just want something to when I press the mouse 1 the button will keep pressed and if i press again stop pressing.

Thanks :D
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: How to do a always clicking and holding script?

19 May 2017, 22:03

If you want it to be held down, use Click down or Send {LButton down}. Then when you want it to be released, just use Click up or Send {LButton up}. If you want the same key to do either, you can use variable:=!variable - let me explain that bit. variable is a custom variable, almost any name you want. The :=! bit is a sequence of two operators - the := (assign) and ! (logical-not) operators. What all of that together does is change the value of variable from true to false or false to true. You can then use an if statement like If variable, and if variable's value is true, then the if statement is true. Using an If statement (and in this case with an else) let's your hotkey take different actions.

It wasn't clear to me what Hotkey you want, but I think you wanted your LButton:: to be the hotkey.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mcd and 173 guests