title: chrome extension : How to get key events
body: <p>Is there any way to get key events in a google chrome extension file - <code>background.html</code> - ?</p>
  
  <pre><code>document.onkeydown = function() {
    alert('test)
  };
  </code></pre>
  
  <p>Previous code doesn't work.</p>