Fix handling multiple "physical key" events in the single input map action.

This commit is contained in:
bruvzg 2021-10-19 22:19:13 +03:00
parent da5c843bd1
commit b97ca39360

View File

@ -329,9 +329,14 @@ bool InputEventKey::shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_
return false;
}
if (scancode == 0) {
return physical_scancode == key->physical_scancode &&
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
} else {
return scancode == key->scancode &&
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
}
}
void InputEventKey::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventKey::set_pressed);