summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/os_android.h2
-rw-r--r--platform/flash/os_flash.h1
-rw-r--r--platform/iphone/os_iphone.h2
-rw-r--r--platform/javascript/os_javascript.h1
-rw-r--r--platform/osx/os_osx.h2
-rw-r--r--platform/osx/os_osx.mm14
-rw-r--r--platform/server/os_server.h2
-rw-r--r--platform/windows/os_windows.cpp10
-rw-r--r--platform/windows/os_windows.h1
-rw-r--r--platform/winrt/os_winrt.h2
-rw-r--r--platform/x11/os_x11.cpp16
-rw-r--r--platform/x11/os_x11.h1
12 files changed, 50 insertions, 4 deletions
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index e9b0d00196..dcaa1db654 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -39,7 +39,7 @@
#include "servers/physics_2d/physics_2d_server_sw.h"
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
#include "servers/visual/rasterizer.h"
-
+#include "main/input_default.h"
//#ifdef USE_JAVA_FILE_ACCESS
diff --git a/platform/flash/os_flash.h b/platform/flash/os_flash.h
index 42ae3f0718..c8013df2f2 100644
--- a/platform/flash/os_flash.h
+++ b/platform/flash/os_flash.h
@@ -11,6 +11,7 @@
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
#include "servers/audio/audio_server_sw.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
+#include "main/input_default.h"
class OSFlash : public OS_Unix {
diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h
index 844f067552..de167dd309 100644
--- a/platform/iphone/os_iphone.h
+++ b/platform/iphone/os_iphone.h
@@ -43,9 +43,11 @@
#include "servers/audio/sample_manager_sw.h"
#include "servers/spatial_sound/spatial_sound_server_sw.h"
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
+#include "main/input_default.h"
#include "game_center.h"
#include "in_app_store.h"
+
class AudioDriverIphone;
class RasterizerGLES2;
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index d52c465c71..5f671d45c7 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -40,6 +40,7 @@
#include "servers/visual/rasterizer.h"
#include "audio_server_javascript.h"
#include "audio_driver_javascript.h"
+#include "main/input_default.h"
typedef void (*GFXInitFunc)(void *ud,bool gl2,int w, int h, bool fs);
typedef int (*OpenURIFunc)(const String&);
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
diff --git a/platform/server/os_server.h b/platform/server/os_server.h
index 4e7721f068..b3410f7955 100644
--- a/platform/server/os_server.h
+++ b/platform/server/os_server.h
@@ -30,7 +30,7 @@
#define OS_SERVER_H
-#include "os/input.h"
+#include "main/input_default.h"
#include "drivers/unix/os_unix.h"
#include "servers/visual_server.h"
#include "servers/visual/rasterizer.h"
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 87d9a43d8c..438a5a6903 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -323,11 +323,21 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
old_invalid=true;
outside=true;
+ if (main_loop && mouse_mode!=MOUSE_MODE_CAPTURED)
+ main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT);
+ if (input)
+ input->set_mouse_in_window(false);
} break;
case WM_MOUSEMOVE: {
if (outside) {
+ //mouse enter
+
+ if (main_loop && mouse_mode!=MOUSE_MODE_CAPTURED)
+ main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
+ if (input)
+ input->set_mouse_in_window(true);
CursorShape c=cursor_shape;
cursor_shape=CURSOR_MAX;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index cce94f5b25..026b50c33d 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -47,6 +47,7 @@
#include "servers/physics_2d/physics_2d_server_sw.h"
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
+#include "main/input_default.h"
#include <windows.h>
diff --git a/platform/winrt/os_winrt.h b/platform/winrt/os_winrt.h
index b69feccae9..5719426f9f 100644
--- a/platform/winrt/os_winrt.h
+++ b/platform/winrt/os_winrt.h
@@ -50,6 +50,8 @@
#include <fcntl.h>
#include <stdio.h>
+#include "main/input_default.h"
+
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 51f4392eb4..482e4d7159 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1181,8 +1181,22 @@ void OS_X11::process_xevents() {
XVisibilityEvent * visibility = (XVisibilityEvent *)&event;
minimized = (visibility->state == VisibilityFullyObscured);
} break;
+ case LeaveNotify: {
- case FocusIn:
+ if (main_loop && mouse_mode!=MOUSE_MODE_CAPTURED)
+ main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT);
+ if (input)
+ input->set_mouse_in_window(false);
+
+ } break;
+ case EnterNotify: {
+
+ if (main_loop && mouse_mode!=MOUSE_MODE_CAPTURED)
+ main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
+ if (input)
+ input->set_mouse_in_window(true);
+ } break;
+ case FocusIn:
minimized = false;
#ifdef NEW_WM_API
if(current_videomode.fullscreen) {
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 12f0aec611..95857c0344 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -46,6 +46,7 @@
#include "drivers/pulseaudio/audio_driver_pulseaudio.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
+#include "main/input_default.h"
#include <X11/keysym.h>
#include <X11/Xlib.h>