title: jQuery: trigger keypress function on entire document but not inside inputs and textareas?
body: <p>I have this …</p>
  
  <pre><code>$(document).keypress(function(e) {
          if ( e.keyCode === 119 ) // w
              doSomething();
      });
  </code></pre>
  
  <p>Wo when pressing "w" on my document the <code>doSomething()</code> function fires. How can I prevent it from firing when I'm currently typing (in focus) in an <code>input</code> field or <code>textarea</code>?</p>