diff options
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r-- | platform/osx/os_osx.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index abfe42beda..4990d04ab6 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 @@ -1240,6 +1254,11 @@ Error OS_OSX::shell_open(String p_uri) { return OK; } +String OS_OSX::get_locale() const { + NSString* preferredLang = [[NSLocale preferredLanguages] objectAtIndex:0]; + return [preferredLang UTF8String]; +} + void OS_OSX::swap_buffers() { [context flushBuffer]; |