简单方法实现在特定窗口激活时改键
许可协议:
CC BY-NC-SA
本文由 wenqiushi (cnblogs.com) 创作,采用 知识共享 署名-非商业性使用-相同方式共享 3.0 中国大陆 许可协议进行许可。请阅读原创性声明 。
正文:
这里先提供AutoHotKey版本的实现,简单易行,不愧神器。
在特定窗口激活时改键,使用如下代码:
Loop{ #IfWinActive, 特定窗口标题 { t::1 y::2 return } }
即可将T键改为1,将Y键改为2。
其中双冒号代表设置热键。
注意应使用 #IfWinActive 而非 IfWinActive(没有井号),否则热键在其他窗口下会无法“还原”,并且不能通过类似 t::t 等方式显式还原,因为AutoHotKey不允许重复设置热键。
这里是我自回答的问题 http://www.zhihu.com/question/22939437/answer/23129201
- END -