Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sindresorhus opened this issue Mar 19, 2024 · 0 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Mar 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant