title: Combine keypress and keyup - jQuery
body: <p>I'm trying to develop a jQuery plugin to do an action when the user enter a specific keyphrase.</p>
  
  <p>For example, I want to match "HELLO" on keyup.</p>
  
  <pre><code>var controllerKey = [];
  $(window).keyup(function(evt) {
      var code = evt.keyCode ? evt.keyCode : evt.which;
      controllerKey.push(code);
  }
  [...]
  </code></pre>
  
  <p>Then, I compare my controllerKey with my string "HELLO" (thanks to str.charCodeAt()) and some others things but this isn't important here.
  Everything works fine at this point.</p>
  
  <p><strong>My problem</strong> happens when I want to match "HeLLo" (in fact when the string had some <strong>uppercase</strong>). I saw on forums that keyup or keydown don't make any difference.</p>
  
  <p>So I use keypress which manage it very well but keypress doesn't allow me to match arrow keys and so one (in Chrome).</p>
  
  <p><strong>I want to know if it's possible to combine keypress and keyup (only when keypress doesn't match the event).</strong></p>
  
  <p>Thanks in advance.</p>