Help with faulty mouse

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Nako
Posts: 2
Joined: 20 Jun 2021, 10:27

Help with faulty mouse

Post by Nako » 20 Jun 2021, 10:36

Hey all i need a bit of help with a script to fix my old mouse
The left click releases when i try to drag so i've been using this script

Code: Select all

$LButton::
	Click down
	Loop {
 		 KeyWait,LButton
  		KeyWait,LButton,DT0.05
  		If ErrorLevel
  	break
}
	Click up
Return
The problem is it also makes double clicking not work if i do it too fast
So my question is how to make that script only work after i've held the button for 0.1-0.2 seconds or so
Thanks in advance

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Help with faulty mouse

Post by mikeyww » 20 Jun 2021, 11:46

A key wait does not generally require a loop because the script waits for the key. That is what the command does. In any case, it seems to me that if your mouse is broken, the script would not work well. You could use a different key to drag, like the following.

Code: Select all

F3::
Click, D
SoundBeep, 1500
KeyWait, F3
Click, U
SoundBeep, 1000
Return

Nako
Posts: 2
Joined: 20 Jun 2021, 10:27

Re: Help with faulty mouse

Post by Nako » 20 Jun 2021, 15:30

I see, thanks for the help

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Help with faulty mouse

Post by mikeyww » 21 Jun 2021, 06:44

You are welcome.

A similar one:

Code: Select all

F3::LButton

Post Reply

Return to “Ask for Help (v1)”