Duplicate Hotkey
Posted: 04 Jun 2023, 11:30
I have two script using same hotkey, but one requires holding ESC key to trigger, and the other requires double press ESC key twice. But when I use both script, it will trigger duplicate hotkey error. Is there a way to make them work together? Thanks a lot!
Code: Select all
; Press ESC twice
~ESC::
IF !(A_TickCount < ESC)
{
KeyWait, ESC
ESC := A_TickCount + 250 ;1.5 seconds between releasing LAlt then pressing it again
Return
}
ESC =
Run, notepad.exe
Return
; Long Press ESC and Hold
$ESC::
KeyWait ESC, T1
If ErrorLevel {
run, calculator.exe
}
KeyWait ESC
Else Send {ESC}
Return