A_TimeIdlePhysical to detect any input but not mouse movement?
Posted: 26 Jun 2016, 06:37
I'm trying to detect any form of input otherthan mouse movement so that I can make another script only perform actions when the user hasn't done any input for more than 1sec.
The issue with this script is that it includes mouse movement.
So I put #InstallKeybdHook at the top to use it only for keyboard keys, and then added the following below for the mouse clicks:
But this causes issues with my keyboard handling because it automatically calls the mouse hook so A_TimeIdlePhysical is also detecting mouse movement..
Anyone know a solution to this? Possible to make A_TimeIdlePhysical just ignore mouse movement?
Code: Select all
#NoEnv
#Persistent
#singleInstance, Force
#MaxThreadsPerHotkey, 2
SetTimer, KeyIdle, 100
KeyIdle:
if(A_TimeIdlePhysical < 1000){
;Input less than 1sec ago
} else {
;Idle
}
return
So I put #InstallKeybdHook at the top to use it only for keyboard keys, and then added the following below for the mouse clicks:
Code: Select all
~LButton::
;Key Down
KeyWait, LButton
Sleep 1000
;Idle
exit
~RButton::
;Key Down
KeyWait, RButton
Sleep 1000
;Idle
exit
~MButton::
;Key Down
KeyWait, MButton
Sleep 1000
;Idle
exit
Anyone know a solution to this? Possible to make A_TimeIdlePhysical just ignore mouse movement?