diff options
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/file_access.cpp | 1 | ||||
-rw-r--r-- | core/os/input_event.cpp | 8 | ||||
-rw-r--r-- | core/os/input_event.h | 3 | ||||
-rw-r--r-- | core/os/os.cpp | 7 | ||||
-rw-r--r-- | core/os/os.h | 2 |
5 files changed, 18 insertions, 3 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 3eac4428da..59f07c03e7 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -270,7 +270,6 @@ String FileAccess::get_token() const { c = get_8(); } - token += '0'; return String::utf8(token.get_data()); } 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..8732c7e377 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -31,9 +31,9 @@ #ifndef INPUT_EVENT_H #define INPUT_EVENT_H -#include "math_2d.h" #include "os/copymem.h" #include "resource.h" +#include "transform_2d.h" #include "typedefs.h" #include "ustring.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; diff --git a/core/os/os.h b/core/os/os.h index dd783408e8..12c0222ad4 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -254,7 +254,7 @@ public: virtual String get_executable_path() const; virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false) = 0; - virtual Error kill(const ProcessID &p_pid) = 0; + virtual Error kill(const ProcessID &p_pid, const int p_max_wait_msec = -1) = 0; virtual int get_process_id() const; virtual Error shell_open(String p_uri); |