Jump to content
Sign in to follow this  
iLoveAU3

Idle

Recommended Posts

iLoveAU3

my question goes same as topic description says.

thanks in advance

Share this post


Link to post
Share on other sites
iLoveAU3

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.