prevent double click Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

prevent double click

Post by surfactant » 06 Jun 2022, 06:49

I need to map LAlt as LMB click like this:

Code: Select all

LAlt::

Click
Sleep 300

return
I insert the step of Sleep to prevent double click, but this wastes a lot of time.

Is it possible to make the script work this way? ---- When the key LAlt is pressed continuously fast in high frequency, a seious of highly frequent continous single clicks are produced.

Thank you!

Rohwedder
Posts: 7772
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: prevent double click

Post by Rohwedder » 06 Jun 2022, 08:02

Hallo,
try:

Code: Select all

LAlt::
Click
KeyWait, LAlt
Return
But 2 fast single clicks make a double click by definition.

surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

Re: prevent double click

Post by surfactant » 06 Jun 2022, 08:13

Rohwedder wrote:
06 Jun 2022, 08:02
But 2 fast single clicks make a double click by definition.
Thank you! Is there no workaround?

User avatar
boiler
Posts: 17390
Joined: 21 Dec 2014, 02:44

Re: prevent double click

Post by boiler » 06 Jun 2022, 08:24

It’s not an AHK issue. The only thing that determines how a series of clicks is viewed is the application, whether it’s Windows or a program running in Windows.

surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

Re: prevent double click

Post by surfactant » 06 Jun 2022, 09:44

boiler wrote:
06 Jun 2022, 08:24
It’s not an AHK issue. The only thing that determines how a series of clicks is viewed is the application, whether it’s Windows or a program running in Windows.
You are correct in what you said. I wonder whether it's possible for AHK to cheat Windows or programs. Thank you!

User avatar
boiler
Posts: 17390
Joined: 21 Dec 2014, 02:44

Re: prevent double click  Topic is solved

Post by boiler » 06 Jun 2022, 12:55

Only if you use AHK to inject code written in C++ or some other compiled language into those applications such that it would be running your code to handle a series of clicks with your interpretation instead of how it's currently handled. You're basically re-writing part of the application, and it's not really using AHK other than if you wanted to insert it almost unnecessarily into the process. But since you asked, that's how it would be possible.

surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

Re: prevent double click

Post by surfactant » 06 Jun 2022, 14:04

@boiler Thank you for further explanation!

Post Reply

Return to “Ask for Help (v1)”