diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:15:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:15:42 +0100 |
commit | f220d46cdccb15f1aa141cd89c9dacee85b1b6ec (patch) | |
tree | bd02a89eb9942b5e6e6b54335ad750661502bc86 /platform/android/android_keys_utils.cpp | |
parent | 17e7f85c06366b427e5068c5b3e2940e27ff5f1d (diff) | |
parent | 8406e60522bb8d09649193be43c1c819edc1d059 (diff) | |
download | redot-engine-f220d46cdccb15f1aa141cd89c9dacee85b1b6ec.tar.gz |
Merge pull request #80231 from romlok/input-key-location
Support detecting and mapping ctrl/alt/shift/meta by their left/right physical location
Diffstat (limited to 'platform/android/android_keys_utils.cpp')
-rw-r--r-- | platform/android/android_keys_utils.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/android_keys_utils.cpp b/platform/android/android_keys_utils.cpp index f50437e82a..83ee98e8bc 100644 --- a/platform/android/android_keys_utils.cpp +++ b/platform/android/android_keys_utils.cpp @@ -38,3 +38,12 @@ Key godot_code_from_android_code(unsigned int p_code) { } return Key::UNKNOWN; } + +KeyLocation godot_location_from_android_code(unsigned int p_code) { + for (int i = 0; android_godot_location_pairs[i].android_code != AKEYCODE_MAX; i++) { + if (android_godot_location_pairs[i].android_code == p_code) { + return android_godot_location_pairs[i].godot_code; + } + } + return KeyLocation::UNSPECIFIED; +} |