Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

Thinking

How a screensaver stops when you move the mouse

Screensavers by Zaweba stop when the mouse moves more than 10 pixels or on any key, click or wheel, ignoring input in the first half second.

How a screensaver stops when you move the mouse

Nothing needs switching on. Every screensaver in Screensavers by Zaweba stops by itself when the mouse moves more than 10 pixels, or when you press any key, click or turn the wheel. The one exception is the first half second after it starts, when input is ignored so that a stray nudge doesn't close it the instant it appears.

That small design is worth understanding, because it explains both why a screensaver sometimes seems slow to close and why it doesn't keep closing itself when the desk is bumped.

Why 10 pixels

Optical mice are sensitive. A lorry going past, a cat jumping onto the desk or a slight vibration can move the pointer by a pixel or two. If a screensaver closed on any movement at all, it would keep flicking back to the desktop for no reason. A threshold of more than 10 pixels means a real movement wakes the screen, and tiny jitters don't.

Keys, clicks and the mouse wheel have no threshold. Any of them closes the screensaver straight away.

The first half second

When a screensaver starts, it ignores input for half a second. Windows often launches a screensaver at the very moment you reach for the mouse, and without this pause it would flash on and off. If you test a screensaver and it doesn't close the moment you touch the mouse, wait a beat and move it again.

What happens when it closes

While a screensaver runs, it hides the cursor. When it exits, the cursor comes back and you're on your desktop, or at the Windows sign-in screen if you ticked the password option in Windows' Screen Saver Settings. Windows handles that password itself, so the screensaver never sees or stores it. You can open that dialog from the manager with File, then Windows screensaver settings, to check the wait time and the password option.

Only one copy runs at a time, so a second launch while one is already showing doesn't stack another on top.

When it won't close

If a screensaver seems stuck, move the mouse firmly rather than nudging it, or press a key. Remember the half second at the start. If you're on a wireless mouse with a flat battery, the PC may not be getting any movement at all; a key on the keyboard always works.

The same rules apply to Preview full screen in the manager. It closes on a mouse movement of more than 10 pixels, or any key or click, so it behaves exactly as the real screensaver will.

Screensavers you've made

Screensavers built from your own web page folder, or exported from Kinetion by Zaweba, close on input too. The page runs full screen with no network access and the host program watches for input and closes it, so you don't need to write any code to handle the mouse yourself.

If it wakes too often

If the screensaver keeps closing when nobody is near the PC, something is sending input. A mouse on a shiny or uneven surface can drift. A games controller left plugged in can send small signals. Try a mouse mat, unplug other devices for a test, and see whether the screensaver then stays on. Screensavers by Zaweba itself doesn't wake up on its own: it only closes on real input, and only after that first half second.