Source profileQuality 91/100

aka-kika/akakika-skills/skills/swift-macos/macos-global-shortcuts/SKILL.md

macos-global-shortcuts

Use when adding or reviewing keyboard shortcuts in a macOS app — in-app vs global, RegisterEventHotKey vs the KeyboardShortcuts package vs NSEvent monitors, user-configurable recording, conflict handling, and which defaults won't collide with the system.

Source repository stars
8
Declared platforms
0
Static risk flags
0
Last source update
2026-08-19
Source checked
2026-08-25

Decision brief

What it does: where it fits

Add keyboard shortcuts that work — in-app ones through SwiftUI, global ones through a real hotkey registration — and keep them configurable, disableable, and out of the system's way.

Best for

  • global shortcut / global hotkey
  • keyboard shortcut that works everywhere
  • summon the app / toggle the popover from anywhere

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/aka-kika/akakika-skills --skill "skills/swift-macos/macos-global-shortcuts"
Safe inspection promptEditorial

Inspect the Agent Skill "macos-global-shortcuts" from https://github.com/aka-kika/akakika-skills/blob/b7081fb221ba5dc51c3b074c2dda67f143c20112/skills/swift-macos/macos-global-shortcuts/SKILL.md at commit b7081fb221ba5dc51c3b074c2dda67f143c20112. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    When to use

    Use this skill when the user says:

    global shortcut / global hotkeykeyboard shortcut that works everywheresummon the app / toggle the popover from anywhere
  2. 02

    Core rule

    Review the “Core rule” section in the pinned source before continuing.

    Review and apply the “Core rule” source section.
  3. 03

    Decision tree

    Review the “Decision tree” section in the pinned source before continuing.

    Review and apply the “Decision tree” source section.
  4. 04

    In-app shortcuts (the 90% case)

    Prefer the menu-command form: it shows up in the menu bar with the chord rendered next to it, which is how users learn shortcuts on macOS.

    Prefer the menu-command form: it shows up in the menu bar with the chord rendered next to it, which is how users learn shortcuts on macOS.
  5. 05

    Global shortcuts, option A: the KeyboardShortcuts package

    For indie SwiftUI apps, sindresorhus/KeyboardShortcuts is the pragmatic choice — it wraps RegisterEventHotKey, persists user choices in UserDefaults, and ships the recorder control you'd otherwise hand-build. No special permissions needed.

    For indie SwiftUI apps, sindresorhus/KeyboardShortcuts is the pragmatic choice — it wraps RegisterEventHotKey, persists user choices in UserDefaults, and ships the recorder control you'd otherwise hand-build. No special…The recorder handles clearing (user deletes the chord → shortcut disabled) and refuses reserved system chords. That's the "changeable + disableable" requirement done.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars8SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
aka-kika/akakika-skills
Skill path
skills/swift-macos/macos-global-shortcuts/SKILL.md
Commit
b7081fb221ba5dc51c3b074c2dda67f143c20112
License
MIT
Collected
2026-08-25
Default branch
main
View the original SKILL.md

macOS Global Shortcuts

Add keyboard shortcuts that work — in-app ones through SwiftUI, global ones through a real hotkey registration — and keep them configurable, disableable, and out of the system's way.

When to use

Use this skill when the user says:

  • global shortcut / global hotkey
  • keyboard shortcut that works everywhere
  • summon the app / toggle the popover from anywhere
  • quick capture hotkey
  • ⌥Space / hyper key
  • RegisterEventHotKey
  • KeyboardShortcuts (the package)
  • shortcut recorder / customize shortcuts
  • shortcut conflicts

Do not use this skill for menu-item shortcuts inside a single window (that's plain .keyboardShortcut), or for intercepting/remapping other apps' keys (that's an event tap + Accessibility permission — a different, heavier topic).

Core rule

In-app shortcuts by default; global only for actions that must work
while the app is in the background. Every global shortcut is
user-changeable, disableable, and never a common system chord.

Decision tree

Does the action only matter while the app is frontmost?
  yes → SwiftUI .keyboardShortcut / menu commands. Stop here.

Must it fire while another app is focused?
  yes → global hotkey:
        indie/product app → KeyboardShortcuts package (recorder UI included)
        zero-dependency   → Carbon RegisterEventHotKey (old API, still correct)

Do you only need to OBSERVE keys, not own a chord?
  → NSEvent.addGlobalMonitorForEvents — but it can't consume events
    and needs Accessibility/Input Monitoring approval. Almost never
    what a "global shortcut" task actually wants.

In-app shortcuts (the 90% case)

// On a control
Button("New Entry", action: newEntry)
    .keyboardShortcut("n", modifiers: [.command])

// As a menu command — visible, discoverable, remappable by the
// user in System Settings > Keyboard > App Shortcuts
.commands {
    CommandMenu("Capture") {
        Button("Quick Capture", action: quickCapture)
            .keyboardShortcut("k", modifiers: [.command])
    }
}

Prefer the menu-command form: it shows up in the menu bar with the chord rendered next to it, which is how users learn shortcuts on macOS.

Global shortcuts, option A: the KeyboardShortcuts package

For indie SwiftUI apps, sindresorhus/KeyboardShortcuts is the pragmatic choice — it wraps RegisterEventHotKey, persists user choices in UserDefaults, and ships the recorder control you'd otherwise hand-build. No special permissions needed.

import KeyboardShortcuts

// 1. Declare names — one per action. Default is optional; nil means
//    "off until the user records one", which is the politest default.
extension KeyboardShortcuts.Name {
    static let toggleQuickCapture = Self("toggleQuickCapture",
                                         default: .init(.space, modifiers: [.option]))
    static let togglePanel = Self("togglePanel")   // no default: opt-in
}

// 2. Listen — set up once, e.g. in the App init or app delegate
KeyboardShortcuts.onKeyUp(for: .toggleQuickCapture) {
    CaptureController.shared.toggle()
}

// 3. Let the user change it in Settings
import SwiftUI

struct ShortcutsSettingsView: View {
    var body: some View {
        Form {
            KeyboardShortcuts.Recorder("Quick capture:", name: .toggleQuickCapture)
            KeyboardShortcuts.Recorder("Show panel:", name: .togglePanel)
        }
    }
}

The recorder handles clearing (user deletes the chord → shortcut disabled) and refuses reserved system chords. That's the "changeable + disableable" requirement done.

Global shortcuts, option B: raw RegisterEventHotKey

When a dependency is unacceptable. The Carbon API is deprecated-looking but supported, sandbox-safe, and requires no permissions — unlike event taps.

import Carbon.HIToolbox

final class HotKey {
    private var ref: EventHotKeyRef?
    private static var handlerInstalled = false
    private static var actions: [UInt32: () -> Void] = [:]
    private let id: UInt32

    init(id: UInt32, keyCode: UInt32, modifiers: UInt32, action: @escaping () -> Void) {
        self.id = id
        Self.actions[id] = action
        Self.installHandlerIfNeeded()

        let hotKeyID = EventHotKeyID(signature: OSType(0x48_4B_45_59), id: id) // "HKEY"
        RegisterEventHotKey(keyCode, modifiers, hotKeyID,
                            GetApplicationEventTarget(), 0, &ref)
    }

    deinit {
        if let ref { UnregisterEventHotKey(ref) }
        Self.actions[id] = nil
    }

    private static func installHandlerIfNeeded() {
        guard !handlerInstalled else { return }
        handlerInstalled = true
        var eventType = EventTypeSpec(eventClass: OSType(kEventClassKeyboard),
                                      eventKind: UInt32(kEventHotKeyPressed))
        InstallEventHandler(GetApplicationEventTarget(), { _, event, _ in
            var hkID = EventHotKeyID()
            GetEventParameter(event, EventParamName(kEventParamDirectObject),
                              EventParamType(typeEventHotKeyID), nil,
                              MemoryLayout<EventHotKeyID>.size, nil, &hkID)
            HotKey.actions[hkID.id]?()
            return noErr
        }, 1, &eventType, nil, nil)
    }
}

// ⌥Space → toggle panel. Key codes are Carbon virtual key codes
// (kVK_Space = 49); modifiers are Carbon masks, not NSEvent masks.
let toggle = HotKey(id: 1,
                    keyCode: UInt32(kVK_Space),
                    modifiers: UInt32(optionKey)) {
    PanelController.shared.toggle()
}

Going this route you also own persistence and a recorder UI — budget for that before choosing it over option A.

What NOT to use for hotkeys

  • NSEvent.addGlobalMonitorForEvents(matching:) — observe-only. It cannot consume the keystroke (the frontmost app still receives it) and silently delivers nothing until the user grants Accessibility/Input Monitoring. Fine for "dismiss my panel when the user clicks/types elsewhere"; wrong for owning a chord.
  • CGEvent taps — can consume keys, but require Accessibility approval and take your process into keylogger-adjacent territory. Reserve for genuine event-remapping tools.

Choosing defaults

In-app:
  ⌘K         command palette (see apple-hig-command-palette)
  ⌘N ⌘F ⌘,   leave with their system meanings

Global (all optional, all user-changeable):
  ⌥Space         summon / quick capture — the de-facto indie default
  ⌃⌥<letter>     secondary actions — the least-collision modifier pair
  ⌘⇧<letter>     avoid globally: heavily used by apps and the system

Rules:

  • Ship at most one global default; make the rest opt-in (declared with no default chord). An app that grabs three chords on first launch is hostile.
  • Never take a bare system chord globally: ⌘Space (Spotlight), ⌘Tab, ⌘Q, ⌘W, screenshot chords (⌘⇧3/4/5), media keys.
  • If registration fails (another app owns the chord), say so in Settings next to the recorder — not with silence.
  • Global shortcuts trigger safe, reversible actions: summon, capture, toggle. Never delete, send, or publish from a chord the user might hit blind.

Conflict handling

Two layers:

  1. Recording time — the recorder should reject system-reserved chords (the KeyboardShortcuts recorder does).
  2. Registration timeRegisterEventHotKey returns an error if the chord is taken by another app's hotkey. Surface it: "⌥Space is in use by another app — choose a different shortcut."

Settings checklist

[ ] Every global shortcut has a recorder in Settings
[ ] Every global shortcut can be cleared (= disabled)
[ ] At most one global chord is on by default; the rest are opt-in
[ ] Registration failure shows a visible message, not silence
[ ] Shortcut works while the app is in the background (that's the point)
[ ] Shortcut fires exactly once per press (test key-repeat)
[ ] Action behind the chord is non-destructive
[ ] In-app shortcuts appear in menus so they're discoverable

Manual test

  1. Record a chord → quit and relaunch → chord still works (persistence).
  2. Focus another app → press the chord → action fires (globality).
  3. Clear the chord in Settings → press it → nothing happens (disable).
  4. Try to record ⌘Q → recorder refuses (reserved).
  5. Register a chord owned by another running app → visible error (conflict).

Frequently asked questions

What to verify before installation and use

What does the macos-global-shortcuts source document cover?

Add keyboard shortcuts that work — in-app ones through SwiftUI, global ones through a real hotkey registration — and keep them configurable, disableable, and out of the system's way.

How do I install macos-global-shortcuts?

The source record exposes this install command: npx skills add https://github.com/aka-kika/akakika-skills --skill "skills/swift-macos/macos-global-shortcuts". Inspect the command and pinned source before running it.

Alternatives

Compare before choosing

Computed 10045,511

coreyhaines31/marketingskills

ab-testing

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program

Computed 10029,034

garrytan/gbrain

bulk-ingestion

End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.

Computed 10024,921

alirezarezvani/claude-skills

app-store-optimization

App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

Computed 1005,241

dotnet/skills

migrate-vstest-to-mtp

Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing