Detect hardware headphone presses in mac
问题 This question is concerning the code from this question: Detect headphone button presses in OS X Their answer was marked correct, however I couldn't get their code to work (this may be because of my lack of knowledge of objective-c). I followed their instructions, and modified three files. This is what I have tried (I have also looked at Apple's IOKit documentation and could not find any headphone hardware button documentation): AwesomeClass.h #import <Cocoa/Cocoa.h> #include