summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/os')
-rw-r--r--core/os/keyboard.cpp21
-rw-r--r--core/os/keyboard.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp
index 4c0a074a07..9710638234 100644
--- a/core/os/keyboard.cpp
+++ b/core/os/keyboard.cpp
@@ -429,6 +429,27 @@ static const _KeyCodeReplace _keycode_replace_neo[]={
{0,0}
};
+int keycode_get_count() {
+
+ const _KeyCodeText *kct =&_keycodes[0];
+
+ int count=0;
+ while(kct->text) {
+
+ count++;
+ kct++;
+ }
+ return count;
+}
+
+int keycode_get_value_by_index(int p_index) {
+ return _keycodes[p_index].code;
+}
+
+const char* keycode_get_name_by_index(int p_index) {
+ return _keycodes[p_index].text;
+}
+
int latin_keyboard_keycode_convert(int p_keycode) {
diff --git a/core/os/keyboard.h b/core/os/keyboard.h
index 80472acc09..fd52d331c8 100644
--- a/core/os/keyboard.h
+++ b/core/os/keyboard.h
@@ -328,6 +328,9 @@ enum KeyModifierMask {
String keycode_get_string(uint32_t p_code);
bool keycode_has_unicode(uint32_t p_unicode);
int find_keycode(const String& p_code);
+int keycode_get_count();
+int keycode_get_value_by_index(int p_index);
+const char* keycode_get_name_by_index(int p_index);
int latin_keyboard_keycode_convert(int p_keycode);
#endif