From 02a30bbc53b14c154f9c26e3b6f183844127516c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 8 Apr 2002 17:50:30 +0000 Subject: [PATCH] Mouse wheel fix patch. --- src/video/wincommon/SDL_sysevents.c | 2 ++ src/video/windx5/SDL_dx5events.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 11d6a3463..459817bab 100644 --- a/src/video/wincommon/SDL_sysevents.c +++ b/src/video/wincommon/SDL_sysevents.c @@ -370,6 +370,8 @@ LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) button = 5; posted = SDL_PrivateMouseButton( SDL_PRESSED, button, 0, 0); + posted |= SDL_PrivateMouseButton( + SDL_RELEASED, button, 0, 0); } } return(0); diff --git a/src/video/windx5/SDL_dx5events.c b/src/video/windx5/SDL_dx5events.c index 5fb8f7397..7d81ac7ac 100644 --- a/src/video/windx5/SDL_dx5events.c +++ b/src/video/windx5/SDL_dx5events.c @@ -392,11 +392,13 @@ static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf) yrel = 0; } if((int)ptrbuf[i].dwData > 0) + button = 4; + else + button = 5; posted = SDL_PrivateMouseButton( - SDL_PRESSED, 4, 0, 0); - else if((int)ptrbuf[i].dwData < 0) - posted = SDL_PrivateMouseButton( - SDL_PRESSED, 5, 0, 0); + SDL_PRESSED, button, 0, 0); + posted |= SDL_PrivateMouseButton( + SDL_RELEASED, button, 0, 0); break; case DIMOFS_BUTTON0: case DIMOFS_BUTTON1: