esc 두번 눌러 창닫기
; Set the time window in milliseconds during which the second
; Esc key press must occur for it to be recognized as a double press.
; Increase or decrease this value as necessary.
doublePressTimeout := 300
; This variable keeps track of the time of the last Esc key press.
lastEscPressTime := 0
; This function is called when the Esc key is pressed.
Esc::
; Get the current time.
currentTime := A_TickCount
; If the time elapsed since the last Esc press is less than the
; double press timeout, it's a double press, so close the active window.
if (currentTime - lastEscPressTime < doublePressTimeout) {
WinClose, A
}
; Otherwise, it's a single press, so send the Esc key.
else {
Send {Esc}
}
; Record the current time as the time of the last Esc press.
lastEscPressTime := currentTime
return