From ec686f581cb4ec588fa523e55d7fb08bea2a024c Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 13 Nov 2007 18:01:01 +0000 Subject: [PATCH] Bugfix 7733 New mouse scrollwheels allowing higher precision didn't work in Windows. Code was assuming only value of +120 or -120 were returned. --- intern/ghost/intern/GHOST_SystemWin32.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index ec6d0d355b5..835f7da3038 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -54,7 +54,7 @@ #define WM_MOUSEWHEEL 0x020A #endif // WM_MOUSEWHEEL #ifndef WHEEL_DELTA -#define WHEEL_DELTA 120 /* Value for rolling one detent */ +#define WHEEL_DELTA 120 /* Value for rolling one detent, (old convention! MS changed it) */ #endif // WHEEL_DELTA @@ -479,7 +479,11 @@ GHOST_EventWheel* GHOST_SystemWin32::processWheelEvent(GHOST_IWindow *window, WP { // short fwKeys = LOWORD(wParam); // key flags int zDelta = (short) HIWORD(wParam); // wheel rotation - zDelta /= WHEEL_DELTA; + + // zDelta /= WHEEL_DELTA; + // temporary fix below: microsoft now has added more precision, making the above division not work + if (zDelta <= 0 ) zDelta= -1; else zDelta= 1; + // short xPos = (short) LOWORD(lParam); // horizontal position of pointer // short yPos = (short) HIWORD(lParam); // vertical position of pointer return new GHOST_EventWheel (getSystem()->getMilliSeconds(), window, zDelta);