New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow add-on braille display drivers to opt in for auto detection #15196
Comments
From a user's perspective, the opt-out of certain drivers is the big feature here worth implementing in it's own right. Easier driver registration for add-on developers is also a nice bonus that I would love to see implemented. The HID braille driver sometimes activates when a HID-compatible display such as the Brailliant BI 40x is being detected during a scan cycle where the native Brailliant driver missed it. This causes confusion such as other key bindings and is a good argument to get disabling this driver outside of the advanced options. |
Agreed there. But opt-out and again opt-in would rely on asking a driver to register itself. |
closes #15196 Summary of the issue: It is currently not possible to disable display drivers for automatic detection, other than the HID braille standard There is no obvious way for add-on bundled braille display drivers to register themselves in automatic detection. Description of user facing changes In the braille display selection dialog, when automatic is selected, there is now an additional checklistbox that allows you to disable drivers. The disabled drivers are saved in config. The advanced option for to disable HID braille has been removed. Users should use the new checklistbox instead. There is a config profile upgrade step to remember the user's decision about explicitly disabling HID. It is now possible to select the HID braille driver manually when it is disabled for automatic detection. The old option in advanced setting disabled HID completely, i.e. the driver wasn't available for manual selection either. Description of development approach Added a registerAutomaticDetection classmethod to BrailleDisplayDriver. This method is called by bdDetect.initialize. The classmethod receives a bdDetect.DriverRegistrar that contains the following methods: addUsbDevices: to register USB devices addBluetoothDevices: To register bluetooth devices addDeviceScanner: convenience method to register a handler to the scanForDevices extension point Added a supportsAutomaticDetection boolean attribute on braille display drivers. This should be set to True for bdDetect to recognize the driver. Removed the option from the config to enable/disable HID, instead rely on a new excludeDisplays lisst in the config that is populated by the new option in the braille display selection dialog. Note that exclusions are saved, not inclusions. This ensures that new drivers will be opt-out. bdDetect.Detector._queueBgScan has a backwards compatible change for its limitToDevices parameter. When None, it falls back to the list of enabled drivers. When no drivers are disabled, it checks all drivers. Logic from bdDetect.initialize() has been moved to the respective display drivers, calling the replacement methods on the driverRegistrar and omitting the name of the driver in the method call.
Is your feature request related to a problem? Please describe.
There is currently no documented way for braille display drivers to register themselves for auto detection. You can register a display in a global plugin, but as the global plugin loads after the braille subsystem, the display won't be detected in the first round of detection.
Describe the solution you'd like
registerAutomaticDetection
method onBrailleDisplayDriver
. This method must be implemented for drivers to register themselves in bdDetect. The method receives a new bdDetect.DriverRegistrar object that has addUsbDevices, addBluetoothDevices and addDeviceScanner methods that are bound to the driver.The text was updated successfully, but these errors were encountered: