double click = hold

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SonGokuBg
Posts: 72
Joined: 27 Aug 2017, 12:40

double click = hold

19 Mar 2020, 18:28

The purpose of the script is when I double click the LButton to set the RButton down, or if it's already down to release the RButton.. But the second thing doesn't work.... please help

Code: Select all

#NoEnv 
LButton::
if (A_TickCount - LButton_Tick <= 330) AND (LButton_Tick >= 1)
{
  if(GetKeyState("{RButton","P"))
Send {RButton up}
else
Send {RButton down}
}
else
{
Send {LButton down}
}
SetTimer, ClickBackUp, -1
LButton_Tick := A_TickCount


ClickBackUp:
if !(GetKeyState("LButton" , "P"))
Send {LButton up}
else
SetTimer, ClickBackUp, -1
return 
0::Suspend
[Mod edit: [code][/code] tags added]
Rohwedder
Posts: 7774
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: double click = hold

20 Mar 2020, 00:53

Hallo,
replace:

Code: Select all

 if(GetKeyState("{RButton","P"))
by:

Code: Select all

if(GetKeyState("RButton"))
1. RButton is not called {RButton.
2. Autohotkey does not change the physical status of RButton.
SonGokuBg
Posts: 72
Joined: 27 Aug 2017, 12:40

Re: double click = hold

20 Mar 2020, 08:51

Rohwedder wrote:
20 Mar 2020, 00:53
Hallo,
replace:

Code: Select all

 if(GetKeyState("{RButton","P"))
by:

Code: Select all

if(GetKeyState("RButton"))
1. RButton is not called {RButton.
2. Autohotkey does not change the physical status of RButton.
Thank you! But why without "P"? With LButton it works

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Marium0505, mcl and 348 guests