Here's
Jiggle!
It prevents small mouse movements from stopping the screensaver.
Skrommel
;Jiggle.ahk
; Prevents small mouse movements from stopping the screensaver
;Skrommel @ 2008
#SingleInstance,Force
#Persistent,On
SetBatchLines,-1
SetTimer,CHECKSCREENSAVER,1000
Return
CHECKSCREENSAVER: ;is the screensaver running
oldactive:=active
VarSetCapacity(active,4,0)
DllCall("user32.dll\SystemParametersInfo","uint",0x0072,"uint",0,"uint*",active,"uint",0) ; SPI_GETSCREENSAVERRUNNING = 0x0072
If active>0 ;yes, lock the mouse
hHookKeybd:=DllCall("SetWindowsHookEx",Int,14,Uint,RegisterCallback("CHECKMOUSEMOVE","F"),UInt
,DllCall("GetModuleHandle",UInt,0),UInt,0) ; WH_MOUSE_LL = 14
Else
If oldactive=1 ;no, check if it has run, if so, stop watching the mouse
Reload
Return
CHECKMOUSEMOVE(nCode,wParam,lParam)
{
Global blockMouse
Global counter
If A_TimeIdlePhysical<1000 ;has the system not been idle
{
counter+=1
If counter>100 ;has it not been idle repeatedly
{
blockMouse=0 ;start forwarding the mouse messages
counter=0
}
}
Else
{
blockMouse=1 ;stop forwarding the mouse messages
counter=0
}
ToolTip,%A_TimeIdlePhysical%-%counter%-%blockmouse%
Return blockMouse ? 1 : DllCall("CallNextHookEx",UInt,0,Int,nCode,UInt,wParam,UInt,lParam)
}