import Cocoa
class ViewController: NSViewController {
@IBOutlet var button: NSButton!
override func viewDidLoad() {
super.viewDidLoad()
button.keyEquivalent = "m"
button.keyEquivalentModifierMask = [.control]
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
@IBAction func buttonclicked(_ sender: NSButton) {
debugPrint("cliked")
}
}
but the debug shows that keyEquivalentModifierMask was not set properly
button.keyEquivalentModifierMask NSEvent.ModifierFlags [.command]