Code: Select all
; The ESC trigger from line below CONFLICTS with line 20
ESC::
KeyWait, %A_ThisHotkey%, T1.5 ; Long Press and Hold, THIS LINE CONFLICTS WITH LINE 19.
If ErrorLevel {
MsgBox, 4, Confirm to "FORCE" Eject all drives?, Confirm to "FORCE" Eject all drives?, 1
return
Keywait, ESC
}
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < 400) { ; Double Press Twice
MsgBox, 4, Confirm ending process?, Confirm ending process?, 1
return
KeyWait, ESC
}
Else Send, {ESC}
#IfWinExist Confirm ending process? ; To press NO in the msgbox, so I can cancel the action if needed.
Esc::
ControlSend, , {RIGHT}{Enter}, Confirm ending process?
#IfWinExist
#IfWinExist Confirm to "FORCE" Eject all drives? ; To press NO in the msgbox, so I can cancel the action if needed.
; The ESC trigger from line below CONFLICTS with line 1
Esc::
ControlSend, , {RIGHT}{Enter}, Confirm to "FORCE" Eject all drives?
#IfWinExist