1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Backport: Allow for mapping scancodes to current layout

Co-authored-by: Frixuu <kontakt@lukasz.xyz>
This commit is contained in:
bruvzg
2021-12-17 12:39:40 +02:00
parent 9c04c75e7d
commit b4ec1c5817
15 changed files with 255 additions and 135 deletions

View File

@@ -572,6 +572,10 @@ String _OS::keyboard_get_layout_name(int p_index) const {
return OS::get_singleton()->keyboard_get_layout_name(p_index);
}
uint32_t _OS::keyboard_get_scancode_from_physical(uint32_t p_scancode) const {
return OS::get_singleton()->keyboard_get_scancode_from_physical(p_scancode);
}
String _OS::get_model_name() const {
return OS::get_singleton()->get_model_name();
}
@@ -1354,6 +1358,7 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("keyboard_set_current_layout", "index"), &_OS::keyboard_set_current_layout);
ClassDB::bind_method(D_METHOD("keyboard_get_layout_language", "index"), &_OS::keyboard_get_layout_language);
ClassDB::bind_method(D_METHOD("keyboard_get_layout_name", "index"), &_OS::keyboard_get_layout_name);
ClassDB::bind_method(D_METHOD("keyboard_get_scancode_from_physical", "scancode"), &_OS::keyboard_get_scancode_from_physical);
ClassDB::bind_method(D_METHOD("can_draw"), &_OS::can_draw);
ClassDB::bind_method(D_METHOD("is_userfs_persistent"), &_OS::is_userfs_persistent);