Hello, i have this script for when I double click left button to press "k"
#UseHook
LButton::
if (A_TickCount - LButton_Tick <= 250) AND (LButton_Tick >= 1)
Send {k}
else
Send {LButton}
LButton_Tick := A_TickCount
return
The problem is I can't hold Left button now. It's just click can't hold.
Can someone fix that?
Need help Topic is solved
Re: Need help
HI SonGokuBg,
You're telling your script to :
you need to create another condition "else if" which allows you to validate that condition so that your script knows to hold it down instead of just sending one single left mouse click
You're telling your script to :
Code: Select all
if you double click within a certain timeframe
Send a "k"
or else
Send only one mouse click
-TL
Re: Need help
I am very amateur Can You do it for me?Tigerlily wrote: ↑16 Mar 2019, 04:36HI SonGokuBg,
You're telling your script to :
you need to create another condition "else if" which allows you to validate that condition so that your script knows to hold it down instead of just sending one single left mouse clickCode: Select all
if you double click within a certain timeframe Send a "k" or else Send only one mouse click
Re: Need help Topic is solved
This worked for me - it was a funny tricky problem. I adjusted your LButton_Tick <=250 to <=350 because it seemed to make the double click for Send "k' more reliable. There's probably a better way to do this.. but this is a solution
I used SetTimer:
EDIT: the previous code that I posted had some issues with it when typing, so I fixed it
I used SetTimer:
Code: Select all
#NoEnv
#SingleInstance, force
SendMode, Input
#UseHook
LButton::
if (A_TickCount - LButton_Tick <= 350) AND (LButton_Tick >= 1)
Send {k}
else
{
Send {LButton down}
}
SetTimer, ClickBackUp, -1
LButton_Tick := A_TickCount
return
ClickBackUp:
if !(GetKeyState("LButton" , "P"))
Send {LButton up}
else
SetTimer, ClickBackUp, -1
return
Last edited by Tigerlily on 16 Mar 2019, 06:06, edited 4 times in total.
-TL
Re: Need help
how about to use 'tild' prefix ~ to keep its native function
and
I guess, you have to consider drag functionality of mouse too
and
I guess, you have to consider drag functionality of mouse too
Re: Need help
I love You!Tigerlily wrote: ↑16 Mar 2019, 05:40This worked for me - it was a funny tricky problem. I adjusted your LButton_Tick <=250 to <=350 because it seemed to make the double click for Send "k' more reliable. There's probably a better way to do this.. but this is a solution
I used SetTimer:
EDIT: the previous code that I posted had some issues with it when typing, so I fixed itCode: Select all
#NoEnv #SingleInstance, force SendMode, Input #UseHook LButton:: if (A_TickCount - LButton_Tick <= 350) AND (LButton_Tick >= 1) Send {k} else { Send {LButton down} } SetTimer, ClickBackUp, -1 LButton_Tick := A_TickCount return ClickBackUp: if !(GetKeyState("LButton" , "P")) Send {LButton up} else SetTimer, ClickBackUp, -1 return
Who is online
Users browsing this forum: AdsBot [Google], balawi28 and 226 guests