nvda
nvda copied to clipboard
Add function to prevent screen turning off / laptop going to sleep during say all
Is your feature request related to a problem? Please describe.
While listening to NVDA"s Say All (NVDA+down arrow / NVDA+a) read a document, it is likely the user will not touch the keyboard. If the document takes a long time to read, the system may go to sleep, which will interrupt reading.
Describe the solution you'd like
An option to prevent the system going to sleep while NVDA is reading with say all.
Describe alternatives you've considered
Setting a longer time before the system goes to sleep may be an option, however not all users have the ability to change this (eg company machines) and this may impact battery life overall.
Additional context
Reported by a user (Frederik, via email).
This is already implemented in #10643 - the system should not sleep when say all is in progress. Now the question is why it is not working for this particular user, debugging something like this remotely is going to be painful tough.
I'm not so sure that the situation is so clear.
I discover now #10643, so for years I tought NVDA dosn't prevent sleep during say all (that I use for book reading).
Now I played with screen timeout and screensaver settings, and I noticed that NVDA stops reading if screensaver starts and "return to access screen at restore" checkbox is enabled in screensaver settings (label may differ, I translated from Italian).
And, sure, this is not stand-by/sleep exactly...
Maybe the user refer to this?
@ABuffEr Can you run NVDA from sources on your system? If you can it would be interesting to check what happens if you'd change
https://github.com/nvaccess/nvda/blob/f47eb663696333e6dc99595e1d7d60322af09c35/source/speech/sayAll.py#L282
to:
winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED | winKernel.ES_DISPLAY_REQUIRED)
Is this with an installed version?
Without a log it is difficult to understand the cause here.
Hi, sorry for delay, I'm now able to follow @lukaszgo1 's suggestion, running from source.
Due to the line is changed in the meantime, I changed both occurrences of
winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED)
in sayAll.py, with:
winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED | winKernel.ES_DISPLAY_REQUIRED)
I then set display and screensaver timeout to 1 min (respectively 10 and 20 minutes previously), and ensure to have enabled the checkbox to return to access screen in screensaver settings (already enabled).
I can confirm that now no sleep/unlock screen raises and say all runs for more than a minute without stopping.
@seanbudd is this still blocked-waiting for info? If so, what info? It just came up again, with a group of users complaining about it on the main NVDA users list. The above discussion suggests that a solution is known but hasn't been implemented.
Hi all, I am the user who started the discussion about this. I have a work laptop where this situation comes up frequently. I need to read long documents as a part of my job and this gets really painful because if I am in a browser or in thorium reader, which is a daisy book player, I lose my place. Tyler Spivey suggested running a number of commands on the nvda python console which appear to help in early testing. These commands are below. `import winKernel;winKernel.SetThreadExecutionState = lambda x: True import ctypes;ctypes.windll.kernel32.SetThreadExecutionState(0x80000003)
`
In addition, I am ok with the laptop going to sleep at other t imes without user interaction hence changing power settings is not an option.