nvda
49f00ec9 - Add multi routing gesture and select with routing command (#20028)

Commit
116 days ago
Add multi routing gesture and select with routing command (#20028) Closes #20001 Summary of the issue: NVDA's BrailleDisplayGesture only exposed a single routingIndex, so braille displays that report multiple simultaneously pressed routing keys could not bind a meaningful "multi routing" gesture. There was also no way for a user to select a range of text directly from the braille display. Description of user facing changes: New "multi routing" gesture: pressing multiple routing keys simultaneously on a supported display can now be bound to a single gesture. New command "Selects the text from the first up to the last pressed braille routing key" (script_braille_selectRange). The selection is half-open: it starts at the cell under the first pressed routing key and ends just before the cell under the last pressed routing key. On drivers that emit multiRouting natively, the gesture is bound to this command out of the box; users of other displays can bind it manually if they wish. Drivers shipped with multiRouting → braille_selectRange bound by default: ALVA, Albatross (bound to home1+multiRouting and home2+multiRouting due to device-level limitation), Baum (and compatible), HumanWare Brailliant BI/B series, Handy Tech, NLS eReader Zoomax, Seika Notetaker, Standard HID Braille displays. Description of developer facing changes: braille.BrailleDisplayGesture exposes cellIndexes: list[int] | None. The single-valued routingIndex is now a deprecated property that falls back to max(cellIndexes) for compatibility. When NVDAState._allowDeprecatedAPI() returns False the getter and setter raise AttributeError. New helper BrailleDisplayGesture.idForCellCount(count, baseName="routing") (classmethod) builds the canonical id ("routing" / "multiRouting" / "multiSecondRouting"). cellIndexes is not limited to routing keys; touch-sensitive cells (e.g. Handy Tech ATC) can reuse it. _remoteClient propagates cellIndexes while keeping routingIndex populated for older peers. seikantk.InputGestureRouting.__init__ now accepts a list of indexes; a single int is still accepted for backwards compatibility. Description of development approach: Added cellIndexes and a deprecation shim for routingIndex on BrailleDisplayGesture. Migrated every in-tree driver from self.routingIndex = x to self.cellIndexes = [x] (or to a collected list where the protocol reports several keys at once). Generalised the gesture id construction via idForCellCount so drivers with multiple routing ranges (e.g. ALVA routing + secondRouting, HID routerSet1 collections yield ids like multiRouting, multiSecondRouting, routerSet1_multiRouterKey. Added script_braille_selectRange in globalCommands using getTextInfoForWindowPos + setEndPoint("endToEnd") + updateSelection(). Guarded against cellIndexes being None/short and against NotImplementedError from the focused control. Wired multiRouting → braille_selectRange in the gesture map of every driver whose driver-side implementation now reports simultaneous routing keys.
Author
Parents
Loading