diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-26 22:57:56 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-26 22:57:56 +0100 |
commit | bb7f4e78eca668fdd726dbec01f854cc0843b085 (patch) | |
tree | e174d247db3d9e56c103d155bc1821c2aecbc07d | |
parent | 6f7793ce1a88b330c7c0ee3f555491c862f75e07 (diff) | |
parent | 30a89b58e21fc78fd5a43c49974f4e008bbc0993 (diff) |
Merge pull request #72139 from bruvzg/android_fix_vkb_enter
[Android] Fix virtual keyboard special keys.
-rw-r--r-- | platform/android/android_input_handler.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/platform/android/android_input_handler.cpp b/platform/android/android_input_handler.cpp index 277195a054..17903b3965 100644 --- a/platform/android/android_input_handler.cpp +++ b/platform/android/android_input_handler.cpp @@ -80,7 +80,20 @@ void AndroidInputHandler::process_key_event(int p_physical_keycode, int p_unicod ev.instantiate(); Key physical_keycode = godot_code_from_android_code(p_physical_keycode); - Key keycode = fix_keycode(unicode, physical_keycode); + Key keycode = physical_keycode; + if (unicode == '\b') { // 0x08 + keycode = Key::BACKSPACE; + } else if (unicode == '\t') { // 0x09 + keycode = Key::TAB; + } else if (unicode == '\n') { // 0x0A + keycode = Key::ENTER; + } else if (unicode == 0x1B) { + keycode = Key::ESCAPE; + } else if (unicode == 0x1F) { + keycode = Key::KEY_DELETE; + } else { + keycode = fix_keycode(unicode, physical_keycode); + } switch (physical_keycode) { case Key::SHIFT: { |