How to keep screen on in full screen mode?


#1

Hi,

I am a pianist and I frequently use Sumatra to display PDF sheet music. But after a few minutes of inactivity, the laptop/tablet goes to sleep which is inconvenient while reading the scores. Is there a way to keep the screen on without changing “Power and sleep settings” for the whole system in Windows 10 Control Panel? An ideal solution for me would be if Sumatra would prevent the screen from turning off while in full-screen mode…

I know there are other apps that can do this, but Sumatra is my preferred PDF reader.


#2

The issue is that SumatraPDF is not seen as active (screen is static) and we need to activate the F15 key

As far as I know there is nothing inside SumatraPDF that could help on its own as such.

We would need to add a form of mouse / key jiggle such as up/down a line a few seconds before the time out, There were several apps that can provide that function, or to keep the device awake it needs a dose of caffeine [NOTE NOT AN ENDORSEMENT, but for an example see https://www.zhornsoftware.co.uk/caffeine/index.html]


#3

Lots of apps (download managers, torrent clients, media players. etc.) have such a feature, and Windows even provides proper power management APIs (SetThreadExecutionState, PowerSetRequest etc.) that can be used for this very purpose (which means there’s no need to use hacky workarounds like simulating periodic keypresses).

Thus it is of course possible to add code to Sumatra to make it do what you want (prevent screensaver and sleep/hibernate mode activation as long as a certain condition like full screen mode is met), but the question is about actual implementation. You can create an issue on GitHub and hope the feature is added one day…