The best control to record shortcuts on macOS
- Designed with Swift in mind
- Easily stylable
- Translated into 23 languages
- Supports macOS Accessibility
- Thoroughly documented
- Mac App Store approved
- End-to-end Interface Builder integration
The framework comes with:
SRRecorderControl
to render and capture user inputSRRecorderControlStyle
for custom stylingSRShortcut
that represents a shortcut modelSRShortcutRegistration
to turn the shortcut into an action by registering a global hot keySRShortcutItem
andSRShortcutItemCatalog
are indispensable for custom key equivalent handling in subclasses ofNSViewController
SRShortcutController
for smooth Cocoa Bindings and seamless Interface Builder integrationSRShortcutValidator
to check validity of the shortcut against Cocoa key equivalents and global hot keysNSValueTransformer
andNSFormatter
subclasses for custom alternations
import ShortcutRecorder
let shortcut = Shortcut(keyEquivalent: "⇧⌘A")
let recorder = RecorderControl()
let defaults = NSUserDefaultsController.shared
let keyPath = "values.shortcut"
let options = [NSBindingOption.valueTransformerName: NSValueTransformerName.keyedUnarchiveFromDataTransformerName]
recorder.bind(.value, to: defaults, withKeyPath: keyPath, options: options)
let registration = ShortcutRegistration(keyPath: keyPath, of: defaults) {_ in NSSound.beep() }
Make sure that your binaries depends ShortcutRecorder.framework import ShortcutRecorder
/ #import <ShortcutRecorder/ShortcutRecorder.h>
The framework supports modulemaps, no linking configuration is required.
Just follow your usual routine:
pod 'ShortcutRecorder', '~> 3.0'
Again, nothing special:
github "Kentzo/ShortcutRecorder" ~> 3.0
Add the submodule:
git submodule add git://github.com/Kentzo/ShortcutRecorder.git
Then drag'n'drop into your Xcode's workspace and update your targets.
- The Documentation playground covers all parts of the framework
- The Inspector app gives hands-on experience and is extremely useful for development of custom styles
- Read about Styling and special notes regarding Cocoa's Key Equivalents.
Still have questions? Create an issue.
Paid support is available for custom alternations, help with integration and general advice regarding Cocoa development.