title: How can I prevent the browser's default history back action for the backspace button with JavaScript?
body: <p>Is there a way to prevent the default action from occurring when the user presses backspace in a browser?</p>
  <p>I don't need to prevent the user from leaving, just from having the default backspace action. I need the backspace to do something different (it's a game).</p>
  <p>I tried without success:</p>
  <pre><code>window.addEventListener('keydown', function(e) {
      if (e.keyCode === Game.Key.BACK_SPACE)
      {
          e.preventDefault();
          e.stopPropagation();
          return false;
      }
  }, false);
  </code></pre>
  <p>If I put an alert inside the if, the alert will be shown for backspace key press. So, the keyCode is correct.</p>
  <p>This has to work in Opera 10.6, Firefox 4, Chrome 6, Internet Explorer 9 and Safari 5.</p>