You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
[3.2] Add keyboard layout enumeration / set / get functions (macOS, Windows, Linux/X11).
This commit is contained in:
@@ -569,6 +569,26 @@ String _OS::get_latin_keyboard_variant() const {
|
||||
}
|
||||
}
|
||||
|
||||
int _OS::keyboard_get_layout_count() const {
|
||||
return OS::get_singleton()->keyboard_get_layout_count();
|
||||
}
|
||||
|
||||
int _OS::keyboard_get_current_layout() const {
|
||||
return OS::get_singleton()->keyboard_get_current_layout();
|
||||
}
|
||||
|
||||
void _OS::keyboard_set_current_layout(int p_index) {
|
||||
OS::get_singleton()->keyboard_set_current_layout(p_index);
|
||||
}
|
||||
|
||||
String _OS::keyboard_get_layout_language(int p_index) const {
|
||||
return OS::get_singleton()->keyboard_get_layout_language(p_index);
|
||||
}
|
||||
|
||||
String _OS::keyboard_get_layout_name(int p_index) const {
|
||||
return OS::get_singleton()->keyboard_get_layout_name(p_index);
|
||||
}
|
||||
|
||||
String _OS::get_model_name() const {
|
||||
|
||||
return OS::get_singleton()->get_model_name();
|
||||
@@ -1323,6 +1343,12 @@ void _OS::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_latin_keyboard_variant"), &_OS::get_latin_keyboard_variant);
|
||||
ClassDB::bind_method(D_METHOD("get_model_name"), &_OS::get_model_name);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("keyboard_get_layout_count"), &_OS::keyboard_get_layout_count);
|
||||
ClassDB::bind_method(D_METHOD("keyboard_get_current_layout"), &_OS::keyboard_get_current_layout);
|
||||
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("can_draw"), &_OS::can_draw);
|
||||
ClassDB::bind_method(D_METHOD("is_userfs_persistent"), &_OS::is_userfs_persistent);
|
||||
ClassDB::bind_method(D_METHOD("is_stdout_verbose"), &_OS::is_stdout_verbose);
|
||||
|
||||
Reference in New Issue
Block a user