Skip to content

Add global hotkeys (F13 and Cmd+Shift+M) to toggle recording - #732

Open
jayskee wants to merge 1 commit into
Zackriya-Solutions:mainfrom
jayskee:feature/global-hotkey
Open

Add global hotkeys (F13 and Cmd+Shift+M) to toggle recording#732
jayskee wants to merge 1 commit into
Zackriya-Solutions:mainfrom
jayskee:feature/global-hotkey

Conversation

@jayskee

@jayskee jayskee commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Registers a Tauri global-shortcut plugin so the tray's existing toggle_recording action can be fired from anywhere without focusing the app or opening the tray menu.

Two hotkeys are bound, both firing the same handler:

  • F13 — external keyboards (single key, zero conflicts)
  • Cmd+Shift+M — laptop-friendly fallback (M for Meeting, one-hand hit)

Why

The tray menu currently requires clicking the menubar icon to reach "Start Recording"/"Stop Recording". This is friction for two use cases:

  1. Manual quick-toggle while working in another app — you don't lose focus.
  2. External automation (Hammerspoon, Keyboard Maestro, etc.) — the tray icon on a Tauri app isn't reachable via macOS AX (menu bar 2 reports missing value), so scripts can't click it directly. A global hotkey exposes a clean automation surface.

The same toggle_recording_handler the tray already uses is reused verbatim — no new state or logic paths.

Changes

  • Cargo.toml — add tauri-plugin-global-shortcut
  • tauri.conf.json — add global-shortcut:default, global-shortcut:allow-register, global-shortcut:allow-unregister capabilities
  • src/tray.rs — make toggle_recording_handler pub so lib.rs can call it from the plugin handler
  • src/lib.rs — register the plugin, bind both shortcuts, wire the handler

Test plan

  • Build with pnpm run tauri:build on macOS 26 (Apple Silicon)
  • Verify plugin registers at startup: log line Global hotkeys: registering F13 and Cmd+Shift+M → toggle recording
  • Press F13 (external keyboard) → recording toggles, no window focus
  • Press Cmd+Shift+M → recording toggles, no window focus
  • Confirm requires macOS Accessibility permission (plugin registers silently otherwise)

Notes

  • Hotkeys are hardcoded here for the initial cut. Happy to follow up with a settings UI (preferences.json entry + a recording_preferences command) if the maintainers would like them user-configurable — happy to make either default vs. configurable per your preference.
  • On Linux/Windows this compiles unchanged; only the actual key delivery differs by platform (F13 works if the keyboard has it; Cmd on macOS = Super/Win elsewhere via Modifiers::META).
  • Prerequisite for a follow-up PR on meeting auto-detection (#TBD) which uses this handler as its trigger surface.

Introduces a Tauri global-shortcut plugin registration for two hotkeys
that both toggle the tray's existing toggle_recording action:

  - F13           - external keyboards (single key, zero conflicts)
  - Cmd+Shift+M   - laptop-friendly fallback (M for Meeting, one-hand)

This lets recording start/stop without focusing the app or opening the
tray menu, which is important for automations that need to toggle
recording in the background (see follow-up meeting auto-detection).

Requires macOS Accessibility permission to fire; plugin register()
succeeds silently without it but events won't be delivered.

Changes:
  - Cargo.toml: add tauri-plugin-global-shortcut
  - tauri.conf.json: add global-shortcut permissions
  - src/tray.rs: make toggle_recording_handler pub so lib.rs can call it
  - src/lib.rs: register the plugin and bind both shortcuts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant