Added horizontal scrolling support

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402428
This commit is contained in:
Sam Lantinga 2007-07-06 09:22:18 +00:00
parent e33ee1a0e2
commit 43e5d2b938
7 changed files with 41 additions and 20 deletions

View file

@ -427,12 +427,12 @@ SDL_SendMouseButton(int index, Uint8 state, Uint8 button)
}
int
SDL_SendMouseWheel(int index, int motion)
SDL_SendMouseWheel(int index, int x, int y)
{
SDL_Mouse *mouse = SDL_GetMouse(index);
int posted;
if (!mouse || !motion) {
if (!mouse || (!x && !y)) {
return 0;
}
@ -442,7 +442,8 @@ SDL_SendMouseWheel(int index, int motion)
SDL_Event event;
event.type = SDL_MOUSEWHEEL;
event.wheel.which = (Uint8) index;
event.wheel.motion = motion;
event.wheel.x = x;
event.wheel.y = y;
event.wheel.windowID = mouse->focus;
posted = (SDL_PushEvent(&event) > 0);
}