Merge pull request #20511 from maksloboda/InputEventActionFix

Fixed shortcuts not working with InputEventActions
This commit is contained in:
Rémi Verschelde 2018-07-28 09:48:44 +02:00 committed by GitHub
commit e6aec27428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -949,6 +949,14 @@ bool InputEventAction::is_pressed() const {
return pressed;
}
bool InputEventAction::shortcut_match(const Ref<InputEvent> &p_event) const {
Ref<InputEventKey> event = p_event;
if (event.is_null())
return false;
return event->is_action(action);
}
bool InputEventAction::is_action(const StringName &p_action) const {
return action == p_action;

View File

@ -480,6 +480,7 @@ public:
virtual bool is_action(const StringName &p_action) const;
virtual bool shortcut_match(const Ref<InputEvent> &p_event) const;
virtual bool is_action_type() const { return true; }
virtual String as_text() const;