Skip to content

Add initializer to KeyboardShortcuts.Recorder that accepts a binding #164

Open
@sindresorhus

Description

This would let developers use the recorder for custom use-cases when they don't need everything that comes with the Name system. For example, support for local shortcuts.

import SwiftUI
import KeyboardShortcuts

struct SettingsScreen: View {
	@State private var shortcut: KeyboardShortcuts.Shortcut?

	var body: some View {
		Form {
			KeyboardShortcuts.Recorder("Toggle Unicorn Mode:", shortcut: $shortcut)
		}
	}
}

Also document how to use this to be able to use the recorder to record local shortcuts.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions