fixed up handling of WM_MOUSEWHEEL, low order of wParam is not the mouse
authorDiederick Niehorster <dcnieho@gmail.com>
Fri, 1 Mar 2013 15:42:26 +0000 (15:42 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Fri, 1 Mar 2013 15:42:26 +0000 (15:42 +0000)
wheel number, but indicates which virtual keys are pressed during the
scroll wheel motion

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1542 7f0cb862-5218-0410-a997-914c9d46530a

src/mswin/fg_main_mswin.c

index 85492f7..656ae51 100644 (file)
@@ -811,8 +811,9 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
     case WM_MOUSEWHEEL:
     {
         SFG_Window *child_window = NULL;
-        int wheel_number = LOWORD( wParam );
-        short ticks = ( short )HIWORD( wParam );
+        int wheel_number = 0;   /* Only one scroll wheel on windows */
+        /* int GET_KEYSTATE_WPARAM( wParam ); */
+        short ticks = GET_WHEEL_DELTA_WPARAM( wParam );
 
         window = fghWindowUnderCursor(window);
 
@@ -865,6 +866,8 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
 
             fgState.Modifiers = INVALID_MODIFIERS;
                }
+        /* Per docs, should return zero */
+        lRet = 0;
     }
     break ;