Alt + Space + key in autohotkey

筅森魡賤 提交于 2019-12-06 07:55:32

问题


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.


回答1:


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

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

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 means "not ErrorLevel"



来源:https://stackoverflow.com/questions/11986814/alt-space-key-in-autohotkey

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!