绑定到媒体键,阻止iTunes OS X [英] Binding to media keys, block iTunes OS X

查看:112
本文介绍了绑定到媒体键,阻止iTunes OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用此处介绍的方法: http://weblog.rogueamoeba.com/2007/09/ 29 /

I've been using the methods described here: http://weblog.rogueamoeba.com/2007/09/29/

并读取此主题:在OSX 10.5下绑定到Apple键盘上的媒体键

我覆盖了sendEvent类,并且可以检测媒体键输​​入。问题是iTunes按下播放按钮时启动。上面提到的线程指出,iTunes钩在事件的其他地方(未知),所以没有办法阻止它获得播放/暂停(F8)事件。

I've overridden the sendEvent class, and can detect media key input. The problem is that iTunes launches when the Play button is pressed. The above mentioned thread states that iTunes hooks into the event somewhere else (unknown), so there isn't a way to block it from getting the Play/Pause(F8) event.

作为解决方法,我已经离开Quicktime播放器打开没有文件。然而,在Mountain Lion上,Quicktime在一段时间的不活动之后显然关闭了,因此使得这种解决方法不可行。

As a workaround, I've been leaving Quicktime Player open with no file. However, on Mountain Lion, Quicktime closes itself after a certain period of inactivity apparently, thus rendering this workaround unviable.

我知道Spotify和MPlayerX等应用程序已经能够实现这一点。他们似乎完全阻止了这个事件,而不仅仅是为了iTunes。

I know applications such as Spotify and MPlayerX have been able to achieve this somehow. They appear to block the event completely, not just for iTunes.

更多googling,我发现这里discussion.apple.com/thread/2122639?start=210&tstart= 0,它跟踪它到远程控制守护进程通过Applescript进行调用。有一些工作,删除rcd守护程序的执行权限(需要sudo,必须重新运行OSX更新)。 nomitsu.com/contents/MMFix_src.tgz

More googling, I found this discussions.apple.com/thread/2122639?start=210&tstart=0 which tracks it down to the Remote Control Daemon making the calls via Applescript. There are some work arounds which removes the execution permission on the rcd daemon (requires sudo, has to be re-run anytime OSX is updated). nomitsu.com/contents/MMFix_src.tgz

有没有人知道他们(MPlayerX,Spotify)能够做到这一点是一个不那么黑客的方式吗?

Does anyone have any insight as to how they (MPlayerX, Spotify) have been able to do this is a less hacky way?

感谢您的任何建议。

推荐答案

将执行此操作的现有类: http://overooped.com/post/2593597587/mediakeys

I found a pre-existing class that will do this: http://overooped.com/post/2593597587/mediakeys

哇,那一定要找一些找的!希望它帮助别人!

Wow, that took some looking to find! Hope it helps someone else!

这篇关于绑定到媒体键,阻止iTunes OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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