Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard hook swallows all keys if script without docstring blocks (e.g. gui.messageBox) #6797

Closed
tspivey opened this issue Jan 25, 2017 · 2 comments
Labels
bug/freeze p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Milestone

Comments

@tspivey
Copy link
Contributor

tspivey commented Jan 25, 2017

STR:

  1. Install testplugin into globalPlugins.
  2. Press NVDA+0. When the dialog is up, press windows+m, then a letter that doesn't exist.

Normally I would hear a beep, however I don't hear anything; NVDA disables my keyboard.
If it doesn't work, try a few more times; this doesn't trigger 100% of the time.

My media keys still work (previous, play/pause, next and volume). If I turn Handle keys from other applications on, they stop working like the rest of the keys.

@jcsteh jcsteh added the p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label Jan 25, 2017
@jcsteh
Copy link
Contributor

jcsteh commented Jan 25, 2017

Discussed/debugged this on IRC.

Impact: If a script without a docstring blocks, NVDA traps all possible keys, making it impossible to even kill or restart NVDA from the keyboard. While this shouldn't occur in normal use, it's still pretty severe, particularly for developers.

This occurs because in order to fix #2953, we queue all keys to be sent later by our main thread if a script without a docstring (an intercepted application command) is queued/running. This ensures that keys such as backspace (which NVDA intercepts) don't end up out of sequence with typed characters (keys we don't intercept) if NVDA's main thread takes a while to process something.

The main thread isn't supposed to be blocked, but it's entirely possible to do this by mistake. We certainly shouldn't swallow keystrokes forever if this occurs.

inputCore does check watchdog to see if the core is alive and it passes gestures straight through if not. This should mean we recover from this within 10 seconds, but it seems we don't.

What I don't currently understand is why the watchdog isn't triggering in this case. P2 to at least investigate this.

@jcsteh jcsteh changed the title gui.messageBox crashes NVDA Keyboard hook swallows all keys if script without docstring blocks (e.g. gui.messageBox) Jan 25, 2017
@jcsteh
Copy link
Contributor

jcsteh commented Jan 25, 2017

CC @michaelDCurran.

michaelDCurran added a commit that referenced this issue Feb 17, 2017
…that it gets executed within NVDA's core pump, rather than executed directly. This will implicitly ensure that watchdog is alive during its execution. This is rather than waking watchdog specifically for this callable, which had the possibility of accidentally putting watchdog back to sleep during a core pump that caused wx to yield or start a modal loop. (#6797)

   # Please enter the commit message for your changes. Lines starting
@nvaccessAuto nvaccessAuto added this to the 2017.2 milestone Mar 14, 2017
michaelDCurran added a commit that referenced this issue Mar 14, 2017
…that it gets executed within NVDA's core pump, rather than executed directly. (#6892)

This will implicitly ensure that watchdog is alive during its execution. This is rather than waking watchdog specifically for this callable, which had the possibility of accidentally putting watchdog back to sleep during a core pump that caused wx to yield or start a modal loop. (#6797)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/freeze p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
Development

No branches or pull requests

3 participants