diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/samsungtv/events.cpp | 11 | ||||
-rw-r--r-- | backends/platform/samsungtv/graphics.cpp | 13 | ||||
-rw-r--r-- | backends/platform/samsungtv/sdl.h | 1 |
3 files changed, 23 insertions, 2 deletions
diff --git a/backends/platform/samsungtv/events.cpp b/backends/platform/samsungtv/events.cpp index 1363fa3f19..3b19b41c8e 100644 --- a/backends/platform/samsungtv/events.cpp +++ b/backends/platform/samsungtv/events.cpp @@ -29,6 +29,15 @@ #if defined(SAMSUNGTV) +void OSystem_SDL_SamsungTV::generateMouseMoveEvent(int x, int y) { + SDL_Event event; + memset(&event, 0, sizeof(event)); + event.type = SDL_MOUSEMOTION; + event.motion.x = x; + event.motion.y = y; + SDL_PushEvent(&event); +} + void OSystem_SDL_SamsungTV::handleKbdMouse() { uint32 curTime = getMillis(); if (curTime >= _km.last_time + _km.delay_time) { @@ -93,7 +102,7 @@ void OSystem_SDL_SamsungTV::handleKbdMouse() { _km.y_down_count = 1; } - setMousePos(_km.x, _km.y); + generateMouseMoveEvent(_km.x, _km.y); } } } diff --git a/backends/platform/samsungtv/graphics.cpp b/backends/platform/samsungtv/graphics.cpp index 79267b8628..8a08f8a28e 100644 --- a/backends/platform/samsungtv/graphics.cpp +++ b/backends/platform/samsungtv/graphics.cpp @@ -542,8 +542,19 @@ void OSystem_SDL_SamsungTV::setFullscreenMode(bool enable) { } void OSystem_SDL_SamsungTV::warpMouse(int x, int y) { - if (_mouseCurState.x != x || _mouseCurState.y != y) + int y1 = y; + + if (_videoMode.aspectRatioCorrection && !_overlayVisible) + y1 = real2Aspect(y); + + if (_mouseCurState.x != x || _mouseCurState.y != y) { + if (!_overlayVisible) + generateMouseMoveEvent(x * _videoMode.scaleFactor, y1 * _videoMode.scaleFactor); + else + generateMouseMoveEvent(x, y1); + setMousePos(x, y); + } } void OSystem_SDL_SamsungTV::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { diff --git a/backends/platform/samsungtv/sdl.h b/backends/platform/samsungtv/sdl.h index c08cdca69a..aebf7296c7 100644 --- a/backends/platform/samsungtv/sdl.h +++ b/backends/platform/samsungtv/sdl.h @@ -96,6 +96,7 @@ protected: void setFullscreenMode(bool enable); void handleKbdMouse(); + void generateMouseMoveEvent(int x, int y); virtual bool remapKey(SDL_Event &ev, Common::Event &event); }; |