{"action":"created","issue":{"url":"https://api.github.com/repos/LaurentGomila/SFML/issues/772","labels_url":"https://api.github.com/repos/LaurentGomila/SFML/issues/772/labels{/name}","comments_url":"https://api.github.com/repos/LaurentGomila/SFML/issues/772/comments","events_url":"https://api.github.com/repos/LaurentGomila/SFML/issues/772/events","html_url":"https://github.com/LaurentGomila/SFML/issues/772","id":53920832,"number":772,"title":"Add support for preventing automatic screensaver or sleep.","user":{"login":"egpaik","id":1480644,"avatar_url":"https://avatars.githubusercontent.com/u/1480644?v=3","gravatar_id":"","url":"https://api.github.com/users/egpaik","html_url":"https://github.com/egpaik","followers_url":"https://api.github.com/users/egpaik/followers","following_url":"https://api.github.com/users/egpaik/following{/other_user}","gists_url":"https://api.github.com/users/egpaik/gists{/gist_id}","starred_url":"https://api.github.com/users/egpaik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egpaik/subscriptions","organizations_url":"https://api.github.com/users/egpaik/orgs","repos_url":"https://api.github.com/users/egpaik/repos","events_url":"https://api.github.com/users/egpaik/events{/privacy}","received_events_url":"https://api.github.com/users/egpaik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LaurentGomila/SFML/labels/feature","name":"feature","color":"23BA35"},{"url":"https://api.github.com/repos/LaurentGomila/SFML/labels/m:sfml-window","name":"m:sfml-window","color":"cccccc"},{"url":"https://api.github.com/repos/LaurentGomila/SFML/labels/s:undecided","name":"s:undecided","color":"FFA90A"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-09T22:06:29Z","updated_at":"2015-02-10T19:27:18Z","closed_at":null,"body":"It was suggested I make an issue about this, so here it is :)\r\n[Related Forum Post](http://en.sfml-dev.org/forums/index.php?topic=15130.0)\r\n\r\nWhen players play our game with a USB Gamepad without touching the keyboard or mouse, the computer sleeps automatically while they're playing. It'd be nice for some way to prevent this by disabling the automatic sleep while the window is open. This feature would also be useful for playing a longer video uninterrupted (say, in the case of a game cutscene).\r\n\r\nThe proper way to do this in Windows is by using **[SetThreadExecutionState](http://msdn.microsoft.com/en-us/library/windows/desktop/aa373208%28v=vs.85%29.aspx)**. This is what we recently put in to fix the issue.\r\n\r\nOn Mac, it looks like it's suggested to use **[UpdateSystemActivity](https://developer.apple.com/library/mac/qa/qa1160/_index.html)**.\r\n\r\nOn Linux, **[XResetScreenSaver](http://linux.die.net/man/3/xresetscreensaver)**.\r\n\r\nThis isn't a high priority issue, but I think it'd be nice to have in SFML. Every game that uses gamepads will run into this issue, as most computers have an automatic screensaver or screen blank.\r\n\r\nIt's worth noting that this does not seem to occur when using Windows-specific XInput gamepads, such as XBox 360 controllers."},"comment":{"url":"https://api.github.com/repos/LaurentGomila/SFML/issues/comments/73765715","html_url":"https://github.com/LaurentGomila/SFML/issues/772#issuecomment-73765715","issue_url":"https://api.github.com/repos/LaurentGomila/SFML/issues/772","id":73765715,"user":{"login":"MarioLiebisch","id":1854245,"avatar_url":"https://avatars.githubusercontent.com/u/1854245?v=3","gravatar_id":"","url":"https://api.github.com/users/MarioLiebisch","html_url":"https://github.com/MarioLiebisch","followers_url":"https://api.github.com/users/MarioLiebisch/followers","following_url":"https://api.github.com/users/MarioLiebisch/following{/other_user}","gists_url":"https://api.github.com/users/MarioLiebisch/gists{/gist_id}","starred_url":"https://api.github.com/users/MarioLiebisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarioLiebisch/subscriptions","organizations_url":"https://api.github.com/users/MarioLiebisch/orgs","repos_url":"https://api.github.com/users/MarioLiebisch/repos","events_url":"https://api.github.com/users/MarioLiebisch/events{/privacy}","received_events_url":"https://api.github.com/users/MarioLiebisch/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T19:27:18Z","updated_at":"2015-02-10T19:27:18Z","body":"Hm right. This namespace could also include a member to determine whether the system is running on batteries. Also I wasn't talking about aliases or so, just name alternatives."}}