Skip to content

Support keyboard shortcuts #119

Closed

Description

@jsattler

Discussed in #76

Originally posted by janledermann February 9, 2026


Implementation Plan

Add user-customizable global keyboard shortcuts so actions can be triggered even when BetterCapture is not focused.

Shortcuts

Shortcut Action Behavior
Toggle Recording Start or stop recording If recording → stop. If idle with content selected → start. If idle with no content selected → trigger selection based on the user's content selection mode preference (Pick Content or Select Area).
Select Content Open the system content picker Calls presentPicker()
Select Area Open the area selection overlay Calls presentAreaSelection()
  • No default key combinations. All shortcuts start unconfigured. Users set their own in a new "Shortcuts" tab in Settings.
  • The recorder UI automatically warns about conflicts with system shortcuts and app menu shortcuts.

Approach

Use sindresorhus/KeyboardShortcuts (v2.4+) — a well-maintained Swift package that provides global hotkeys within the App Sandbox, with no Accessibility permission required.

Why not native APIs?

  • NSEvent.addGlobalMonitorForEvents requires Accessibility permission for key events.
  • CGEvent.tapCreate is incompatible with App Sandbox.
  • Both require building recorder UI, conflict detection, and storage from scratch.

Full rationale documented in docs/decisions/0001-keyboard-shortcuts-implementation.md.

Changes

  • Add KeyboardShortcuts SPM dependency
  • Define shortcut names (toggleRecording, selectContent, selectArea) in Model/KeyboardShortcutNames.swift
  • Add toggleRecording() method to RecorderViewModel with smart selection fallback
  • Add "Shortcuts" tab to Settings window with KeyboardShortcuts.Recorder views
  • Register shortcut callbacks in BetterCaptureApp.swift
  • Extract ContentSelectionMode enum to its own file (Model/ContentSelectionMode.swift) for shared access

Activity

  1. added
    enhancement
    on Mar 1, 2026
  2. added this to the 2026.3 milestone on Mar 14, 2026
  3. self-assigned this
    on Mar 28, 2026
  4. linked a pull request that will close this issuefeat: support keyboard shortcuts #140on Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions