autohotkey - 更多的字符作为一个热键
问题描述:
有什么办法来映射一系列的字符来触发事件?autohotkey - 更多的字符作为一个热键
我想有一张特殊的热键记住(e.g. Control-k)
与之后的另一封信中,我可以触发不同的事件: 前
^km --> do something
^kp --> do something else
^kc --> do something else
...
答
; The #If-directive creates context-sensitive hotkeys and hotstrings.
; #If is positional: it affects all hotkeys and hotstrings physically beneath it in the script.
#If GetKeyState("Ctrl")
; ^ka
k & a:: MsgBox, Ctrl_k_a
; ^kb
k & b:: MsgBox, Ctrl_k_b
#If ; turn off context sensitivity
+0
这是一个非常有用的信息,它听起来非常强大。非常感谢!我会围绕它练习,因为我的第一次尝试似乎需要全部按3个键(例如:^ kp在1镜头中,工作正常,但:^ + some_ms_time + k + some_ms_time + p,打开我的打印机对话框' p')。再次感谢。 –
也考虑'hotstring's – Blauhirn