Cocoa 应用程序响应键盘播放/暂停键而不启动 iTunes?
我阅读了这篇文章并成功使我的应用程序响应媒体密钥: 让我的 Cocoa 应用程序响应键盘播放/暂停键?
但是,当我按下播放/暂停键时,iTunes 开始启动,是否有任何方法可以阻止当我在应用程序中按下播放/暂停键时启动 iTunes?
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?
您最好的选择是使用此 SPMediaKeyTap 代码,它可以正常工作,但它可能会不稳定,因为您的应用程序的捆绑包 ID 未包含在其他代码中,并且开发人员不会响应新捆绑包 ID 的请求。
SPMediaKeyTap
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