Probably something simple, but i'm trying to create a trigger that happens if the user is idle for too long (in this example 10 seconds).
#include <Timers.au3>
While 1
$CurrIdleTime = _Timer_GetIdleTime()
Switch $CurrIdleTime
Case $CurrIdleTime >= 10001
MsgBox(64,"Current Idle Time",$CurrIdleTime)
Exit
EndSwitch
WEnd
So if I run this and don't press anything the message box will trigger in 10 seconds, but if press anything the message box will immediately trigger. The $CurrIdleTime given to me in the message box always reads 0 in the second scenario, so I'm not understanding why the case would trigger if it's clearly not greater than or equal to 10001.
Does moving the mouse/pressing a key cause _Timer_GetIdleTime() to very quickly go to another value than zero? I tried specifying Number($CurrIdleTime), but it didn't make any difference.
Any insight would be appreciated, thank you.