title: hook into emacs escape key press
body: <p>How can I hook into escape key press?</p>
  
  <p>Reason I want to do this is, for example, I sometimes press:</p>
  
  <pre><code>&lt;escape&gt; &lt;escape&gt; &lt;escape&gt; C-h e
  </code></pre>
  
  <p>and sometimes I may end up pressing:</p>
  
  <pre><code>&lt;escape&gt; &lt;escape&gt; &lt;escape&gt; &lt;escape&gt; C-h e
  </code></pre>
  
  <p>by mistake and that will do what C-M-h does and surprise me. What C-M-h does is so drastic that I would notice it and undo, but what if there is some keystroke that if preceded by four escapes does something that is not noticeable to me and so I don't get to undo it?</p>
  
  <p>One way to prevent such incidents would be to have buffer background color change to yellow on first press of escape, green on second press, and back to original background color on third, and so on periodically. It would give me a visual feedback when I press the wrong number of escapes. The keystroke echos on the echo area is not noticeable when I am pressing a lot of keystrokes quickly.</p>