help
This directory contains the implementation of the interactive, voice-controlled help system. It provides on-screen graphical overlays (using Talon’s imgui module) to display list definitions, active contexts, active commands, available formatting styles, programming operators, and current Talon scope properties.
Overview
The help system functions as a dynamic reference manual. When a help screen is open, the system injects context-specific voice commands—such as pagination ("help next") or closure ("help close")—that are only active while the overlay is visible. This allows users to browse system documentation, search for specific verbal commands, and inspect their current Talon configuration state without using a mouse or keyboard.
Key Components
The help system is split into Python backend logic (managing data models, search matching, and UI rendering) and Talon files (defining the spoken triggers).
Backend & UI Logic
-
help.py: The primary coordinator of the help system. It processes context mappings, maintains pagination state, handles text wrapping, and indexes active rules for real-time word searching. It renders several
imguidisplays:- Context Help: Displays active or all command contexts, grouped by specificity (Application-specific, Context-dependent, or Global).
- List Help: Dynamically extracts items and descriptions from internal registries (e.g., symbols, websites, search engines) and displays them.
- Operators & Formatters: Displays language-specific coding operators and formatting patterns (e.g., camelCase, snake_case) on demand.
-
help_scope.py: A developer-focused utility that renders the current Talon Scope overlay. It lists currently active modes, active tags, and miscellaneous key-value pairs (like screen names or current application details). This is crucial for debugging why certain commands might or might not be firing in a given context.
Spoken Trigger Definitions
-
help.talon: The main list of commands used to launch various help menus. Example triggers include:
help alphabetorhelp symbolsto look up spoken phonetic forms.help contextorhelp activeto inspect current rules.help search <text>to filter available rules by word.help scopeto toggle the scope inspection panel.
-
help_open.talon: Activates the tag
user.help_openwhen any primary help GUI is displayed. This dynamically enables navigation controls likehelp next,help previous, andhelp close. By restricting these commands to this specific tag, they do not clutter the global command space during regular dictation. -
help_scope_open.talon: Similar to help_open.talon, this activates when the scope inspector is displayed (using tag
user.help_scope_open), enabling voice commands to hide/close the scope. -
help_dictation.talon: Ensures basic help triggers (like
help activeorhelp context) are accessible even while in dictation mode by locking them to start-of-utterance anchors (^).
How They Work Together
- Requesting Help: A user says a command like
"help search select". - Activating UI: Talon matches the command in help.talon, calling
actions.user.help_search("select")defined in help.py. - Rendering:
help.pyfilters the cached command-to-rule index for the word "select", formats pages, sets the state taguser.help_open, and opensgui_context_help. - Navigation: The presence of
user.help_openactivates help_open.talon, allowing the user to say"help next"to turn the page. - Teardown: Saying
"help close"invokeshelp_hide(), which hides the active IMGUI, unregisters active update listeners, and clears the navigation tags to return Talon to its standard state.