Skip to content

Work around frozen keyboard input while the NVDA core is frozen#9208

Merged
michaelDCurran merged 3 commits into
nvaccess:masterfrom
LeonarddeR:inputHookFreeze
Jan 29, 2019
Merged

Work around frozen keyboard input while the NVDA core is frozen#9208
michaelDCurran merged 3 commits into
nvaccess:masterfrom
LeonarddeR:inputHookFreeze

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

Improves #6291

Summary of the issue:

When large chunks of text are written to a terminal window, NVDA tends to freeze entirely. The freeze tends to lock up the keyboard in such a way that a user needs to sign out of his session and sign in back again, in which case it is likely that work is lost.

Description of how this pull request fixes the issue:

This pr checks whether the core is attempting recovery way earlier than the current code does. The current code does the following:

  1. Input is received
  2. winInputHook executes the keyboardHandler.internal_keyDownEvent function
  3. internal_keyDownEvent checks for pass through, sticky keys, etc.
  4. It executes inputCore.manager.executeGesture
  5. inputCore.manager.executeGesture checks whether the core is attempting recovery. If it is, it raises NoInputGestureAction
  6. The finally block of internal_keyDownEvent is executed.

The code in this pull request checks the core's recovery state within the winInputHook module itself and doesn't execute keyboardHandler.internal_keyDown/UpEvent at all when the core is frozen. While it does not fix #6291, it does no longer break keyboard input entirely, allowing a user to restart NVDA by hand.

Testing performed:

Tested by @lukaszgo1

Known issues with pull request:

This approach might be a bit aggressive. We could also check the state of the watchdog in keyboardHandler, for example. However, the current code where the keyboard hook executes a massive amount of code even when the core is frozen, is certainly not something we should keep as it is.

Change log entry:

@Brian1Gaff

Brian1Gaff commented Jan 28, 2019 via email

Copy link
Copy Markdown

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

This pull request doesn't fix anything, it only makes things less bad as they are now. Your case should be at least solved in such a way that the keyboard won't be locked up.

@michaelDCurran michaelDCurran merged commit 2a20e4f into nvaccess:master Jan 29, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.1 milestone Jan 29, 2019
@LeonarddeR LeonarddeR added the BabbageWork Pull requests filed on behalf of Babbage B.V. label Oct 11, 2019
@LeonarddeR LeonarddeR deleted the inputHookFreeze branch August 23, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BabbageWork Pull requests filed on behalf of Babbage B.V.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA hangs up in terminal, when a large piece of text is loaded

4 participants