title: Onkeydown event firing in IE and Chrome but not FireFox
body: <p>Why does my keyboard interactivity code function properly in IE and Chrome, but not FireFox? The full code is at <a href="http://sgdk2.enigmadream.com/ben/Html5Sample.html" rel="nofollow">http://sgdk2.enigmadream.com/ben/Html5Sample.html</a>.  Feel free to download and edit the file locally to test corrections (please do in the interest of skipping over wrong answers to the right answer :) ). It's entirely self-contained 100% in the one HTML file.</p>
  
  <p>For your convenience, here, I believe, is all the code involved:</p>
  
  <pre><code>var keyboardState;
  keyboardState = new Object();
  keyboardState.key= { None:0, Enter:13, Shift:16,
  /* etc... */};
  
  keyboardState.keyState = new Array();
  keyboardState.handleKeyDown = function(e) {
     e = e || window.event;
     keyboardState.keyState[e.keyCode] = true;
  };
  
  
  keyboardState.handleKeyUp = function(e) {
     e = e || window.event;
     keyboardState.keyState[e.keyCode] = false;
  };
  
  keyboardState.isKeyPressed = function(key) { return keyboardState.keyState[key]; };
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;body class="unselectable" unselectable="on"
   onkeydown="keyboardState.handleKeyDown(event)"
   onkeyup="keyboardState.handleKeyUp(event)"&gt;
  </code></pre>
  
  <p>It seems that handleKeyDown is not even firing, if I'm debugging this right.  This must be pretty close to correct because it works fine in IE and Chrome.</p>