Left Click on and off Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
ac1234
Posts: 5
Joined: 21 Oct 2019, 04:32

Left Click on and off

21 Oct 2019, 04:47

hi,
can anyone help me make a script where my left click holds down for 2 seconds and then releases and repeats.
i need this script activate when i press "f" and deactivates when i press "f" again
i also would like it to show on screen when its activated and deactivated like "ToolTip, Mouse 1, 100, 150" i think thats how you do it.
Rohwedder
Posts: 3375
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Left Click on and off  Topic is solved

21 Oct 2019, 05:55

Hallo,
try:

Code: Select all

#Persistent
*f:: ;Key F
IF Tf := !Tf
{
	SetTimer, Tf, 2000
	ToolTip, Mouse 1, 100, 150
}
Tf:
Click, Up ;releases Mouse 1
Sleep, 100 ;wait 100ms
IF Tf
	Click, Down ;holds down for 1.9 seconds
Else
{	
	SetTimer, Tf, Off
	ToolTip
}
Return
ac1234
Posts: 5
Joined: 21 Oct 2019, 04:32

Re: Left Click on and off

21 Oct 2019, 07:06

how do i make this for mouse 2 (right click) instead of left click (mouse 1)
Rohwedder
Posts: 3375
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Left Click on and off

21 Oct 2019, 07:47

extend the Click commands with , Right
E.g. : Click, Down, Right
https://www.autohotkey.com/docs/commands/Click.htm

Return to “Ask For Help”

Who is online

Users browsing this forum: Clemens375, Google [Bot] and 38 guests