summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-09-24 18:06:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-09-24 18:06:15 -0300
commit82a3304458738b410a5aff8994ce587413aeb464 (patch)
treeb54672bc649a80ebbe1e11b0488c7dfdc6c109e7 /platform/osx
parent59e1ad27731e66c58a3d5ee9d783eac74a1d48d9 (diff)
Added ability to set custom mouse cursors. Not hardware accelerated yet.
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/os_osx.h2
-rw-r--r--platform/osx/os_osx.mm14
2 files changed, 15 insertions, 1 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index 869997f190..49fa6c0862 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -32,7 +32,7 @@
#include "os/input.h"
#include "drivers/unix/os_unix.h"
-
+#include "main/input_default.h"
#include "servers/visual_server.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual/rasterizer.h"
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index abfe42beda..b0ce37cecf 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -512,12 +512,26 @@ static int button_mask=0;
- (void)mouseExited:(NSEvent *)event
{
+ if (!OS_OSX::singleton)
+ return;
+
+ if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED)
+ OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT);
+ if (OS_OSX::singleton->input)
+ OS_OSX::singleton->input->set_mouse_in_window(false);
// _glfwInputCursorEnter(window, GL_FALSE);
}
- (void)mouseEntered:(NSEvent *)event
{
// _glfwInputCursorEnter(window, GL_TRUE);
+ if (!OS_OSX::singleton)
+ return;
+ if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED)
+ OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
+ if (OS_OSX::singleton->input)
+ OS_OSX::singleton->input->set_mouse_in_window(true);
+
}
- (void)viewDidChangeBackingProperties