Sign in to follow this  
Followers 0
iLoveAU3

Idle

3 posts in this topic

my question goes same as topic description says.

thanks in advance

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

ups, no. it was not really what i've been looking for.

however, i've made my own one based on that source code :)

Global $iTime = 0

AdlibEnable('_Exit', 30000)
MsgBox(0x40, 'Mouse idle', 'Move mouse or leave it for 8 seconds ;)', 2)

While 1
_MouseIdle(8, '_Beep')
Wend

Func _MouseIdle($vIdleTime, $sFunc, $vParam="")
    $lastpos = MouseGetPos()
    Sleep(1000)
    $currentpos = MouseGetPos()
    If $lastpos[0]=$currentpos[0] AND $lastpos[1]=$currentpos[1] Then $tStill = TimerInit()
    
    While $currentpos[0]=$lastpos[0] AND $currentpos[1]=$lastpos[1]
        If $iTime = $vIdleTime Then
            If $vParam="" Then
                Call($sFunc)
                Exit
            Else
                Call($sFunc, $vParam)
                Exit
            EndIf
        EndIf

        If TimerDiff($tStill) > 1000 Then
            $currentpos = MouseGetPos()
            $tStill = TimerInit()
            $iTime += 1
            TrayTip('Mouse idle', $iTime, 1)
        EndIf
    WEnd
    TrayTip('Mouse idle', 'Mouse moved!', 1)
    $iTime = 0
EndFunc

Func _Beep()
    Beep(2000,100)
EndFunc

Func _Exit()
    Exit
EndFunc
Edited by iLoveAU3

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  
Followers 0