Detect a key double press

~Esc::
if (A_PriorHotkey <> A_ThisHotkey or A_TimeSincePriorHotkey > 400)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, Esc
    return
}
WinMinimize, A    ; Assign a hotkey to minimize the active window.
;another example ↓ using to quick close the application
;Run, cmd /c TASKKILL /IM chrome.exe
return

keyboard shortcuts - Detect a double key press in AutoHotkey - Stack Overflow