mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Fixed shortcuts not working with InputEventActions
This commit is contained in:
parent
25f1833890
commit
c2be1a75a0
@ -937,6 +937,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;
|
||||
|
@ -467,6 +467,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user