Hi everyone,
I’m writing an application that allows the user to put the display to sleep with a keystroke combination.
The issue I’m running into is that Windows wakes up the screen almost immediately with the tiniest movement of the mouse. For example, I’ll put my screen to sleep, then as I stand up from my desk, the tiny shaking of my chair moves the mouse a pixel, and the screen immediately wakes up. Or a truck will drive by my house and the vibration is enough to move the mouse and wake up the screen.
This does not happen on my laptop where the pointing device is a trackpad. This also does not happen on Mac as when the screen is asleep Mac disables mouse movement, and must be woken up with either a mouse click or a keyboard keypress.
I would like to replicate the Mac behavior on Windows and disable mouse movement once the screen is asleep.
I’ve looked at the BlockInput API, but that blocks both mouse and keyboard input and leaves the user with no way to wake up the screen.
Does anyone know a good approach to this?
Thanks in advance.