InputEvent: Restore old behaviour for matching key events to actions.

Original code in 9100db7
This commit is contained in:
Andreas Haas 2017-05-30 22:27:31 +02:00
parent 5567e898d1
commit c218390864
No known key found for this signature in database
GPG Key ID: B5FFAE1B65FBD2E1
1 changed files with 4 additions and 1 deletions

View File

@ -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() {