Commit 0a35b97b by Fabio Alessandrelli

Swtich HTML5 key detection from keyCode to code.

The value of this, does not include the layout. The code has extra logic to map the unicode value to our keylist, supporting ASCII and Latin-1. Also add support for `physical_keycode` in HTML5 platform.
parent c0ff2a38
......@@ -143,8 +143,8 @@ static Ref<InputEventKey> setup_key_event(const EmscriptenKeyboardEvent *emscrip
ev.instance();
ev->set_echo(emscripten_event->repeat);
dom2godot_mod(emscripten_event, ev);
ev->set_keycode(dom2godot_keycode(emscripten_event->keyCode));
ev->set_physical_keycode(dom2godot_keycode(emscripten_event->keyCode));
ev->set_keycode(dom_code2godot_scancode(emscripten_event->code, emscripten_event->key, false));
ev->set_physical_keycode(dom_code2godot_scancode(emscripten_event->code, emscripten_event->key, true));
String unicode = String::utf8(emscripten_event->key);
// Check if empty or multi-character (e.g. `CapsLock`).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment