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 

Overclicking question

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
{New-B}
Guest





PostPosted: Mon Jan 01, 2007 1:28 am    Post subject: Overclicking question Reply with quote

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? Smile
Back to top
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Mon Jan 01, 2007 8:28 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message AIM Address
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Mon Jan 01, 2007 11:34 am    Post subject: Reply with quote

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