diff options
| author | Blazej Floch | 2018-02-11 06:08:37 -0500 |
|---|---|---|
| committer | Blazej Floch | 2018-05-07 23:17:06 -0400 |
| commit | c45f44d85635a1d16a93c00cd8cb17f60dfa6336 (patch) | |
| tree | 72075a2ec56dda5d512885e19b28295dbecf7b48 /platform | |
| parent | 9b1fdad035f226bb7eba3e592083fc40a9e1ab27 (diff) | |
| download | godot-c45f44d85635a1d16a93c00cd8cb17f60dfa6336.tar.gz godot-c45f44d85635a1d16a93c00cd8cb17f60dfa6336.tar.zst godot-c45f44d85635a1d16a93c00cd8cb17f60dfa6336.zip | |
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/windows/os_windows.cpp | 19 | ||||
| -rw-r--r-- | platform/windows/os_windows.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index bed5781ae..7b46608c5 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -152,6 +152,25 @@ void RedirectIOToConsole() { // point to console as well } +BOOL WINAPI HandlerRoutine(_In_ DWORD dwCtrlType) { + if (ScriptDebugger::get_singleton() == NULL) + return FALSE; + + switch (dwCtrlType) { + case CTRL_C_EVENT: + ScriptDebugger::get_singleton()->set_depth(-1); + ScriptDebugger::get_singleton()->set_lines_left(1); + return TRUE; + default: + return FALSE; + } +} + +void OS_Windows::initialize_debugging() { + + SetConsoleCtrlHandler(HandlerRoutine, TRUE); +} + void OS_Windows::initialize_core() { crash_handler.initialize(); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 3d13627bf..584f6fb33 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -294,6 +294,7 @@ public: void disable_crash_handler(); bool is_disable_crash_handler() const; + virtual void initialize_debugging(); void force_process_input(); |
