Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Keyboard hook swallows all keys if script without docstring blocks (e.g. gui.messageBox) #6797
Normally I would hear a beep, however I don't hear anything; NVDA disables my keyboard.
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.
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.