title: keypress and keyup - why is the keyCode different?
body: <p>Related: <a href="https://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion">JavaScript KeyCode vs CharCode</a></p>
  
  <p>Here is some code you can try at home or in a <a href="http://jsfiddle.net/Ralt/7zSUw/4/" rel="noreferrer">jsfiddle</a>:</p>
  
  <pre><code>el.addEventListener( 'keyup', function( e ) { 
      console.log( 'Keyup event' );
      console.log( e.keyCode );
  } ); 
  el.addEventListener( 'keypress', function( e ) { 
      console.log( 'Keypress event' );
      console.log( e.keyCode );
  } );
  </code></pre>
  
  <p>Why is the keyCode different?</p>
  
  <p>I can understand why one should use keypress only, but what I don't understand is how two key events, given the same hit key on the keyboard, give different keyCodes.</p>
  
  <p>PS: I'm not worrying about legacy browsers support, I tried this in Chrome and was surprised, and couldn't find an explanation.</p>