title: Stop page from scrolling when intercepting key presses like space and arrows
body: <p>I'm using JavaScript and Prototype and catching the key presses from the user. I successfully catch return, space and arrows with code like this:</p>
  
  <pre><code>Event.observe(window, "keyup", function(e) {
    switch (e.keyCode) {
      case Event.KEY_RETURN:
      case Event.KEY_RIGHT:
      case 32:  // space
        // do something
        break;
    }
  });
  </code></pre>
  
  <p>My problem is that spaces and arrow keep on scrolling the page. Is there a way to keep them from scrolling the page?</p>