summaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/os')
-rw-r--r--src/os/windows/win32.cpp12
-rw-r--r--src/os/windows/win32.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 54c5c9cd3..39203cbca 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -28,14 +28,16 @@
#include <sys/stat.h>
static bool _has_console;
+static bool _cursor_disable = true;
+static bool _cursor_visible = true;
-static bool cursor_visible = true;
-
-bool MyShowCursor(bool show)
+bool MyShowCursor(bool show, bool toggle)
{
- if (cursor_visible == show) return show;
+ if (toggle) _cursor_disable = !_cursor_disable;
+ if (_cursor_disable) return show;
+ if (_cursor_visible == show) return show;
- cursor_visible = show;
+ _cursor_visible = show;
ShowCursor(show);
return !show;
diff --git a/src/os/windows/win32.h b/src/os/windows/win32.h
index 19f04d1f2..66c519973 100644
--- a/src/os/windows/win32.h
+++ b/src/os/windows/win32.h
@@ -13,7 +13,7 @@
#define WIN32_H
#include <windows.h>
-bool MyShowCursor(bool show);
+bool MyShowCursor(bool show, bool toggle = false);
typedef void (*Function)(int);
bool LoadLibraryList(Function proc[], const char *dll);