Mercurial > sdl-ios-xcode
changeset 2153:760c1bd2d625
Reverted mousewheel support in 1.2, since it breaks binary compatibility.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 06 Jul 2007 13:45:10 +0000 |
parents | 003c1b5b07da |
children | 5660f48b31f5 |
files | include/SDL_compat.h src/SDL_compat.c |
diffstat | 2 files changed, 17 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/include/SDL_compat.h Fri Jul 06 09:22:18 2007 +0000 +++ b/include/SDL_compat.h Fri Jul 06 13:45:10 2007 +0000 @@ -63,8 +63,6 @@ #define SDL_BUTTON_WHEELUP 4 #define SDL_BUTTON_WHEELDOWN 5 -#define SDL_BUTTON_WHEELLEFT 6 -#define SDL_BUTTON_WHEELRIGHT 7 #define SDL_DEFAULT_REPEAT_DELAY 500 #define SDL_DEFAULT_REPEAT_INTERVAL 30
--- a/src/SDL_compat.c Fri Jul 06 09:22:18 2007 +0000 +++ b/src/SDL_compat.c Fri Jul 06 13:45:10 2007 +0000 @@ -252,46 +252,33 @@ int selected; int x, y; + if (event->wheel.y == 0) { + break; + } + selected = SDL_SelectMouse(event->wheel.which); SDL_GetMouseState(&x, &y); SDL_SelectMouse(selected); + if (event->wheel.y > 0) { + button = SDL_BUTTON_WHEELUP; + } else { + button = SDL_BUTTON_WHEELDOWN; + } + fake.button.which = event->wheel.windowID; + fake.button.button = button; fake.button.x = x; fake.button.y = y; fake.button.windowID = event->wheel.windowID; - if (event->wheel.y) { - if (event->wheel.y > 0) { - fake.button.button = SDL_BUTTON_WHEELUP; - } else { - fake.button.button = SDL_BUTTON_WHEELDOWN; - } - - fake.type = SDL_MOUSEBUTTONDOWN; - fake.button.state = SDL_PRESSED; - SDL_PushEvent(&fake); + fake.type = SDL_MOUSEBUTTONDOWN; + fake.button.state = SDL_PRESSED; + SDL_PushEvent(&fake); - fake.type = SDL_MOUSEBUTTONUP; - fake.button.state = SDL_RELEASED; - SDL_PushEvent(&fake); - } - if (event->wheel.x) { - if (event->wheel.y > 0) { - fake.button.button = SDL_BUTTON_WHEELLEFT; - } else { - fake.button.button = SDL_BUTTON_WHEELRIGHT; - } - - fake.type = SDL_MOUSEBUTTONDOWN; - fake.button.state = SDL_PRESSED; - SDL_PushEvent(&fake); - - fake.type = SDL_MOUSEBUTTONUP; - fake.button.state = SDL_RELEASED; - SDL_PushEvent(&fake); - } - + fake.type = SDL_MOUSEBUTTONUP; + fake.button.state = SDL_RELEASED; + SDL_PushEvent(&fake); break; }