Takeshi,

        Thanks for the bug fixes.  Nothing like a new Release Candidate to bring the bugs out of the woodwork!  (Sorry, JC, I guess we should have waited until Friday like the schedule said.)  I'll be putting them into CVS shortly.

John F. Fay
john.fay@eglin.af.mil
850-729-6330
-----Original Message-----
From: freeglut-developer-admin@lists.sourceforge.net [mailto:freeglut-developer-admin@lists.sourceforge.net] On Behalf Of Takeshi Nishimura

Sent: Thursday, May 26, 2005 4:13 AM
To: freeglut-developer@lists.sourceforge.net
Subject: [Freeglut-developer] Is button numbering of mouse wheel correct?

Is button numbering of mouse wheel correct?
In X11, freeglut maps -1 to 4, +1 to 3.
In Windows, it maps -1 to 4, +1 to 5.
Of cource this depends on environments, but I think there is no Windows environment
acting like X11.
Here is a patch to act like X11 with a little typo fix.
--
Takeshi Nishimura

*** freeglut-2.4.0-rc4/src/freeglut_main.c.dist    2005-05-26 02:05:22.000000000 +0000
--- freeglut-2.4.0-rc4/src/freeglut_main.c    2005-05-26 02:05:22.000000001 +0000
*************** LRESULT CALLBACK fgWindowProc( HWND hWnd
*** 1475,1497 ****
                              )
                  );
              else  /* No mouse wheel, call the mouse button callback twice */
              {
                  /*
                   * XXX The below assumes that you have no more than 3 mouse
                   * XXX buttons.  Sorry.
                   */
!                 int button = wheel_number*2 + 4;
!                 if( direction > 0 )
                      ++button;
                  INVOKE_WCB( *window, Mouse,
                              ( button, GLUT_DOWN,
                                window->State.MouseX, window->State.MouseY )
                  );
                  INVOKE_WCB( *window, Mouse,
                              ( button, GLUT_UP,
!                               window->State.MouseX, window->State.MouseX )
                  );
              }
 
          fgState.Modifiers = 0xffffffff;
      }
--- 1475,1500 ----
                              )
                  );
              else  /* No mouse wheel, call the mouse button callback twice */
              {
                  /*
+                  * Map wheel zero to button 3 and 4; +1 to 3, -1 to 4
+                  *  "    "   one                     +1 to 5, -1 to 6, ...
+                  *
                   * XXX The below assumes that you have no more than 3 mouse
                   * XXX buttons.  Sorry.
                   */
!                 int button = wheel_number*2 + 3;
!                 if( direction < 0 )
                      ++button;
                  INVOKE_WCB( *window, Mouse,
                              ( button, GLUT_DOWN,
                                window->State.MouseX, window->State.MouseY )
                  );
                  INVOKE_WCB( *window, Mouse,
                              ( button, GLUT_UP,
!                               window->State.MouseX, window->State.MouseY )
                  );
              }
 
          fgState.Modifiers = 0xffffffff;
      }
        
        


-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Freeglut-developer mailing list
Freeglut-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freeglut-developer