问题
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