[frontend][html] Fixes keyboard support

Keyboard support was very buggy because it used to rely 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.