AAClause / BrailleExtender

NVDA add-on that improves braille support
https://andreabc.net/projects/NVDA_addons/BrailleExtender/
GNU General Public License v2.0
16 stars 17 forks source link

Introduce role-based braille mapper NVDA #4105 #55

Open bdorer opened 4 years ago

bdorer commented 4 years ago

Copied description of https://github.com/nvaccess/nvda/issues/4105: Very often in NVDA and especially when using braille, role names and their states shown are either lengthy or at a "wrong" place. By referring to "wrong place" it is meant that it is not intuitive and users have to search e.g. for the control state (e.g. for checkboxes). This is the case even when braille display is tethered to review. Furthermore the display representation is coupled to the settings set to speech. Uncoupling them has the advantage of working faster especially when users work with both braille and speech. A "braille mapper" can give full control to the user to customize braille output; thus every user can define his own scheme. Following can be configured: • Text representation of control type • Position of control type or state label relative to the text • Text might be underlined using dots 7 and 8 Braille mappings can either be global or application-specific and are stored in the nvda.ini configuration or application-specific one. Braille mappings are defined on a per-controltype basis where the controltype is specified as ints which, at the moment is not intiutive. If a mapping is not defined for a controltype it falls back to the usual representation scheme. The mapping can take any text plus specific patterns which indicate variables such as values/names, hotkeys etc. This is a list of patterns: Pattern Meaning %t Name or value %s states %h keyboardShortcuttext %i current index %I total amount of items %c columnNumber %o rowNumber %d description Example: To show the state of the checkbox in front of its name or value (without hotkey) following entry has to be in the configuration: 5 = %s %t Furthermore the key dot78roles in the configuration file lists all roles which text should be marked by dots 7 and 8. Both ruling mechanisms may work together. A GUI hasn't been created yet. Eventually, only a few users do need this and hence can do it manually (as it was the case with gestures) or an addon can be delivered to provide the GUI. It would be great to have at least this functionality in the core since it can not be provided by addons. The patch I attached contains modifications of the config/init.py (for the configuration template object) and the braille.py file which contains following modifications: • Adjustment of getBrailleTextForProperties(propertyValues):: Resorted calls. If rule does not exist for control type continue with "old" behaviour. • def mapToRawText(text, role, states, options): Contains the new mapping code. Currently is quite inefficient and some parts are missing. But I would like to complete it if this functionality would be accepted. • NVDAObjectRegion.update(self): Added check whether role match config, and if this is the case set flag to true. • Region.init(self): Added Attribute which is checked at NVDAObjectRegion class. • Region.update(self): Added routine marking braille cells with dots 7 and 8. I don't know how to get the link to brlmapper.patch out of the ticket. May @aliminator would like to help including the feature.

AAClause commented 4 years ago

Great suggestion! :) Where is your patch? Thanks

AAClause commented 4 years ago

I'll try to implement this in #64. So don't hesitate to comment the pull request if you have any suggestion. Thanks.

AAClause commented 4 years ago

@bdorer With the current dev version (commit cabe3be), we can now reorder object properties. What do you think? Any suggestion? Thanks.

bdorer commented 3 years ago

Hi, I like the Feature how it is. Thanks for your great work