openquack

SPEC-003 — Global hotkey

Status: ratified — shipped 2026-04-26 (Sources/OpenQuackKit/Hotkey/HotkeyManager.swift) Owner: OpenQuackKit/Hotkey/ Last updated: 2026-04-26

Goal

A global hotkey toggles recording. While recording, a separate cancel hotkey discards the buffer. Defaults: ⌃⇧Space (toggle), Esc while overlay is focused (cancel).

Non-goals

Public surface

public extension KeyboardShortcuts.Name {
    static let toggleRecording = Self("openquack.toggleRecording")
    static let cancelRecording = Self("openquack.cancelRecording")
}

public final class HotkeyManager {
    public init()
    public func register(toggle: @escaping () -> Void, cancel: @escaping () -> Void)
    public func unregister()
}

Implementation uses sindresorhus/KeyboardShortcuts (MIT). The package handles persistence to UserDefaults, conflict resolution with system shortcuts, and the SwiftUI Recorder UI for Settings.

Behaviour

Permissions

KeyboardShortcuts works inside the App Sandbox. No Accessibility permission needed for the hotkey itself — but our paste service (SPEC-005) does need Accessibility. Surface the two requirements separately.

Open questions

References