Guide

Keyboard Shortcuts

Built-in shortcuts and registering custom keybindings
Properties3
Is BaseNo
Iconi-lucide-keyboard
Order50

Built-In Shortcuts

Add KelyphosCommands to your app to enable the default shortcuts:

var body: some Scene {
    WindowGroup("My App") {
        KelyphosShellView(state: shellState, configuration: ...)
    }
    .commands {
        KelyphosCommands(state: shellState)
    }
}
ShortcutAction
Cmd+0Toggle navigator
Cmd+1–9Select navigator tab
Cmd+Opt+0Toggle inspector
Cmd+Opt+1–9Select inspector tab
Cmd+Opt+Shift+0Toggle utility area
Cmd+Opt+Shift+1–9Select utility tab
Cmd+Shift+/Show keybindings overlay (macOS)
Cmd+,Settings

Registering Custom Shortcuts

Use the kelyphosKeybindingRegistry environment value to register your own shortcuts for the overlay:

@Environment(\.kelyphosKeybindingRegistry) var registry

.onAppear {
    registry.register(category: "Editor", label: "Save", shortcut: "⌘S")
    registry.register(category: "Editor", label: "Find", shortcut: "⌘F")
    registry.register(category: "Navigation", label: "Go to File", shortcut: "⌘P")
}

Registered shortcuts appear in the Cmd+Shift+/ keybindings overlay on macOS.