Global hotkey opens the prompt menu (default ⌃⌥⌘P)#1
Merged
Conversation
- HotkeySpec: keycode + modifier bits, Codable, with display string in Apple HIG modifier order (⌃⌥⇧⌘ then key glyph). Default ⌃⌥⌘P picked to avoid conflicts with ⌥⌘P (printing) and ⇧⌘P (command palettes). - GlobalHotkey: thin Carbon RegisterEventHotKey wrapper. One hotkey at a time, single shared event handler installed lazily, action dispatched to the main queue. Carbon over CGEventTap because the latter would require Accessibility permission on top of what pasting already needs. - StatusBarController registers the default on launch, opens the status menu via statusItem.button.performClick(nil) when fired, and shows the hotkey glyph in the menu header so the binding is discoverable. - 4 tests cover the spec defaults, display ordering, and Codable round-trip. Configurable hotkey via Settings UI is the next step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HotkeySpecvalue type (keycode + modifier bits + display glyph) andGlobalHotkeyCarbon-based registrar.Why Carbon
RegisterEventHotKeyworks without any permission grant. The alternative (CGEventTap) would need Accessibility access on top of what pasting already requires, which is a worse onboarding story.Why ⌃⌥⌘P as default
Picked to avoid conflicts with ⌥⌘P (printing dialogs across the OS), ⇧⌘P (VS Code / Sublime / Notion command palettes), and ⌥⌘Space (Spotlight in some configs). User-configurable hotkey via Settings UI is the next step.
Tests
HotkeySpecTests(4): default keycode + modifier bits, display string ordering matches Apple HIG (⌃⌥⇧⌘), Codable round-trip.Total project tests: 25 passing.
Test plan
swift buildcleanswift testall green (25/25)🤖 Generated with Claude Code