Allow QWERTY input from Papenmeier braille displays to work again #11944
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Link to issue number:
None.
Summary of the issue:
Some Papenmeier braille displays have the ability to allow QWERTY input. However, it seems an equality check that needed to be corrected with the conversion to Python 3 was missed which disabled input completely, plus some reorganisation of keyboard input support in NVDA 2020.3 caused NVDA to freeze at a random point after typing for a while with a Papenmeier braille display.
Description of how this pull request fixes the issue:
The Papenmeier braille display driver has been updated to correctly detect and allow QWERTY input, and several new gesture bindings have also been added. The update to this driver was provided to me by Papenmeier.
keyboardHandler.injectRawKeyboardInput has been simplified to just call the keybd_event win32 API directly, and let the OS handle the input from there. Previously, NVDA would send the input manually to its keyboard input hook, and then if the hook didn't handle the input, calling keybd_event. This avoids assumptions about how NVDA's input hook worked, which are no longer true since #11478 and #11597 were merged.
keyboardHandler.injectRawKeyboardInput is currently only used by the Papenmeier braille display driver, thus why it probably broke in NVDA 2020.3.
Although I could not get a good log from papenmeier showing a useful stack, my guess is that their input thread was somehow getting stuck on the 'ignoreInjected' lock in keyboardHandler as NVDA did not expect its input hook (internal_keyDownEvent) to be called directly from that thread.
Testing performed:
Known issues with pull request:
None
Change log entry:
Bug fixes: