While developing a small cross-platform game on C++, I got stuck with following issue: when players are playing with a USB gamepad without touching a keyboard or mouse, the computer sleeps automatically while they’re playing. In Windows, it can be done easily using SetThreadExecutionState function. In OS X, I think it can be done with UpdateSystemActivity but not tested yet.
Tag: screensaver
How to check if Linux console screensaver has blanked screen
is there a way to check programmatically (via ioctl(), etc.) or by reading a file in /sys, /proc or /dev) whether the screen has been blanked by the Linux console screensaver? Thanks and best regards, Günter Answer You can parse the output of xset q with DISPLAY set, but it’s not pretty.