summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-06-08 07:43:18 +0200
committerGitHub <noreply@github.com>2017-06-08 07:43:18 +0200
commitb52466f79353e10a7984c835576a67502631b27e (patch)
tree5311e3cf2f20da9fdf04d997c0fcb00a7597dd8f /core/os
parentbee81d52148baf01cd15f9d79dba35bcffdc2fe6 (diff)
parentc218390864ea106e00632037f97868c21cbe7d2c (diff)
Merge pull request #9002 from Hinsbart/key_action_match
InputEvent: Restore old behaviour for matching key events to actions.
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 f96e08f479..dbdf9628e3 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() {