title: Keypress event if NOT input
body: <p>I have the following jQuery events in my site</p>
  
  <pre><code>    $(window).keyup (function(event) {
          switch (event.keyCode) {
              case 68:  // Alt-N = next
                  scroll ('next');
                  break;
              case 65:  // Alt-P = prev
                  scroll ('prev');
                  break;
  
          }
  
  });
  
  });
  
   &lt;script&gt;
      $(document).keydown(function(e) {
      if(e.keyCode==68){
          window.location.href = "{PreviousPost}";
      }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>I'm using window and document because they both work and searching didn't result in me finding out what the difference is in terms of functionality. But anyway, what I'm wondering is how to keep the functions from firing, when it's in an input field. Cause it works and everything, but I don't want the event to fire when the user is typing only when they press the keys and are ... not typing.</p>
  
  <p>It seems simple, but I really searched. Kept giving me results from other issues. </p>