NLS eReader Zoomax braille driver#17509
Conversation
|
Thanks for opening this PR @florin-trutiu !
|
|
pre-commit.ci autofix |
@seanbudd In the user guide I have now added a section for the NLS eReader Zoomax braille display. |
|
@florin-trutiu, you have added the template, but for completeness, could you please writing the required information in its sections rather than writing before it? Thanks! |
SaschaCowley
left a comment
There was a problem hiding this comment.
Thanks for submitting this, @florin-trutiu! A lot of questions and stylistic questions on this to begin with
| # -*- coding: UTF-8 -*- | ||
| # brailleDisplayDrivers/nlseReaderZoomax.py | ||
| # Description: | ||
| # NLS eReader Zoomax driver for NVDA. |
There was a problem hiding this comment.
Please update this to be in line with the copyright headers in the rest of NVDA's source.
| # -*- coding: UTF-8 -*- | |
| # brailleDisplayDrivers/nlseReaderZoomax.py | |
| # Description: | |
| # NLS eReader Zoomax driver for NVDA. | |
| # A part of NonVisual Desktop Access (NVDA) | |
| # Copyright (C) 2025 NV Access Limited, Florin Trutiu | |
| # This file is covered by the GNU General Public License. | |
| # See the file COPYING for more details. | |
| # NLS eReader Zoomax driver for NVDA. |
| # NLS eReader Zoomax driver for NVDA. | ||
|
|
||
| import time | ||
| from typing import Union, List, Optional |
There was a problem hiding this comment.
Union type expressions are preferred over typing.Union. Likewise, T | None is preferred over typing.Optional[T]. And typing.List is a deprecated alias of list.
| from typing import Union, List, Optional | ||
|
|
||
| import braille | ||
| from hwIo import intToByte, boolToByte |
There was a problem hiding this comment.
You import hwIo at line 14.
| import bdDetect | ||
| import serial | ||
|
|
||
| TIMEOUT = 0.2 |
There was a problem hiding this comment.
Please add units.
| TIMEOUT = 0.2 | |
| TIMEOUT_SEC = 0.2 |
| TIMEOUT = 0.2 | ||
| BAUD_RATE = 19200 | ||
| CONNECT_RETRIES = 5 | ||
| TIMEOUT_BETWEEN_RETRIES = 2 |
There was a problem hiding this comment.
Please add units
| TIMEOUT_BETWEEN_RETRIES = 2 | |
| TIMEOUT_BETWEEN_RETRIES_SEC = 2 |
| if not isinstance(command, bytes): | ||
| raise TypeError(typeErrorString.format("command", "bytes", type(command).__name__)) | ||
|
|
||
| arg = arg.replace(ESCAPE, ESCAPE * 2) |
There was a problem hiding this comment.
Can you please explain why you are doing this?
|
|
||
| def _onReceive(self, data: bytes): | ||
| if data != ESCAPE: | ||
| log.debugWarning("Ignoring byte before escape: %r" % data) |
There was a problem hiding this comment.
Please use an f-string instead
| # If not, we wish to know about it, allow decode to raise. | ||
| self._deviceID = arg.decode("latin-1", errors="strict") | ||
| elif command in KEY_NAMES: | ||
| arg = sum(byte << offset * 8 for offset, byte in enumerate(arg)) |
There was a problem hiding this comment.
Why not
| arg = sum(byte << offset * 8 for offset, byte in enumerate(arg)) | |
| arg = int.from_bytes(reversed(arg)) |
| if arg < self._keysDown.get(command, 0): | ||
| # Release. | ||
| if not self._ignoreKeyReleases: | ||
| # The first key released executes the key combination. | ||
| try: | ||
| inputCore.manager.executeGesture(InputGesture(self._deviceID, self._keysDown)) | ||
| except inputCore.NoInputGestureAction: | ||
| pass | ||
| # Any further releases are just the rest of the keys in the combination being released, | ||
| # so they should be ignored. | ||
| self._ignoreKeyReleases = True | ||
| else: | ||
| # Press. | ||
| # This begins a new key combination. | ||
| self._ignoreKeyReleases = False | ||
| if arg > 0: | ||
| self._keysDown[command] = arg | ||
| elif command in self._keysDown: | ||
| # All keys in this group have been released. | ||
| # #3541: Remove this group so it doesn't count as a group with keys down. | ||
| del self._keysDown[command] |
There was a problem hiding this comment.
I'm having a lot of trouble following what's going on here. Could you please comment a bit more on what's going on?
|
|
||
| self.keyNames = names = [] | ||
| for group, groupKeysDown in keysDown.items(): | ||
| if group == LOC_BRAILLE_KEYS and len(keysDown) == 1 and not groupKeysDown & 0xF8: |
| * Automatic language switching is now supported when using Microsoft Speech API version 5 (SAPI5) and Microsoft Speech Platform voices. (#17146, @gexgd0419) | ||
| * NVDA can now be configured to speak the current line or paragraph when navigating with braille navigation keys. (#17053, @nvdaes) | ||
| * In Word, the selection update is now reported when using Word commands to extend or reduce the selection (`f8` or `shift+f8`). (#3293, @CyrilleB79) | ||
| * NLS eReader Zoomax driver has been added. Previously it was available only as a separate addon. |
There was a problem hiding this comment.
| * NLS eReader Zoomax driver has been added. Previously it was available only as a separate addon. | |
| * Support for the NLS eReader Zoomax braille display has been added. (#17509, @florin-trutiu) |
|
|
||
| The NLS eReader Zoomax device supports USB or bluetooth connections. | ||
| The Windows 10 and Windows 11 operating systems will automatically detect and install the necessary drivers for this display. | ||
| For computers where the Internet connection is disabled or not available, for the USB connection, a driver can be download from the USB to serial CH340 chip manufacturer (https://www.wch-ic.com/downloads/CH341SER_EXE.html) |
There was a problem hiding this comment.
| For computers where the Internet connection is disabled or not available, for the USB connection, a driver can be download from the USB to serial CH340 chip manufacturer (https://www.wch-ic.com/downloads/CH341SER_EXE.html) | |
| For computers where the Internet connection is disabled or not available, you can manually [download and install the USB to serial CH340 chip driver](https://www.wch-ic.com/downloads/CH341SER_EXE.html) to support this display over USB. |
|
@florin-trutiu - Is this ready for re-review? I noticed you pushed some changes in January, but this was never marked as ready for review again |
|
it seems @florin-trutiu is not quite active anymore on this repo. Should we mark this as abandoned? Or should we ask within the community whether someone else wants to take it over? |
|
@Adriani90 |
Link to issue number:
Closes #15863
Summary of the issue:
This is the NVDA driver for the NLS eReader Zoomax braille display.
It supports both USB and Bluetooth automatic detection.
Description of user facing changes
With this driver the user can use directly the NLS eReader Zoomax display without the need to manually install it as an addon.
Description of development approach
The driver is similar with the existing braille display drivers for NVDA.
Testing strategy:
Known issues with pull request:
Code Review Checklist:
@coderabbitai summary