Jump to content
Sign in to follow this  
John C.

idle time out

Recommended Posts

I try to detect if a computer is idle (no mouse activity) but it dosen't seem to work. Can somebody help me ? Thanks.


While isIdleTimeOut(1000,60) = 0

MsgBox(0,"test","idle time out.",5)



Func isIdleTimeOut($timeSlice,$idleCountLimit)

$idleCount = 0

While $idleCount <= $idleCountLimit

$mousePos1 = MouseGetPos()


$mousePos2 = MouseGetPos()

if $mousePos1[0] = $mousePos2[0] and $mousePos1[1] = $mousePos2[1] Then

$idleCount += 1


$idleCount = 0



Return 1

;MsgBox(0,"mouse pos","mousepos1 = " & $mousePos1[0] & " mousePos2 = " & $mousePos2[0])



Edited by John C.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...