AutoHotkey Community

It is currently May 26th, 2012, 10:33 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Prevent doubleclicks
PostPosted: September 6th, 2009, 11:36 pm 
Offline

Joined: November 14th, 2006, 4:40 pm
Posts: 16
Hello Im trying to a script that prevents doubleclicks (unintentional spasmic clicks etc. )

What I want is :

When a Lbutton click i registered the left button should be freezed for 500 ms.

This what I have done so far but it just works on the first click.

Code:
Lbutton::
Hotkey, LButton,
Sleep, 500
Hotkey, LButton, Off
return


Thank you for your help!

_________________
Don't capture me again!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2009, 11:47 pm 
Offline

Joined: August 14th, 2009, 2:40 pm
Posts: 237
Location: Finland
EDIT: scrap the earlier idea, this seems to work:

Code:
LButton::
Click, Left
Return

LButton Up::
Hotkey, LButton, Off
Sleep, 500
Hotkey, LButton, On
Return


Although the 500ms seems excessive, I'd settle for 100ms, seemed to work better.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2009, 12:03 am 
Offline

Joined: November 14th, 2006, 4:40 pm
Posts: 16
AnttiV wrote:
EDIT: scrap the earlier idea, this seems to work:

Code:
LButton::
Click, Left
Return

LButton Up::
Hotkey, LButton, Off
Sleep, 500
Hotkey, LButton, On
Return


Although the 500ms seems excessive, I'd settle for 100ms, seemed to work better.

Thanks.. You are right.. 100ms is better. But I noticed that it also locks the mouse while dragging, so I can't scroll for example.
Is this fixable?

_________________
Don't capture me again!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2009, 12:06 am 
Offline

Joined: August 14th, 2009, 2:40 pm
Posts: 237
Location: Finland
ah, yes, of course. sorry for not noticing that at first! :)

Code:
LButton::
Click, Left, Down
Return

LButton Up::
Click, Left, Up
Hotkey, LButton, Off
Sleep, 100
Hotkey, LButton, On
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2009, 12:10 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6066
Location: San Diego, California
FYI, I read that the rate a person can tap one finger (normally) is about 100 ms.

Another user wanted to detect multiple clicks and do something:
I suggest looking at example #3 for Set timer
http://www.autohotkey.com/docs/commands/SetTimer.htm

The example uses the #c (win-c) hotkey. Copy it and try it as is. You can change just the hotkey line to LButton:: and it will work the same, except it will use the Left Mouse button.

Leef_me


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, JSLover, Miguel, rbrtryn and 64 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