nvda
cc8b5ade - Improve responsiveness of input and focus by pumping immediately instead of after a delay. (#14701)

Commit
2 years ago
Improve responsiveness of input and focus by pumping immediately instead of after a delay. (#14701) Currently, everything in NVDA, including responding to keyboard input and focus changes, goes through the core pump. The core pump is always run with a slight delay. Assuming nothing else is already queued, any input or focus change will not be processed for a minimum of 10 ms. In reality, it's potentially longer due to the system timer resolution and the fact that timers are low priority messages. We should be aiming for the fastest possible response to user input and focus changes. Description of user facing changes NVDA will respond slightly faster to commands and focus changes. Description of development approach The core pump has been refactored. Rather than using NonReEntrantTimer, it now uses wx.Timer directly and guards re-entry itself for better control. There is a main thread method (request) which manages scheduling/executing the pump to make state management easier. requestPump has a new immediate argument which specifies whether the pump should happen as soon as possible or after the delay. Delayed pumps are still useful in most cases for rate limiting and filtering, so this defaults to False. queueHandler.queueFunction has an _immediate argument which is passed to requestPump. It is _ prefixed to mitigate conflicts with keyword arguments intended for queued functions. inputCore, scriptHandler, focus changes and live text output all request an immediate core pump.
Author
Parents
Loading