Skip to content

Global commands: replace gestures map with script decorator#11974

Merged
michaelDCurran merged 25 commits into
nvaccess:masterfrom
josephsl:i11964globalCommandsScriptDecorator
Jan 12, 2021
Merged

Global commands: replace gestures map with script decorator#11974
michaelDCurran merged 25 commits into
nvaccess:masterfrom
josephsl:i11964globalCommandsScriptDecorator

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Hi,

Targetting 2021.1 and to encourage usage of script decorator throughout nVDA Core and add-ons:

Link to issue number:

Closes #11964

Summary of the issue:

NVDA 2018.3 introduced scriptHandler.script decorator to ease definition of scripts. one of the places where it is used is global commands where a mixture of script decorator and gestures map is used. To encourage usage of script decorator, standardize around it, beginning with global commands.

Description of how this pull request fixes the issue:

Replace gestures map with script decorator. One exception is sleep mode command where the script uses an attribute that isn't accepted by script decorator yet.

Testing performed:

Tested in source code form (with script decorator applied in global commands).

Known issues with pull request:

None

Change log entry:

None (not really needed)

Considerations:

If this approach is successful, I expect people will file pull requests to convert other parts of NVDA to use script decorator, which will result in more add-ons adopting script decorator approach. This change is significant enough to target 2021.1.

Thanks.

…vaccess#11964.

The following commands were edited to use scriptHandler.script decorator: NVDA+N (show NVDA menu), NVDA+1 (toggle input help), NVDA+Q (quit NVDA), NVDA+F2 (pass next key through), NVDA+Shift+S/Z (toggle sleep mode), as well as unassigned restart NVDA command. For sleep mode toggle command, allow sleep mode flag is kept, and for NVDA menu and sleep mode toggle commands, gestures tuple is used (gestures order: keyboard (desktop and laptop), braille (including braille input and emulated keys), touch).
…r. Re nvaccess#11964.

Convert the following scripts: NVDA+F12 (time and date), NVDA+C (clipboard data announcement), NVDA+Shift+B (battery status).
… decorator. Re nvaccess#11964.

Convert the following commands: NVDA+up arrow/L (read current line), NVDA+Tab (current focus), NVDA+End/Shift+End (read status line), NVDA+down arrow/A (say all), NVDA+Shift+up arrow/Shift+S (say selection), NVDA+T (say title), NVDA+B (read foreground window).
…rator. Re nvaccess#11964.

Converted object navigation scripts: NVDA+Numpad 5/4/6/8/2, NVDA+Shift+O/right/left/up/down arrows, object touch mode flicks (announce current object/move to next/previous/parent/first child) and friends.
nvaccess#11964.

Convert review cursor commands: Shift+Numpad 7/9, Control+NvDA+Home/End on laptop layout (top/bottom), Numpad 7/8/9 (previous/current/next line)m Numpad 4/5/6 (previous/current/next word), Numpad 1/2/3 (previous/current/next character), Shift+Numpad 1/3 (start/end of line) and touch equivalents in text mode, along with review mark/copy commands.
…decorator. Re nvaccess#11964.

Convert the following commands: left/right mouse click/lock, move navigator object to mouse and mouse to navigator object, focus/browse mode toggle, parent tree interceptor.
… decorator. Re nvaccess#11964.

Convert settings dialogs/panels opener commands to use script decorator, including ones iwthout a set gesture such as dictionary dialogs and review cursor panel.
…rator. Re nvaccess#11964.

Convert the following configuration management scripts: Control+NVDA+C (save configuration), Control+NVDA+R (revert/reset configuration), Control+NVDA+P (open config profiles dialog), and an unassigned command to toggle profile triggers.
…vaccess#11964.

Convert various settings scripts to use script decorator, including NVDA+2 (toggle speak typed characters), NVDA+U (probress bar output) and others.
…corator. Re nvaccess#11964.

Convert synth settings ring scripts: Control+NVDA+arrows/Control+NVDA+Shift+arrows (next/previous setting, increase/decrease current setting).
…script decorator. Re nvaccess#11964.

Convert document formatting scripts to use script decorator, all of them unassigned.
…tor. Re nvaccess#11964.

Convert unassigned settings scripts such as braille focus presentation, change braille cursor/shape, mouse text resolution, all unassigned.
…access#11964.

Convert tools scripts to script decorator, including app module info, UWP OCR, speech viewer, and others, some of them with gestures unassigned.
…tor. Re 311964.

Converted braille input and outpu scripts (except keyboard emulation) to use script decorator (tested with a HumanWare BrailleNote Touch Plus).
…vaccess#11964.

Convert touch-specific scripts to use script decorator, including touch hover, right click, and touch mode toggle.
…orator. Re nvaccess#11964.

Convert keyboard emulation scripts for Control, Alt, Windows, Shift, and NVDA keys to use script decorator.
…nvaccess#11964.

Replace gestures map found in global commands with script decorator.
@michaelDCurran

Copy link
Copy Markdown
Member

@josephsl I notice that many of the translated descriptions have their translator comment within the gettext function brackets rather than above E.g.

description = _(
# Translators: blahblah
"Turns input help mode on or off"
)

Are you sure that these comments are successfully included in pot files when written this way?
Apologies if other parts of NVDA may already do it this way... I just have not personally seen it written this way before so thought I'd check.

@josephsl

josephsl commented Jan 12, 2021 via email

Copy link
Copy Markdown
Contributor Author

@michaelDCurran michaelDCurran merged commit c4d6fb5 into nvaccess:master Jan 12, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone Jan 12, 2021
@josephsl josephsl deleted the i11964globalCommandsScriptDecorator branch January 12, 2021 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global commands (2021.1): replace gestures map with script decorator

3 participants