emscripten keyboard support

This fixes a bug in emscripten project. Now samples work