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
commit e2b66cacf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 736 additions and 299 deletions

View file

@ -1873,11 +1873,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (!orthogonal && ED_IS_SHORTCUT("spatial_editor/freelook_toggle", p_event)) {
set_freelook_active(!is_freelook_active());
} else if (k->get_scancode() == KEY_ESCAPE) {
} else if (k->get_keycode() == KEY_ESCAPE) {
set_freelook_active(false);
}
if (k->get_scancode() == KEY_SPACE) {
if (k->get_keycode() == KEY_SPACE) {
if (!k->is_pressed()) emit_signal("toggle_maximize_view", this);
}
}
@ -2074,8 +2074,8 @@ static bool is_shortcut_pressed(const String &p_path) {
return false;
}
const Input &input = *Input::get_singleton();
int scancode = k->get_scancode();
return input.is_key_pressed(scancode);
int keycode = k->get_keycode();
return input.is_key_pressed(keycode);
}
void SpatialEditorViewport::_update_freelook(real_t delta) {