Make my Cocoa app respond to the keyboard play/pause key?

Viewed 4841

Is there a way to make my app respond to the play/pause button on Mac?

EDIT:

Using the suggested code,I get this console message:

Could not connect the action buttonPressed: to target of class NSApplication

Why would that be?

4 Answers
Related