可可应用程序无需启动iTunes即可响应键盘弹奏/暂停键? [英] Cocoa app respond to keyboard play/pause key without launching iTunes?

查看:99
本文介绍了可可应用程序无需启动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?

但是,当我按Play/Pause键时,iTunes开始启动,是否有任何方法可以防止在我按应用程序中的Play/Pause键时启动iTunes?

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的请求没有响应.

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

这篇关于可可应用程序无需启动iTunes即可响应键盘弹奏/暂停键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆