问题
I read this article and successfully make my app respond to media key: Make my Cocoa app respond to the keyboard play/pause key?
However, when I pressed play/pause key, the iTunes started to launch, is there any method to prevent iTunes launching when I press play/pause key in my app?
回答1:
Your best bet is to use this SPMediaKeyTap code, it works OK, but it can be flaky since your app's bundle ID isn't included in other's code, and the developer is not responsive to requests for new bundle IDs.
SPMediaKeyTap
来源:https://stackoverflow.com/questions/7473000/cocoa-app-respond-to-keyboard-play-pause-key-without-launching-itunes