summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/os')
-rw-r--r--core/os/input_event.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 7ec76c1eed..0d727f4bcb 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -282,7 +282,10 @@ bool InputEventKey::action_match(const Ref<InputEvent> &p_event) const {
if (key.is_null())
return false;
- return get_scancode_with_modifiers() == key->get_scancode_with_modifiers();
+ uint32_t code = get_scancode_with_modifiers();
+ uint32_t event_code = key->get_scancode_with_modifiers();
+
+ return get_scancode() == key->get_scancode() && (!key->is_pressed() || (code & event_code) == code);
}
void InputEventKey::_bind_methods() {