AutoHotkey Community

It is currently May 27th, 2012, 2:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: November 22nd, 2009, 1:17 pm 
Offline

Joined: November 6th, 2009, 11:41 pm
Posts: 4
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2009, 3:17 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Tested.
Code:
; change interval as desired

*LButton::
  If ( A_TimeSincePriorHotkey > 200 && A_PriorHotkey = A_ThisHotkey " Up" )
    Click down
Return

*LButton Up::Click Up

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject: tnq
PostPosted: November 22nd, 2009, 4:50 pm 
Offline

Joined: November 6th, 2009, 11:41 pm
Posts: 4
Thank you! :roll:
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2009, 7:18 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Tested.
Code:
*$Up::
  If ( A_TimeSincePriorHotkey > 200 && A_PriorHotkey = A_ThisHotkey )
    Send, {UP}
Return

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2010, 11:57 pm 
Sorry for bumping, but i just wanted to say that this script has helped me A LOT :D

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 :P

Thank you biv and MasterFocus


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 1:19 am 
Anonymous wrote:
this script is the way to fix it :P

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 1:19 am 
Anonymous wrote:
this script is the way to fix it :P

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2011, 4:34 am 
wow, thank you so much for the buggy mouse script...


Report this post
Top
  
Reply with quote  
 Post subject: Buggy-Mouse
PostPosted: February 11th, 2011, 6:03 pm 
Buggy Mouse does works on all three keys....
Thanks guys for valuable input ;)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 9:41 pm 
My double click problem still exist. What should I change to the code to make it work?

Help appreciated! :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2011, 10:19 pm 
ehy wrote:
My double click problem still exist.

...I need much more info to know how to help.

Lets start with...
  1. What OS? (XP, Vista, Win7)
  2. Describe the exact symptoms of the "double click problem" without my script running, then tell me if anything changes/improves, once my script is running.
ehy wrote:
What should I change to the code to make it work?

...in the script, you can change...

Code:
DoubleClick_Min=138

...to a higher or lower number. It's the minimum allowed "double click speed". If a "double click" is any faster (lower than the specified number), that "double click" is ignored (as being humanly impossible). Try setting that to 219 or 319 (or higher, but the 138 default is good for me, which is why it's default).


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2011, 4:12 pm 
1.

Tested the problem with following OS:
Win Vista 64Bit Service Pack 2
Win XP 32Bit Service Pack 3

Tested the problem with following mouse:
Razer Abyssus 3,5G Laser
SteelSeries Kinzu Optical


2.

I play old RTS game called C&C RA95, when I select a group of units with rectangle selection, it randomly registers "the group selection" as a double click which makes my troops accidentally move when I don't want them to.

Maybe it's a game problem? I don't know I've played this game for some years and this is a recent problem. I also haven't heard that anyone else had this problem with the game.

I doubt its a mouse problem either, I just bought new mouse because of this problem and it didn't help a damn thing :P Maybe just a bad luck.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2011, 4:14 pm 
Forgot to say that, this autohotkey didn't make a difference even with attributes 200 or 300+


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2011, 3:19 pm 
This script was only designed to make double clicking "too fast" impossible. Since Buggy Mice send clicks impossibly fast, that's what I went after to block. So, this particular script, probably can't help your case (wasn't designed for it).

ehy wrote:
...when I select a group of units with rectangle selection, it randomly registers "the group selection" as a double click which makes my troops accidentally move when I don't want them to.

...you experience this problem on 2 different systems, with 2 different mice?

Assuming the "rectangle selection" is initiated by left clicking & holding, dragging & letting go. The thing I'd need to handle/block is a "double click" happening too fast after letting go.

Does it "double click" every time you select the troops or most/some of the time?...oh "it randomly registers"...hrm, I might need to create a script to log mouse activity & have you press some key when it "does it right" & "does it wrong" (when I'm analyzing the log, I'd need to see the correct & incorrect behavior). For example, you would press F3 (to log before the problem), then select the troops, then press F1 to log that it didn't move the troops...or press F2 to log that it did move the troops...then you would repeat that 5-10 times, so it logs both ways...remember, all of that is based on a script I need to write 1st, but if the logs show something obvious to block, then I can help!

This might need more research. Are there any other RTS games that do this? It may just be the game...or even an option/preference in the game ("move troops on selection"?), since it does it on 2 of your computers & not on other peoples.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2011, 2:44 am 
Quote:
Assuming the "rectangle selection" is initiated by left clicking & holding, dragging & letting go. The thing I'd need to handle/block is a "double click" happening too fast after letting go.

Yes exactly.

And I haven't noticed on other games and there is no options like "move troops on selection" and yes please write a script for logs :)


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Google Feedfetcher, rbrtryn and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group