Click Down, Left and Click Up, Left two stages same key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
michelxd15
Posts: 132
Joined: 08 Aug 2019, 02:02

Click Down, Left and Click Up, Left two stages same key

01 Nov 2019, 18:44

hello guys I need help with a script

I will tell how the script would work:

I would place the mouse in a certain position and press the "H" key at this coordinate would be pressed mouse click, down, left

then I would place the mouse in another particular position and press "H" again to be pressed mouse click, up, left

in case the first time he right clicks and the second time he will stop clicking both at the current mouse position

can anybody help me ?
Kobaltauge
Posts: 264
Joined: 09 Mar 2019, 01:52
Location: Germany
Contact:

Re: Click Down, Left and Click Up, Left two stages same key

02 Nov 2019, 09:14

Show us what you have.

You can define a boolean variable and with variable :=! variable you can switch the state. Before sending the keys, do a if (variable) to perform the different actions.
michelxd15
Posts: 132
Joined: 08 Aug 2019, 02:02

Re: Click Down, Left and Click Up, Left two stages same key

02 Nov 2019, 21:11

@Kobaltauge
I have none yet, I have no idea how to start this script, as it would be a key to do both functions
Kobaltauge
Posts: 264
Joined: 09 Mar 2019, 01:52
Location: Germany
Contact:

Re: Click Down, Left and Click Up, Left two stages same key

22 Dec 2019, 06:51

@michelxd15 try this for the beginning

Code: Select all

variable := True

h::
CoordMode, Mouse, Screen
if (variable)
{
	MouseGetPos, X1, Y1
	MouseClick, left, X1,Y1
	SendInput {Down}
	SendInput {Left}
	variable :=! variable
} else {
	MouseGetPos, X1, Y1
	MouseClick, left, X1,Y1
	SendInput {Up}
	SendInput {Left}
	variable :=! variable	
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 139 guests