[frontend][html] Fixes keyboard support

Keyboard support was very buggy because it relied on `event.keyCode`. The keycode depends on the keyboard layout.

I changed this behaviour to use `event.key` instead. This variable contains the char produced by the keyboard event or the keyname. It's much more reliable.
Can we use [`reflect`](http://golang.org/pkg/reflect/) to get the type names, rather than this manual lookup?