title: onkeyup and onkeydown not catching anything
body: <p>Can someone tell me whats going on? My console isn't throwing any exceptions.</p>
  
  <pre><code>    function onKeyDown(){
                      var e = event.keyCode;
  
                      //if (e==87 /*w*/){
                          up = true;
                          throw('up'); 
                      //}
  
                      if (e==65 /*a*/){
                          left = true;
                      }
  
                      if (e==83 /*s*/){
                          down = true;
                      }
  
                      if (e==68 /*d*/){
                          right = true;
                      }
                  }
  
                  function onKeyUp(){
                      var e = event.keyCode;
  
                      //if (e==87 /*w*/){
                          up = false;
                          throw('up'); 
                      //}
  
                      if (e==65 /*a*/){
                          left = false;
                      }
  
                      if (e==83 /*s*/){
                          down = false;
                      }
  
                      if (e==68 /*d*/){
                          right = false;
                      }
                  }
  
  Okay, so that was the javascript, and this is the html:
  
      &lt;body&gt;
              &lt;input id="ss" type="button" value="start/stop" /&gt;
              &lt;div id="container" style="border:1px solid; cursor:none; width:480px; height:320px;"&gt;
                  &lt;canvas id="canvas" width="480" height="320"  onkeyup="onKeyUp();" onkeydown="onKeydown();"&gt;
                      Canvas not displaying.
                  &lt;/canvas&gt;
              &lt;/div&gt;
          &lt;/body&gt;
  
  
  
  Edit: current code:
  </code></pre>
  
  <p>window.onload = function(){
                  init();
              };</p>
  
  <pre><code>function init(){
                  initSettings();
                  initImages();
  
                  document.getElementById('canvas').onkeydown = function(event) {
                      var e = event.keyCode;
  
                      //if (e==87 /*w*/){
                          up = true;
                          throw('up'); 
                      //}
  
                      if (e==65 /*a*/){
                          left = true;
                      }
  
                      if (e==83 /*s*/){
                          down = true;
                      }
  
                      if (e==68 /*d*/){
                          right = true;
                      }
                  }
  </code></pre>