擅长:python、mysql、java
<p>我相信您需要在windowsapi级别工作(没有更高级别的函数可以这样做),使用<a href="http://msdn.microsoft.com/en-us/library/ms646309(VS.85).aspx" rel="nofollow noreferrer">RegisterHotKey</a>(第一个参数为空指针)将全局热键与当前线程的消息队列相关联,然后线程必须继续为其正常的Windows消息循环提供服务。我怀疑你会想把整个过程作为一个Windows服务来运行,例如per <a href="http://code.activestate.com/recipes/576451-how-to-create-a-windows-service-in-python/" rel="nofollow noreferrer">this recipe</a>,它使用<a href="http://starship.python.net/~skippy/win32/" rel="nofollow noreferrer">Python for Windows Extensions</a>来确保它在系统启动时一直在运行。在</p>