| View previous topic :: View next topic |
| Author |
Message |
diesalher
Joined: 14 Apr 2009 Posts: 28
|
Posted: Fri Jun 05, 2009 7:41 pm Post subject: Detect time since last release of left button |
|
|
Hi, i've tried to do this, but i'm not finding a working solution
I need a script that do something when i release the left button of the mouse but only if some time passes without another click. Let me explain
I do a sequence of clicks
CLick CLick CLick CLick CLick CLick(fast clicks) when i finish the fast click sequence (more than x miliseconds without a click) send something
any advice?
Sorry for my english, not my main lang. |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Fri Jun 05, 2009 8:17 pm Post subject: |
|
|
Check the "TimeSince" variables. _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
diesalher
Joined: 14 Apr 2009 Posts: 28
|
Posted: Fri Jun 05, 2009 8:40 pm Post subject: |
|
|
| %A_TimeSincePriorHotkey% detects how much time has passed since last click, but doesnt make the execution of an event x seconds since the last click, or at least i dont see how...i'm a bit newbie so maybe i'm wrong |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Fri Jun 05, 2009 9:15 pm Post subject: |
|
|
| Code: | ~LButton Up::SetTimer, Wait, -1
Wait:
KeyWait, LButton, D T3
If ErrorLevel
MsgBox, You have not pressed the LButton in 3 seconds.
;send something
return |
|
|
| Back to top |
|
 |
diesalher
Joined: 14 Apr 2009 Posts: 28
|
Posted: Fri Jun 05, 2009 9:51 pm Post subject: |
|
|
Why does i need a timer?
This code has not the same behaviour?
| Code: |
~LButton Up::
KeyWait, LButton, D T3
If ErrorLevel
MsgBox, You have not pressed the LButton in 3 seconds.
;send something
return
|
|
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Fri Jun 05, 2009 10:52 pm Post subject: |
|
|
| That should work fine for you. I was just trying to avoid the #MaxThreadsPerHotkey directive, so my example will respond to consecutive UP events. Since physically pressing the button always precedes an UP with a DOWN, your code is fine. |
|
| Back to top |
|
 |
diesalher
Joined: 14 Apr 2009 Posts: 28
|
Posted: Sat Jun 06, 2009 1:20 am Post subject: |
|
|
| Thanks, [learning mode on] |
|
| Back to top |
|
 |
|