Alt + Space + 自动热键中的键 [英] Alt + Space + key in autohotkey
本文介绍了Alt + Space + 自动热键中的键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在自动热键中创建 Alt + Space + C
快捷方式?Alt + Space 是 !space
但我不知道如何添加第三个键而不会出错.
How can I create an Alt + Space + C
shortcut in autohotkey? Alt + Space is !space
but I don't see how I can add a third key without getting an error.
推荐答案
您可以将 #If
指令(需要 AHK_L)与 GetKeyState()
函数结合使用:
You can use the #If
directive (requires AHK_L) in combination with the GetKeyState()
function:
#If GetKeyState("Alt", "p")
Space & c::Traytip,, % a_thishotkey
#If
或者你可以使用 Keywait
命令:
or you can use the Keywait
command:
!space::
keywait, c, d, t0.6
If ErrorLevel
Traytip,, Alt and space
Else
Traytip,, Alt space and c
Return
如果您不按 C,这也会在 0.6 秒后触发 Alt+space 结果.
如果这是不受欢迎的,你可以这样写:
This will also trigger an Alt+space outcome after 0.6 seconds if you don't press C.
If that is undesirable you can write it like this:
!space::
keywait, c, d, t0.6
If (!ErrorLevel) {
Traytip,, Alt space and c
Sleep, 2000
Traytip,, % a_thishotkey
} Return
!ErrorLevel
表示不是 ErrorLevel"
!ErrorLevel
means "not ErrorLevel"
这篇关于Alt + Space + 自动热键中的键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文