X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=da5bcfed961e2d36783a76c76d4069d1c053800a;hb=cef996c3fac108d491a7b05c616ccc04c6851cd0;hp=36faaf9743e18012e9b2e384c0a04e15629f99fd;hpb=86730ceaa1bb463d675f1f7b7d9e31219ede920e;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 36faaf9..da5bcfe 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -777,12 +777,8 @@ void FGAPIENTRY glutMainLoopEvent( void ) fgState.Modifiers = fghGetXModifiers( &event ); - /* - * Finally execute the mouse or mouse wheel callback - * - * XXX Use a symbolic constant, *not* "4"! ("3, sire!") - */ - if( ( button < 3 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) ) + /* Finally execute the mouse or mouse wheel callback */ + if( ( button < glutDeviceGet ( GLUT_NUM_MOUSE_BUTTONS ) ) || ( ! FETCH_WCB( *window, MouseWheel ) ) ) INVOKE_WCB( *window, Mouse, ( button, pressed ? GLUT_DOWN : GLUT_UP, event.xbutton.x, @@ -802,7 +798,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) * XXX Note that {button} has already been decremeted * XXX in mapping from X button numbering to GLUT. */ - int wheel_number = (button - 3) / 2; + int wheel_number = (button - glutDeviceGet ( GLUT_NUM_MOUSE_BUTTONS )) / 2; int direction = -1; if( button % 2 ) direction = 1;