Skip to content

navigation

This directory provides a standardized, cross-platform interface for historical navigation (moving backward and forward) within various applications and operating systems. By defining abstract navigation actions and implementing context-aware overrides, it ensures that the same voice commands work seamlessly whether you are browsing the web, navigating files in finder/explorer, or using macOS.

The directory consists of two primary files:

  • navigation.py defines the navigation actions and their context-specific behaviors.
  • navigation.talon maps the user's spoken commands to those actions.

Action Definition and Context Overrides

The Python implementation in navigation.py establishes a user.navigation tag and declares two core actions: user.go_back() and user.go_forward().

To ensure these actions perform correctly across different environments, the file defines three distinct behaviors:

  1. Default Behavior: By default, the actions fallback to standard keyboard shortcuts:

    • go_back() triggers alt-left
    • go_forward() triggers alt-right
  2. macOS Override: When running on macOS (os: mac), the actions are overridden to match native macOS system shortcuts:

    • go_back() triggers cmd-[
    • go_forward() triggers cmd-]
  3. Browser Override: When an application matches the tag: browser context, the actions are redirected to Talon's native browser APIs (actions.browser.go_back() and actions.browser.go_forward()), ensuring robust web navigation.

Voice Commands

The navigation.talon file activates when the user.navigation tag is enabled. It exposes simple, intuitive voice triggers that map directly to the defined Python actions:

  • "go back" – Triggers user.go_back()
  • "go forward" – Triggers user.go_forward()