Alt +空格+键入自动热键 [英] Alt + Space + key in autohotkey

查看:570
本文介绍了Alt +空格+键入自动热键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在自动热键中创建Alt + Space + C快捷方式? Alt +空格键是!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 + 空格结果.
如果不希望这样,可以这样写:

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 +空格+键入自动热键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆