| View previous topic :: View next topic |
| Author |
Message |
biv
Joined: 06 Nov 2009 Posts: 4
|
Posted: Sun Nov 22, 2009 12:17 pm Post subject: Detect Accidental Double Clicks |
|
|
I tryed to make a code that will prevent and detect accidental double clicks
but i kinda failed , i hope you can help me i think the problem is that A_PriorHotkey is changed by the Lbutton up, i need a way to detect when i release the left mouse button (for dragging)
| Code: | #SingleInstance, Force
LButton::
If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey > 80)
MouseClick , left , , , , , D
Return
LButton up::
MouseClick , left , , , , , U
return |
|
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 882 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Sun Nov 22, 2009 2:17 pm Post subject: |
|
|
Tested.
| Code: |
; change interval as desired
*LButton::
If ( A_TimeSincePriorHotkey > 200 && A_PriorHotkey = A_ThisHotkey " Up" )
Click down
Return
*LButton Up::Click Up |
_________________
Antonio França
aka MasterFocus aka Tunis
+ My AHK stuff: ~MasterFocus
+ AHK @ irc.freenode.net: #ahk
Contact: PM only ! |
|
| Back to top |
|
 |
biv
Joined: 06 Nov 2009 Posts: 4
|
Posted: Sun Nov 22, 2009 3:50 pm Post subject: tnq |
|
|
Thank you!
Seems to work like it should no double clicks , still when dragging it can loose the grip Is it possible to do a similar check for the "UP" hotkey? |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 882 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Sun Nov 22, 2009 6:18 pm Post subject: |
|
|
Tested.
| Code: | *$Up::
If ( A_TimeSincePriorHotkey > 200 && A_PriorHotkey = A_ThisHotkey )
Send, {UP}
Return |
_________________
Antonio França
aka MasterFocus aka Tunis
+ My AHK stuff: ~MasterFocus
+ AHK @ irc.freenode.net: #ahk
Contact: PM only ! |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jan 27, 2010 10:57 pm Post subject: |
|
|
Sorry for bumping, but i just wanted to say that this script has helped me A LOT
My mouse was broken, most probably a hardware malfunction, where 25 % of my mouseclicks got transmitted to the computer as a double click while it should be just a single click,
and now i've used this script ( + modified it a little bit ) to fix this mouse problem: by ignoring all the double clicks that occur within 40 milliseconds.
So if anyone would ever google for a similar mouse problem and would come accross this problem: this script is the way to fix it
Thank you biv and MasterFocus |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jan 28, 2010 12:19 am Post subject: |
|
|
| Anonymous wrote: | this script is the way to fix it  |
...I keep wondering why no-one ever finds my scripts...
...to be renamed to...
Buggy-Mouse.ahk
Set your mouse's minimum double-click speed (prevent single-clicks from being seen as double-clicks)
Keywords: set mouse min double click speed, single click acts like double click ...then someone writes a near 1-liner script to do what mine does (with half or less of the functionality)...
Maybe if more people responded to this...
...I could orginize my scripts, so people can find them... |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jan 28, 2010 12:19 am Post subject: |
|
|
| Anonymous wrote: | this script is the way to fix it  |
...I keep wondering why no-one ever finds my scripts...
...to be renamed to...
Buggy-Mouse.ahk
Set your mouse's minimum double-click speed (prevent single-clicks from being seen as double-clicks)
Keywords: set mouse min double click speed, single click acts like double click ...then someone writes a near 1-liner script to do what mine does (with half or less of the functionality)...
Maybe if more people responded to this...
...I could organize my scripts, so people can find them... |
|
| Back to top |
|
 |
|