擅长:python、mysql、java
<p>利用google的强大功能,我找到了<a href="http://snippets.aktagon.com/snippets/361-Registering-global-hot-keys-with-Cocoa-and-Objective-C" rel="nofollow">this snippet of code</a>,它允许注册macosx的全局热键</p>
<p>当将Objective-C self指针传递给C函数时,您需要添加<code>Carbon</code>框架,以及{<cd2>}的桥接转换。在</p>
<p>至少,您还需要:</p>
<pre><code>#import <Carbon/Carbon.h>
</code></pre>
<p>密钥码可以看到<a href="http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes" rel="nofollow">on this page explaining the virtual key codes</a>。在</p>