1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes

Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
This commit is contained in:
Rémi Verschelde
2020-03-01 23:00:42 +01:00
committed by GitHub
78 changed files with 736 additions and 299 deletions

View File

@@ -163,7 +163,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
handled = true;
}
if (k->get_scancode_with_modifiers() == (KEY_MASK_CMD | KEY_F)) {
if (k->get_keycode_with_modifiers() == (KEY_MASK_CMD | KEY_F)) {
_focus_current_search_box();
handled = true;
}
@@ -317,10 +317,10 @@ void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event;
if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) {
if (k.is_valid() && k->is_pressed() && k->get_keycode() != 0) {
last_wait_for_key = k;
const String str = keycode_get_string(k->get_scancode_with_modifiers());
const String str = keycode_get_string(k->get_keycode_with_modifiers());
press_a_key_label->set_text(str);
press_a_key->accept_event();
@@ -334,7 +334,7 @@ void EditorSettingsDialog::_press_a_key_confirm() {
Ref<InputEventKey> ie;
ie.instance();
ie->set_scancode(last_wait_for_key->get_scancode());
ie->set_keycode(last_wait_for_key->get_keycode());
ie->set_shift(last_wait_for_key->get_shift());
ie->set_control(last_wait_for_key->get_control());
ie->set_alt(last_wait_for_key->get_alt());