Object of class SRShortcut is not among allowed top level class list
chensifang opened this issue · comments
亅 Chen commented
Error:Object of class SRShortcut is not among allowed top level class list
import ShortcutRecorder
let defaults = NSUserDefaultsController.shared
let keyPath = "values.shortcut"
let options = [NSBindingOption.valueTransformerName: .keyedUnarchiveFromDataTransformerName]
let beepAction = ShortcutAction(keyPath: keyPath, of: defaults) { _ in
NSSound.beep()
return true
}
GlobalShortcutMonitor.shared.addAction(beepAction, forKeyEvent: .down)
let recorder = RecorderControl()
recorder.bind(.value, to: defaults, withKeyPath: keyPath, options: options)
recorder.objectValue = Shortcut(keyEquivalent: "⇧⌘A")
Jan commented
This is not a maintained repo. Everyone is probably best served by Kentzo’s fork.