Skip to content

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 contains abbreviate.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 named abbreviations.csv.

  • app_switcher: This directory contains files that allow users to switch between and launch applications using voice commands. The core logic is in app_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 as edit.py, edit_command.py, edit_command_modifiers.py, edit_command_actions.py, edit_navigation_steps.py, and edit_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 in edit.talon.

  • file_extension: This directory contains the files for speaking file extensions using Talon. The core logic is in file_extension.py, which defines a Talon list user.file_extension that is populated by a CSV file named file_extensions.csv. This list is used in the rule defined in file_extension.talon.

  • formatters: This directory contains files for formatting text within Talon. The core logic is in formatters.py, which defines various text formatters, like CodeFormatter, TitleFormatter, CapitalizeFormatter, and SentenceFormatter. The formatters are used by the word_formatter, code_formatter, prose_formatter, and reformatter lists defined in the .talon-list files in this directory.

  • help: This directory provides a help system for Talon. It includes help.py, which manages the display of help information in an ImGui window and help_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, and help_scope_open.talon.

  • homophones: This directory contains files that allow for the selection of homophones using a GUI. The core logic is in homophones.py, which parses homophones.csv and creates a GUI for selecting homophones. The homophones.talon file provides the commands for triggering the functionality, and homophones_open.talon provides commands for using the open GUI.

  • keys: This directory provides configuration files for mapping spoken words to keyboard keys. It includes platform-specific subdirectories (mac and win), 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, and keys.py, which defines the lists and capture rules.

  • menu_choose: This directory allows for selecting items from menus using voice commands. The actions choose and choose_up are defined in menu_choose.py and triggered with voice commands in menu_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 in modes.py. It also includes files such as sleep_mode.talon, command_and_dictation_mode.talon, modes_not_dragon.talon, language_modes.py, and code_languages.py. The directory also includes platform-specific files like dragon_mode.talon, and modes_dragon.talon for controlling Dragon, and sleep_mode_wav2letter.talon for the wav2letter speech engine.

  • mouse_grid: This directory contains the code for the mouse grid system. The core logic is in mouse_grid.py, which defines the MouseSnapNine class. The commands for interacting with the mouse grid are defined in mouse_grid_always.talon and mouse_grid_open.talon.

  • navigation: This directory contains files for navigating forward and backward, using different keybindings based on the context. It uses navigation.py to define the actions for each context, and navigation.talon to bind the commands.

  • numbers: This directory provides files for parsing and representing numbers using voice commands. The core logic is in numbers.py, which defines how numbers are parsed. It also includes ordinals.py, which defines lists of ordinal words. The Talon bindings for these files are provided by numbers_unprefixed.talon and numbers_prefixed.talon.

  • screens: This directory contains files for managing and displaying information about multiple screens. The core logic is in screens.py, which provides actions for showing screen numbers, and the command to use the actions is in screens.talon.

  • snippets: This directory contains the code for handling code snippets. It includes snippets.py for managing and using snippets, snippets_parser.py for parsing snippet files, snippets_insert.py for inserting snippets, snippets_insert_raw_text.py for inserting raw text, and snippet_types.py for defining dataclasses used in the other files. The snippets themselves are stored in the snippets/snippets subdirectory as .snippet files. The directory also includes snippets.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 as currency.talon-list, prose_modifiers.talon-list, prose_snippets.talon-list, and phrase_ender.talon-list. The commands for manipulating text are defined in text.talon. The core logic for text formatting and dictation is in text_and_dictation.py, which defines captures for words, phrases, and prose, and the DictationFormat class, which is used to format text. This directory also includes phrase_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 in vocabulary.py, which defines how custom vocabulary is loaded, modified, and used. It uses words_to_replace.csv and vocabulary.talon-list to store the user's customizations. The Talon commands to use the actions are defined in edit_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 in website.talon-list and search_engine.talon-list to store website and search engine URLs. The logic for the actions is in websites_and_search_engines.py, and the voice commands to use the actions are defined in websites_and_search_engines.talon.

  • windows_and_tabs: This directory contains files for managing windows and tabs across different operating systems. It includes window_snap.py for snapping windows to specific screen positions and platform-specific files (windows_and_tabs_win.py, windows_and_tabs_mac.py, and windows_and_tabs_linux.py) for common window and tab actions. Generic tab actions are in tabs.py, and cross-platform window cycling actions are in windows_and_tabs.py. The voice commands for using the actions are defined in window_management.talon and tabs.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 the community/core directory.
  • 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.