您可以使用#If
指令(需要 AHK_L)与GetKeyState()
功能:
#If GetKeyState("Alt", "p")
Space & c::Traytip,, % a_thishotkey
#If
或者你可以使用Keywait
命令:
!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
意思是“不是错误级别”