summaryrefslogtreecommitdiffstats
path: root/core/os/input_event.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-07-28 09:48:44 +0200
committerGitHub <noreply@github.com>2018-07-28 09:48:44 +0200
commite6aec27428400d35c6d431044ae0b5e6c9649d53 (patch)
tree1e9cf14e00eeb68488609360a7d68bc09a1fdcd8 /core/os/input_event.cpp
parent66429a1576402376c5e0a4c0ecce113904a98d49 (diff)
parentc2be1a75a0b93c2a0f8ec7c4df7f125d1a53eca4 (diff)
downloadredot-engine-e6aec27428400d35c6d431044ae0b5e6c9649d53.tar.gz
Merge pull request #20511 from maksloboda/InputEventActionFix
Fixed shortcuts not working with InputEventActions
Diffstat (limited to 'core/os/input_event.cpp')
-rw-r--r--core/os/input_event.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index e94ccb4f48..12c6ef7d3b 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -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;