From c10ffddaedaf513f3da0acdbb8d581df84e964bf Mon Sep 17 00:00:00 2001 From: Akansh Sirohi <34837239+akanshSirohi@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:32:57 +0530 Subject: [PATCH] Fixed scrollMouse() bug on windows --- src/mouse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index f7bb11d6..a9e1b790 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -332,7 +332,8 @@ void scrollMouse(int x, int y) mouseScrollInputs[0].mi.dwFlags = MOUSEEVENTF_WHEEL; mouseScrollInputs[0].mi.time = 0; mouseScrollInputs[0].mi.dwExtraInfo = 0; - mouseScrollInputs[0].mi.mouseData = y; + // Flip x to match other platforms. + mouseScrollInputs[0].mi.mouseData = -x; mouseScrollInputs[1].type = INPUT_MOUSE; mouseScrollInputs[1].mi.dx = 0; @@ -340,8 +341,7 @@ void scrollMouse(int x, int y) mouseScrollInputs[1].mi.dwFlags = MOUSEEVENTF_HWHEEL; mouseScrollInputs[1].mi.time = 0; mouseScrollInputs[1].mi.dwExtraInfo = 0; - // Flip x to match other platforms. - mouseScrollInputs[1].mi.mouseData = -x; + mouseScrollInputs[1].mi.mouseData = y; SendInput(2, mouseScrollInputs, sizeof(INPUT)); #endif