added emscripten keyboard support
Re-use SAFE_HEAP option in emscripten.
Merge pull request #3224 from azmeuk/emscripten

emscripten keyboard support