I'm trying to find a way to detect when my computer decides I've been away (no user input) long enough to turn off the display. That also means I'm not watching movies and the OS is not prohibited from turning off the display by any media players.
So far I found out that it may be possible to schedule a task to run if an event occurs, through Task Scheduler, a built-in Windows component. But I couldn't find such an event as turning on (off) the display in system event logs. Is there even such an event to begin with? Maybe I'm not using the correct tools for the job.
Anyway, I'd like to be able to detect when Windows turns the display on and off (two separate events) so that I could run a certain process when these events occur. How do I do that?
Note: I need this to work reliably when the screen is turned on or off by Windows, so any timers and applications "watching" after media players are not the desired solution.