mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 16:33:30 +00:00
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.
(cherry picked from commit 0a35b97b62
with help of https://github.com/Faless/godot/tree/js/keyCode)
This commit is contained in:
parent
0db5315f8a
commit
8b321354d8
2 changed files with 185 additions and 335 deletions
|
|
@ -251,7 +251,7 @@ static Ref<InputEventKey> setup_key_event(const EmscriptenKeyboardEvent *emscrip
|
|||
ev.instance();
|
||||
ev->set_echo(emscripten_event->repeat);
|
||||
dom2godot_mod(emscripten_event, ev);
|
||||
ev->set_scancode(dom2godot_scancode(emscripten_event->keyCode));
|
||||
ev->set_scancode(dom_code2godot_scancode(emscripten_event->code, emscripten_event->key));
|
||||
|
||||
String unicode = String::utf8(emscripten_event->key);
|
||||
// Check if empty or multi-character (e.g. `CapsLock`).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue