Skip to content

sumatrapdf

This directory provides Talon voice control support for SumatraPDF, a popular, lightweight open-source PDF and document viewer for Windows.

It implements standard Talon interfaces for managing multipage documents and browser-like tab controls, adapting them to SumatraPDF's native keyboard shortcuts.

How It Works

The configuration is split into two main components: an application context definition with action implementations, and a activation file that enables the relevant voice command sets.

  • sumatrapdf.py: This file defines the SumatraPDF application targeting Windows systems running sumatrapdf.exe. It overrides three primary sets of actions to map Talon's global action APIs to SumatraPDF's specific keyboard shortcuts:

    • App Actions: Maps standard tab creation actions (e.g., opening a new tab) to ctrl-o.
    • Edit Actions: Integrates zoom behavior by mapping zoom_in to + and zoom_out to -.
    • User Actions: Implements document-navigation patterns (user.pages and user.tabs), mapping commands like page rotation (shift-ctrl-keypad_plus/minus), page jumping (ctrl-g), and direct tab switching (using alt-1 through alt-9).
  • sumatrapdf.talon: When SumatraPDF is the active window, this file dynamically activates two standard community tags:

    • user.pages (enables commands for paging up, down, going to a specific page, and rotating pages).
    • user.tabs (enables generic tab-management voice commands like switching or closing tabs).

By implementing these standardized tags, users can use the same universal voice commands they use in web browsers or text editors to control page layout and tab navigation inside SumatraPDF.