src/video/windows/SDL_windowsevents.c
changeset 7813 d8fb783475d5
parent 7678 286c42d7c5ed
child 7816 f16e342b167a
equal deleted inserted replaced
7812:c50a384be081 7813:d8fb783475d5
   464         break;
   464         break;
   465     }
   465     }
   466 
   466 
   467     case WM_MOUSEWHEEL:
   467     case WM_MOUSEWHEEL:
   468         {
   468         {
   469             /* FIXME: This may need to accumulate deltas up to WHEEL_DELTA */
   469             static short s_AccumulatedMotion;
   470             short motion = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA;
   470 
   471 
   471             s_AccumulatedMotion += GET_WHEEL_DELTA_WPARAM(wParam);
   472             SDL_SendMouseWheel(data->window, 0, 0, motion);
   472             if (s_AccumulatedMotion > 0) {
       
   473                 while (s_AccumulatedMotion >= WHEEL_DELTA) {
       
   474                     SDL_SendMouseWheel(data->window, 0, 0, 1);
       
   475                     s_AccumulatedMotion -= WHEEL_DELTA;
       
   476                 }
       
   477             } else {
       
   478                 while (s_AccumulatedMotion <= -WHEEL_DELTA) {
       
   479                     SDL_SendMouseWheel(data->window, 0, 0, -1);
       
   480                     s_AccumulatedMotion += WHEEL_DELTA;
       
   481                 }
       
   482             }
   473             break;
   483             break;
   474         }
   484         }
   475 
   485 
   476 #ifdef WM_MOUSELEAVE
   486 #ifdef WM_MOUSELEAVE
   477     case WM_MOUSELEAVE:
   487     case WM_MOUSELEAVE: