Support multi routing on Freedom Scientific displays#20250
Conversation
Modernize the Freedom Scientific driver alongside the multi-routing work: - Python 3 idioms (super(), f-strings, OSError, list[int] / X | None) - full type hints and Sphinx-style docstrings - list-comprehension _translate, sum-based checksum - extract _executeGesture and _bitmaskToIndexes helpers - drop dead handleArg type check, stale Python 2 comments, pylint pragmas Fix multi-range routing in KeyGesture: merge the cells addressed by every routing range into one sorted cellIndexes list, emitting an idForCellCount part per range, mirroring ALVA and Standard HID. Previously a simultaneous main-row + top-row press dropped the main-row cells. Also remove a stray merge conflict marker in changes.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A pure-routing release (keyBits == 0) sets dots to 0, which is already the class default and yields no braille-input identifiers, so the guard had no behavioral effect. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
cc @bramd, @cary-rowen, @DataTriny testing would be greatly appreciated. |
|
@LeonarddeR Text selection seem to work well for me: Focus 5th gen, 40 cells. |
|
Thanks @LeonarddeR Focus 40 cells now support multi-routing. There is one issue: |
|
Thanks @DataTriny and @cary-rowen @cary-rowen wrote:
This is expected behavior. The last cell is exclusive, otherwise it would never be possible to select one character. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR extends Freedom Scientific braille display support by adding a “multi routing” gesture (pressing multiple routing keys) and wiring it to a new default “select range” command, while updating documentation and adding a deprecation shim for the old routing gesture class name.
Changes:
- Add a
multiRoutinggesture and bind it by default to “select range” on supporting Freedom Scientific devices. - Refactor the Freedom Scientific driver to emit
KeyGesturefor routing keys (including multi-key/range cases) and provide a compatibility deprecation path. - Update user guide and changelog to document the new gesture and supported drivers.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| user_docs/en/userGuide.md | Documents the new multiRouting gesture in the key/gesture table. |
| user_docs/en/changes.md | Updates changelog for multi-routing support and adds deprecation notes. |
| source/brailleDisplayDrivers/freedomScientific.py | Implements multi-routing behavior, refactors gesture execution, and adds deprecation handling for RoutingGesture. |
seanbudd
left a comment
There was a problem hiding this comment.
Thanks @LeonarddeR changes look generally good
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Link to issue number:
Fixes #20077. Follow-up of #20028.
Summary of the issue:
The Freedom Scientific driver ignored routing button presses entirely (
if isPress: return) and fired a single-cellRoutingGestureon each release. It could not signal which routing keys were held together, so the "multi routing" / "select range" infrastructure added in #20028 had no effect on Focus/PAC Mate displays.Description of user facing changes:
Description of developer facing changes:
brailleDisplayDrivers.freedomScientific.RoutingGestureis deprecated; useKeyGesture, which now carries routing state. Backward compatibility is preserved via a module-level__getattr__/MovedSymbol.KeyGesturegainsroutingKeyBits/topRoutingKeyBitsparameters, setscellIndexes, and builds its id viaidForCellCount.Description of development approach:
_routingKeyBits,_topRoutingKeyBits) in_handleRoutingKey; one combinedKeyGesturefires on the first release, then the bits clear. This mirrors the existing_handleKeys/_updateKeyBitsrelease model instead of firing per key.KeyGesturemerges the cells addressed by every routing range into one sortedcellIndexeslist and emits anidForCellCountpart per range, mirroring the ALVA and Standard HID Braille drivers.super(), f-strings,OSError,list[int]/X | None), full type hints, Sphinx-style docstrings, list-comprehension_translate,sum-based checksum, extracted_executeGestureand_bitmaskToIndexeshelpers, and removal of dead code, stale Python 2 comments and pylint pragmas.Testing strategy:
Manual testing on a Focus display: single routing routes to a cell; two routing keys select a range; the top row scrolls.
Known issues with pull request:
None.
Code Review Checklist: