 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
{New-B} Guest
|
Posted: Mon Jan 01, 2007 1:28 am Post subject: Overclicking question |
|
|
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?  |
|
| Back to top |
|
 |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Mon Jan 01, 2007 8:28 am Post subject: |
|
|
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 |
|
 |
foom
Joined: 19 Apr 2006 Posts: 386
|
Posted: Mon Jan 01, 2007 11:34 am Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|