Author: greg.ercolano
Date: 2010-03-04 09:17:04 -0800 (Thu, 04 Mar 2010)
New Revision: 7213
Log:
Fixes for STR #2323; missing right/middle drag events and missing mousewheel 
clicks.



Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2010-03-04 17:06:43 UTC (rev 7212)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2010-03-04 17:17:04 UTC (rev 7213)
@@ -790,13 +790,18 @@
   }
   Fl::first_window(window);
   
+  // Under OSX, single mousewheel increments are 0.1,
+  // so make sure they show up as at least 1..
+  //
+  float dx = [theEvent deltaX]; if ( fabs(dx) < 1.0 ) dx = (dx > 0) ? 1.0 : 
-1.0;
+  float dy = [theEvent deltaY]; if ( fabs(dy) < 1.0 ) dy = (dy > 0) ? 1.0 : 
-1.0;
   if ([theEvent deltaX] != 0) {
-    Fl::e_dx = (int)-[theEvent deltaX];
+    Fl::e_dx = (int)-dx;
     Fl::e_dy = 0;
     if ( Fl::e_dx) Fl::handle( FL_MOUSEWHEEL, window );
   } else if ([theEvent deltaY] != 0) {
     Fl::e_dx = 0;
-    Fl::e_dy = (int)-[theEvent deltaY];
+    Fl::e_dy = (int)-dy;
     if ( Fl::e_dy) Fl::handle( FL_MOUSEWHEEL, window );
   } else {
     fl_unlock_function();
@@ -1879,6 +1884,8 @@
 - (void)rightMouseDown:(NSEvent *)theEvent;
 - (void)otherMouseDown:(NSEvent *)theEvent;
 - (void)mouseDragged:(NSEvent *)theEvent;
+- (void)rightMouseDragged:(NSEvent *)theEvent;
+- (void)otherMouseDragged:(NSEvent *)theEvent;
 - (void)scrollWheel:(NSEvent *)theEvent;
 - (void)keyDown:(NSEvent *)theEvent;
 - (void)keyUp:(NSEvent *)theEvent;
@@ -1937,6 +1944,12 @@
 - (void)mouseDragged:(NSEvent *)theEvent {
   cocoaMouseHandler(theEvent);
 }
+- (void)rightMouseDragged:(NSEvent *)theEvent {
+  cocoaMouseHandler(theEvent);
+}
+- (void)otherMouseDragged:(NSEvent *)theEvent {
+  cocoaMouseHandler(theEvent);
+}
 - (void)scrollWheel:(NSEvent *)theEvent {
   cocoaMouseWheelHandler(theEvent);
 }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to