core
The community/core directory contains the core functionality of the Talon community configuration. It includes a variety of subdirectories and files that manage aspects of Talon such as code snippets, vocabulary, key bindings, text formatting, and application switching.
Here's a breakdown of the most important subdirectories and files, and how they work together:
-
abbreviate: This directory containsabbreviate.py, which defines a system for expanding abbreviations in Talon. It uses a dictionary of abbreviations and their expansions, and it can be customized with a CSV file namedabbreviations.csv. -
app_switcher: This directory contains files that allow users to switch between and launch applications using voice commands. The core logic is inapp_switcher.py, which uses platform-specific CSV files to manage application names and spoken overrides. -
edit: This directory provides core editing functionality for Talon, including actions for navigating, selecting, and manipulating text. It includes platform-specific files (edit_linux.py,edit_mac.py,edit_win.py) and more advanced editing functionality in files such asedit.py,edit_command.py,edit_command_modifiers.py,edit_command_actions.py,edit_navigation_steps.py, andedit_paragraph.py. It also includes files for managing delimiter pairs (delimiter_pair.py) and inserting text between two points (insert_between.py). These are all used by the rules defined inedit.talon. -
file_extension: This directory contains the files for speaking file extensions using Talon. The core logic is infile_extension.py, which defines a Talon listuser.file_extensionthat is populated by a CSV file namedfile_extensions.csv. This list is used in the rule defined infile_extension.talon. -
formatters: This directory contains files for formatting text within Talon. The core logic is informatters.py, which defines various text formatters, likeCodeFormatter,TitleFormatter,CapitalizeFormatter, andSentenceFormatter. The formatters are used by theword_formatter,code_formatter,prose_formatter, andreformatterlists defined in the.talon-listfiles in this directory. -
help: This directory provides a help system for Talon. It includeshelp.py, which manages the display of help information in an ImGui window andhelp_scope.py, which displays the current Talon scope. It also includes Talon files to trigger the help system and to navigate the help window:help.talon,help_open.talon, andhelp_scope_open.talon. -
homophones: This directory contains files that allow for the selection of homophones using a GUI. The core logic is inhomophones.py, which parseshomophones.csvand creates a GUI for selecting homophones. Thehomophones.talonfile provides the commands for triggering the functionality, andhomophones_open.talonprovides commands for using the open GUI. -
keys: This directory provides configuration files for mapping spoken words to keyboard keys. It includes platform-specific subdirectories (macandwin), as well as several key definition files (e.g.,arrow_key.talon-list,number_key.talon-list,function_key.talon-list,letter.talon-list). These lists are used by the core files in this directory:keys.talon, which defines grammar rules for using the keys, andkeys.py, which defines the lists and capture rules. -
menu_choose: This directory allows for selecting items from menus using voice commands. The actionschooseandchoose_upare defined inmenu_choose.pyand triggered with voice commands inmenu_choose.talon. -
modes: This directory defines and manages different modes of operation for Talon, such as "sleep", "command", "dictation", and language modes. The core logic is inmodes.py. It also includes files such assleep_mode.talon,command_and_dictation_mode.talon,modes_not_dragon.talon,language_modes.py, andcode_languages.py. The directory also includes platform-specific files likedragon_mode.talon, andmodes_dragon.talonfor controlling Dragon, andsleep_mode_wav2letter.talonfor thewav2letterspeech engine. -
mouse_grid: This directory contains the code for the mouse grid system. The core logic is inmouse_grid.py, which defines theMouseSnapNineclass. The commands for interacting with the mouse grid are defined inmouse_grid_always.talonandmouse_grid_open.talon. -
navigation: This directory contains files for navigating forward and backward, using different keybindings based on the context. It usesnavigation.pyto define the actions for each context, andnavigation.talonto bind the commands. -
numbers: This directory provides files for parsing and representing numbers using voice commands. The core logic is innumbers.py, which defines how numbers are parsed. It also includesordinals.py, which defines lists of ordinal words. The Talon bindings for these files are provided bynumbers_unprefixed.talonandnumbers_prefixed.talon. -
screens: This directory contains files for managing and displaying information about multiple screens. The core logic is inscreens.py, which provides actions for showing screen numbers, and the command to use the actions is inscreens.talon. -
snippets: This directory contains the code for handling code snippets. It includessnippets.pyfor managing and using snippets,snippets_parser.pyfor parsing snippet files,snippets_insert.pyfor inserting snippets,snippets_insert_raw_text.pyfor inserting raw text, andsnippet_types.pyfor defining dataclasses used in the other files. The snippets themselves are stored in thesnippets/snippetssubdirectory as.snippetfiles. The directory also includessnippets.talon, which defines the Talon commands for using the snippets. -
text: This directory defines how Talon handles text input and formatting. It includes lists of words and phrases in files such ascurrency.talon-list,prose_modifiers.talon-list,prose_snippets.talon-list, andphrase_ender.talon-list. The commands for manipulating text are defined intext.talon. The core logic for text formatting and dictation is intext_and_dictation.py, which defines captures for words, phrases, and prose, and theDictationFormatclass, which is used to format text. This directory also includesphrase_history.py, which manages a history of recently spoken phrases. -
vocabulary: This directory contains files that manage custom vocabulary and word replacement for Talon. The core logic is invocabulary.py, which defines how custom vocabulary is loaded, modified, and used. It useswords_to_replace.csvandvocabulary.talon-listto store the user's customizations. The Talon commands to use the actions are defined inedit_vocabulary.talon. -
websites_and_search_engines: This directory contains files that allow users to quickly navigate to websites and perform searches using voice commands. It uses lists inwebsite.talon-listandsearch_engine.talon-listto store website and search engine URLs. The logic for the actions is inwebsites_and_search_engines.py, and the voice commands to use the actions are defined inwebsites_and_search_engines.talon. -
windows_and_tabs: This directory contains files for managing windows and tabs across different operating systems. It includeswindow_snap.pyfor snapping windows to specific screen positions and platform-specific files (windows_and_tabs_win.py,windows_and_tabs_mac.py, andwindows_and_tabs_linux.py) for common window and tab actions. Generic tab actions are intabs.py, and cross-platform window cycling actions are inwindows_and_tabs.py. The voice commands for using the actions are defined inwindow_management.talonandtabs.talon.
In addition to these subdirectories, the community/core directory also contains the following files:
app_running.py: This file defines a Talon scope that tracks running applications.dragon_engine.py: This file defines actions for controlling the Dragon speech engine.README.md: This file provides a high-level overview of thecommunity/coredirectory.tags.py: This file defines tags for loading various modules and plugins.system_command.py: This file defines actions for executing system commands.deprecations.py: This file defines actions for deprecating voice commands, actions, and captures.create_spoken_forms.py: This file defines actions for creating spoken forms of strings.system_paths.py: This file defines a list of system paths and a capture for using those paths.delayed_speech_off.py: This file defines actions to enable and disable speech recognition.application_matches.py: This file defines application matching patterns.noise.py: This file defines actions that are triggered by noises.user_settings.py: This file provides helper functions for managing user settings.
These files and subdirectories work together to provide a comprehensive set of features and functionality for the Talon voice control system.