I tested a Microsoft wheelmouse, and it was same as Logitech; 0.1 per 
click.

        I tried a few different techniques massaging the deltas..
        this one seemed to work well, as it avoids the scale, but lets the
        single clicks through. This yielded a pretty reasonable "scroll" in 
fltk's editor:
_________________________________________________________________________________

+  // 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 );
_________________________________________________________________________________
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to