AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detect Accidental Double Clicks

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
biv



Joined: 06 Nov 2009
Posts: 4

PostPosted: Sun Nov 22, 2009 12:17 pm    Post subject: Detect Accidental Double Clicks Reply with quote

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
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 882
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Sun Nov 22, 2009 2:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
biv



Joined: 06 Nov 2009
Posts: 4

PostPosted: Sun Nov 22, 2009 3:50 pm    Post subject: tnq Reply with quote

Thank you! Rolling Eyes
Seems to work like it should no double clicks , still when dragging it can loose the grip Smile Is it possible to do a similar check for the "UP" hotkey?
Back to top
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 882
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Sun Nov 22, 2009 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Guest






PostPosted: Wed Jan 27, 2010 10:57 pm    Post subject: Reply with quote

Sorry for bumping, but i just wanted to say that this script has helped me A LOT Very Happy

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 Razz

Thank you biv and MasterFocus
Back to top
Guest






PostPosted: Thu Jan 28, 2010 12:19 am    Post subject: Reply with quote

Anonymous wrote:
this script is the way to fix it Razz

...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






PostPosted: Thu Jan 28, 2010 12:19 am    Post subject: Reply with quote

Anonymous wrote:
this script is the way to fix it Razz

...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
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group