From c218390864ea106e00632037f97868c21cbe7d2c Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Tue, 30 May 2017 22:27:31 +0200 Subject: InputEvent: Restore old behaviour for matching key events to actions. Original code in 9100db7 --- core/os/input_event.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/os/input_event.cpp') 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 &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() { -- cgit v1.2.3