How to simulate a key press in NSTouchBar with NSButton?

85 views Asked by At

Looking to add functionality to an NSButton, which when clicked, performs the same keystrokes as Command + "B". Have tried setting the NSButton.keyequivalent as well as NSButton.performKeyEquivalent, but with this case, I cannot find an event to handle an NSButton press.

// Mute Button Pressed
@IBAction func mutePressed(_ sender: NSButton) {
    //performKeyEquivalent(with: NSButton)
    muteButton.keyEquivalent = NX_MODIFIERKEY_COMMAND
}
0

There are 0 answers