diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-04-05 20:59:35 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-02-25 12:30:33 +0200 |
commit | 1af06d3d4608b17c74caed951cd9579ccbba229d (patch) | |
tree | a0d57c6cd3c00614a5a30290085e91a6097e78b6 /core/bind | |
parent | 376a8255a9b65b016fcd81634bfd54fb7fa029df (diff) |
Rename `scancode` to `keycode`.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
Diffstat (limited to 'core/bind')
-rw-r--r-- | core/bind/core_bind.cpp | 14 | ||||
-rw-r--r-- | core/bind/core_bind.h | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index f5a351f16a..fda97ed9e3 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1113,15 +1113,17 @@ String _OS::get_system_dir(SystemDir p_dir) const { return OS::get_singleton()->get_system_dir(OS::SystemDir(p_dir)); } -String _OS::get_scancode_string(uint32_t p_code) const { +String _OS::get_keycode_string(uint32_t p_code) const { return keycode_get_string(p_code); } -bool _OS::is_scancode_unicode(uint32_t p_unicode) const { + +bool _OS::is_keycode_unicode(uint32_t p_unicode) const { return keycode_has_unicode(p_unicode); } -int _OS::find_scancode_from_string(const String &p_code) const { + +int _OS::find_keycode_from_string(const String &p_code) const { return find_keycode(p_code); } @@ -1312,9 +1314,9 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("native_video_pause"), &_OS::native_video_pause); ClassDB::bind_method(D_METHOD("native_video_unpause"), &_OS::native_video_unpause); - ClassDB::bind_method(D_METHOD("get_scancode_string", "code"), &_OS::get_scancode_string); - ClassDB::bind_method(D_METHOD("is_scancode_unicode", "code"), &_OS::is_scancode_unicode); - ClassDB::bind_method(D_METHOD("find_scancode_from_string", "string"), &_OS::find_scancode_from_string); + ClassDB::bind_method(D_METHOD("get_keycode_string", "code"), &_OS::get_keycode_string); + ClassDB::bind_method(D_METHOD("is_keycode_unicode", "code"), &_OS::is_keycode_unicode); + ClassDB::bind_method(D_METHOD("find_keycode_from_string", "string"), &_OS::find_keycode_from_string); ClassDB::bind_method(D_METHOD("set_use_file_access_save_and_swap", "enabled"), &_OS::set_use_file_access_save_and_swap); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index ae569ea189..85dc00a968 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -253,9 +253,9 @@ public: String get_unique_id() const; - String get_scancode_string(uint32_t p_code) const; - bool is_scancode_unicode(uint32_t p_unicode) const; - int find_scancode_from_string(const String &p_code) const; + String get_keycode_string(uint32_t p_code) const; + bool is_keycode_unicode(uint32_t p_unicode) const; + int find_keycode_from_string(const String &p_code) const; void set_use_file_access_save_and_swap(bool p_enable); |