Skip to content

Commit

Permalink
Fixed mouse wheel motion position on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 31, 2001
1 parent c702c04 commit f98d5ec
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/video/wincommon/SDL_sysevents.c
Expand Up @@ -335,24 +335,15 @@ LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEWHEEL:
if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
Sint16 x, y;
Uint8 button = 0;
int move = (short)HIWORD(wParam);
if(move > 0)
button = 4;
else if(move < 0)
button = 5;
if(button)
{
if ( mouse_relative ) {
/* RJR: March 28, 2000
report internal mouse position if in relative mode */
x = 0; y = 0;
} else {
x = (Sint16)LOWORD(lParam);
y = (Sint16)HIWORD(lParam);
}
if ( move ) {
Uint8 button;
if ( move > 0 )
button = 4;
else
button = 5;
posted = SDL_PrivateMouseButton(
SDL_PRESSED, button, x, y);
SDL_PRESSED, button, 0, 0);
}
}
return(0);
Expand Down

0 comments on commit f98d5ec

Please sign in to comment.