diff src/events/SDL_mouse.c @ 2152:003c1b5b07da

Fixed bug #382 Added horizontal scrolling support
author Sam Lantinga <slouken@libsdl.org>
date Fri, 06 Jul 2007 09:22:18 +0000
parents 5f6550e5184f
children 44e49d3fa6cf 64f346a83ed3
line wrap: on
line diff
--- a/src/events/SDL_mouse.c	Thu Jul 05 06:35:40 2007 +0000
+++ b/src/events/SDL_mouse.c	Fri Jul 06 09:22:18 2007 +0000
@@ -427,12 +427,12 @@
 }
 
 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_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);
     }