title: Detect a double key press in AutoHotkey
body: <p>I'd like to trigger an event in AutoHotkey when the user double "presses" the <kbd>esc</kbd> key. But let the escape keystroke go through to the app in focus if it's not a double press (say within the space of a second).</p>
  
  <p>How would I go about doing this? </p>
  
  <p>I've come up with this so far, but I can't work out how to check for the second escape key press:</p>
  
  <pre><code>~Esc::
  
      Input, TextEntry1, L1 T1
      endKey=%ErrorLevel%
  
      if( endKey != "Timeout" )
      {
          ; perform my double press operation
          WinMinimize, A
      }
  return
  </code></pre>