AutoHotkey Community

It is currently May 27th, 2012, 8:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Overclicking question
PostPosted: January 1st, 2007, 1:28 am 
Hi, I got this GUI situation where I don't, for the lack of a better word, want the user to 'overclick' a certain button. hence, my goal is to somehow create a buffer-zone that would allow the use of the Left Mouse button, but not if the person clicks on it a dozen times real fast. Normal use is OK, but I want to cut-out the excess. Can someone help me put this together? Can this b done? :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 1st, 2007, 8:28 am 
Offline

Joined: June 6th, 2005, 11:35 pm
Posts: 179
Location: Northern Virginia
There are many approaches to that situation. I think the most straight forward solution would be to use a SetTimer to Disable the button after the click but then Enable it after x seconds.

You could also record the time each time the button was pressed and compare the times. If they were too close together then the request would be ignored. This can begin to get complicated though.

If you need help coding it, respond, but to answer your question a SetTimer is the best approach.

_________________
_AiK


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 1st, 2007, 11:34 am 
Offline

Joined: April 19th, 2006, 1:02 pm
Posts: 386
This doesn't buffer the clicks but cuts-out excessive clicking.
Code:
#SingleInstance Force
gui, add, button, vMyButton gMyButtonLabel, ok
gui, show

MyButtonLabel:
GuiControl, disable, %A_GuiControl%
tooltip, %A_GuiControl%
sleep, 1000
tooltip,
GuiControl, enable, %A_GuiControl%
return


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher and 69 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