Hi,
I have a script which run infinite loop.
I would like to pause the script when there is a mouse move, and continue to run the script when there is no mouse movement for X seconds.
It's basically like a screensaver.
How can I do that?
Thanks
Pause script with mouse move
Started by
Orr
, Apr 22 2012 03:46 PM
5 replies to this topic
#1
Orr
Posted 22 April 2012 - 03:46 PM
#2
Posted 22 April 2012 - 03:55 PM
Use A_TimeIdlePhysical (<!-- m -->http://www.autohotke...s/Variables.htm<!-- m -->):
#persistent
Settimer, checkforactivity, 1000 ; check every second (1000ms) how long there has been no activity
checkforactivity:
If A_TimeIdlePhysical > 10000 ; meaning there has not been any activity (keystrokes, mousemovement) for 10 seconds
gosub dowhatever
return
dowhatever:
Loop
{
; do whatever
if A_TimeIdlePhysical < 10000 ; meaning there has been user activity
break
}
return
#3
Guests
Posted 22 April 2012 - 05:28 PM
WOW!
That was quick!
Thanks!
That was quick!
Thanks!
#4
Posted 22 April 2012 - 06:38 PM
More importantly, did it do what you wanted it to?
#5
guest1
Posted 29 April 2012 - 09:16 AM
right on the money mate. cheers
#6
Posted 29 April 2012 - 11:41 AM
I've said it before, and I'll say it again, we aim to please, glad I could help 
Most of that is due to you formulating your question sufficiently precise
Most of that is due to you formulating your question sufficiently precise




