Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if mouse stops moving
#16
WaitForMouseMove
Code:
Copy      Help
;/;
function# [double'maxWaitTime]

;Waits until mouse movement begins.
;Returns 1 if movement began, 0 if not.


;maxWaitTime - number of seconds to wait. Default or 0 - infinite.


int wt=maxWaitTime*1000
int t1=GetTickCount
POINT p p0
xm p0
rep
,0.05
,xm p
,if(memcmp(&p &p0 sizeof(POINT))) ret 1
,if(wt and GetTickCount-t1>=wt) ret

WaitForMouseStop
Code:
Copy      Help
;/;
function double'idleTime

;Waits until mouse movement ends.

;idleTime - number of seconds mouse must be not moving.


POINT p pp
int i t0 it=idleTime*1000
xm pp
rep
,0.05
,xm p
,if(memcmp(&p &pp sizeof(POINT))) i=0
,else if(!i) i=1; t0=GetTickCount
,else if(GetTickCount-t0>=it) ret
,pp=p


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)