title: jquery: keydown, keyup, small snippet, why isn't this working?
body: <p>Why isn't this working?</p>
  
  <pre><code>var holdingctrl = false;
  $(document).keydown("q",function(e) {
   if(holdingctrl == true) 
   alert("Holding CTRL and pressing Q: Success.");
   e.preventDefault();
  });
  
  $(document).keyup("q",function(e) {
   holdingctrl == false 
  });
  </code></pre>
  
  <p>This example below works just fine, but what am i doing wrong above?</p>
  
  <pre><code>$(document).keyup("q",function(e) {
   alert("ONLY pressing Q: Success.");
  });
  </code></pre>