summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2021-10-19 22:19:41 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2021-10-19 22:19:41 +0300
commita975682ef62875837c440b30ed17c389321c5597 (patch)
treeb0724fd878ac63a21b7f93dd822cd9b969741085
parenta4fbb67902f493bff503dafd0ccc6277af85f3a1 (diff)
Fix handling multiple "physical key" events in the single input map action.
-rw-r--r--core/input/input_event.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index 1d2b5f19ee..c6448b1e44 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -452,8 +452,13 @@ bool InputEventKey::is_match(const Ref<InputEvent> &p_event, bool p_exact_match)
return false;
}
- return keycode == key->keycode &&
- (!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
+ if (keycode == 0) {
+ return physical_keycode == key->physical_keycode &&
+ (!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
+ } else {
+ return keycode == key->keycode &&
+ (!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
+ }
}
void InputEventKey::_bind_methods() {