X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=7f62b84b6a55ef9c49a7006c074e589676d94e4c;hb=8ecffae5f6f461182f26b917777b9ef3e1b1905d;hp=5cb91adad2fdc1145f252e507dcf534a26296106;hpb=c91e543783ddfd7c68a2120e7e4451b5c01a26aa;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 5cb91ad..7f62b84 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -458,7 +458,7 @@ static void fghSleepForEvents( void ) msec = fghNextTimer( ); /* XXX Use GLUT timers for joysticks... */ /* XXX Dumb; forces granularity to .01sec */ - if( fghHaveJoystick( ) && ( msec < 10 ) ) + if( fghHaveJoystick( ) && ( msec > 10 ) ) msec = 10; #if TARGET_HOST_UNIX_X11 @@ -1477,11 +1477,14 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, 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 + 4; - if( direction > 0 ) + int button = wheel_number * 2 + 3; + if( direction < 0 ) ++button; INVOKE_WCB( *window, Mouse, ( button, GLUT_DOWN, @@ -1489,7 +1492,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, ); INVOKE_WCB( *window, Mouse, ( button, GLUT_UP, - window->State.MouseX, window->State.MouseX ) + window->State.MouseX, window->State.MouseY ) ); }