Skip to main content
added 198 characters in body
Source Link
jNiuk
  • 183
  • 1
  • 3
  • 13

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 } 

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.

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 } 
Source Link
jNiuk
  • 183
  • 1
  • 3
  • 13

How to simulate a key press in NSTouchBar with NSButton?

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.