evanw/rapt — pull request #10 by mildmojo (2013-02-11 04:04:51+00:00)
Title: Fix keyboard input bugs

When using keyboard input, HTML5 apps need to call `e.preventDefault()` and `e.stopPropagation()` to keep key events from bubbling up to the browser and triggering built-in shortcuts. Particularly noticeable in browsers with typeahead find, where
pressing any key focuses the find-in-page search box.

To reproduce the bug without this patch (in any version of Firefox):

1. Open `about:config`.
2. Toggle `accessibility.typeaheadfind` to `true`.
3. Open [RAPT](http://raptjs.com) and try using W/A/S/D. Typeahead find will steal focus after the first keydown, absorbing all further keydown events and making the game unplayable.