kripken/emscripten — pull request #1524 by inolen (2013-08-15 18:10:21+00:00)
Title: pass in modified character to SDL keydown events

Hopefully this is explained fairly well in the comments.

SDL expects a modified unicode character to be passed to its keydown events. Unfortunately, the browser APIs only provide a charCode property on keypress events, so this patch backfills our internal keydown events with their subsequent keypress event's charCode.

I'd started modifying the test to check the unicode property, but then I realized that it's not compatible across regions so I'm not really sure how to test this. I left in my modified test however as I felt the use of asserts is a bit more obvious than the clever use of prime numbers (also, it's kind of hard to extend the test as is).