Support multi routing on Freedom Scientific displays#20250
Draft
LeonarddeR wants to merge 6 commits into
Draft
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>
Collaborator
Author
|
cc @bramd, @cary-rowen, @DataTriny testing would be greatly appreciated. |
Contributor
|
@LeonarddeR Text selection seem to work well for me: Focus 5th gen, 40 cells. |
Contributor
|
Thanks @LeonarddeR Focus 40 cells now support multi-routing. There is one issue: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
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: