summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/os')
-rw-r--r--core/os/input_event.cpp8
-rw-r--r--core/os/input_event.h1
-rw-r--r--core/os/os.cpp7
3 files changed, 16 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;
diff --git a/core/os/input_event.h b/core/os/input_event.h
index 04126fee77..07df81488b 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -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;
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 8dcf0990fc..97dae05919 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -577,6 +577,13 @@ bool OS::has_feature(const String &p_feature) {
if (p_feature == "release")
return true;
#endif
+#ifdef TOOLS_ENABLED
+ if (p_feature == "editor")
+ return true;
+#else
+ if (p_feature == "standalone")
+ return true;
+#endif
if (sizeof(void *) == 8 && p_feature == "64") {
return true;