From ec9c000be945b8d0500fc7b751fee081aa23c13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:38:09 +0200 Subject: [PATCH] Fix scrolling in scroll containers (#14702) --- irr/include/IEventReceiver.h | 1 - irr/src/CIrrDeviceOSX.mm | 2 ++ irr/src/CIrrDeviceSDL.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/irr/include/IEventReceiver.h b/irr/include/IEventReceiver.h index e0660a6f1..cf7dee3ab 100644 --- a/irr/include/IEventReceiver.h +++ b/irr/include/IEventReceiver.h @@ -331,7 +331,6 @@ struct SEvent //! A bitmap of button states. You can use isButtonPressed() to determine //! if a button is pressed or not. - //! Currently only valid if the event was EMIE_MOUSE_MOVED u32 ButtonStates; //! Is the left button pressed down? diff --git a/irr/src/CIrrDeviceOSX.mm b/irr/src/CIrrDeviceOSX.mm index 8e4843441..67c0ce05c 100644 --- a/irr/src/CIrrDeviceOSX.mm +++ b/irr/src/CIrrDeviceOSX.mm @@ -852,6 +852,7 @@ bool CIrrDeviceMacOSX::run() ievent.MouseInput.Wheel *= 10.0f; else ievent.MouseInput.Wheel *= 5.0f; + ievent.MouseInput.ButtonStates = MouseButtonStates; postMouseEvent(event, ievent); break; @@ -1048,6 +1049,7 @@ void CIrrDeviceMacOSX::storeMouseLocation() ievent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; ievent.MouseInput.X = x; ievent.MouseInput.Y = y; + ievent.MouseInput.ButtonStates = MouseButtonStates; postEventFromUser(ievent); } } diff --git a/irr/src/CIrrDeviceSDL.cpp b/irr/src/CIrrDeviceSDL.cpp index 6f2772aa6..c01e6900e 100644 --- a/irr/src/CIrrDeviceSDL.cpp +++ b/irr/src/CIrrDeviceSDL.cpp @@ -667,6 +667,7 @@ bool CIrrDeviceSDL::run() #else irrevent.MouseInput.Wheel = SDL_event.wheel.y; #endif + irrevent.MouseInput.ButtonStates = MouseButtonStates; irrevent.MouseInput.Shift = (keymod & KMOD_SHIFT) != 0; irrevent.MouseInput.Control = (keymod & KMOD_CTRL) != 0; irrevent.MouseInput.X = MouseX;