diff src/video/cocoa/SDL_cocoawindow.m @ 5057:bdff53ed6c8b

Fix mouse wheel events in fullscreen mode for OS X With proposed patch by vernier.
author Jjgod Jiang <gzjjgod@gmail.com>
date Fri, 21 Jan 2011 00:15:18 +0100
parents 8b7988f42fcb
children 00d1fef487c5
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoawindow.m	Thu Jan 20 16:05:59 2011 -0800
+++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Jan 21 00:15:18 2011 +0100
@@ -29,6 +29,7 @@
 #include "../../events/SDL_windowevents_c.h"
 #include "SDL_cocoavideo.h"
 #include "SDL_cocoashape.h"
+#include "SDL_cocoamouse.h"
 
 static __inline__ void ConvertNSRect(NSRect *r)
 {
@@ -260,20 +261,7 @@
 
 - (void)scrollWheel:(NSEvent *)theEvent
 {
-    float x = [theEvent deltaX];
-    float y = [theEvent deltaY];
-
-    if (x > 0) {
-        x += 0.9f;
-    } else if (x < 0) {
-        x -= 0.9f;
-    }
-    if (y > 0) {
-        y += 0.9f;
-    } else if (y < 0) {
-        y -= 0.9f;
-    }
-    SDL_SendMouseWheel(_data->window, (int)x, (int)y);
+    Cocoa_HandleMouseWheel(_data->window, theEvent);
 }
 
 - (void)touchesBeganWithEvent:(NSEvent *) theEvent