🧰 AutoHotkey v2

Anti-Idle Mouse Jiggler

F9 toggles a tiny periodic mouse nudge to prevent the screen from locking/sleeping during long downloads or presentations.

By WindowsScripting.com · 780 B
AntiIdleMouseJiggler.ahk
; ============================================================
; AntiIdleMouseJiggler.ahk
;
; Press F9 to toggle a background timer that nudges the mouse by 1
; pixel every 60 seconds, preventing the screen from sleeping/locking
; due to inactivity. Press F9 again to turn it off.
;
; Requirements: AutoHotkey v2 (https://www.autohotkey.com/)
; ============================================================

#Requires AutoHotkey v2.0

jiggling := false

F9::{
    global jiggling
    jiggling := !jiggling
    if (jiggling) {
        SetTimer(Jiggle, 60000)
        ToolTip("Anti-idle: ON")
    } else {
        SetTimer(Jiggle, 0)
        ToolTip("Anti-idle: OFF")
    }
    SetTimer(() => ToolTip(), -1500)
}

Jiggle() {
    MouseMove(1, 0, 0, "R")
    MouseMove(-1, 0, 0, "R")
}