Takeshi Nishimura\'s changes to make the Windows mouse wheel/button mapping match that of X11; also fixing a typo in the associated mouse callback argument list

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@628 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2005-05-26 12:26:31 +00:00
parent c1de4b915c
commit 95156e0338

View File

@ -1477,11 +1477,14 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
else /* No mouse wheel, call the mouse button callback twice */ 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 The below assumes that you have no more than 3 mouse
* XXX buttons. Sorry. * XXX buttons. Sorry.
*/ */
int button = wheel_number*2 + 4; int button = wheel_number * 2 + 3;
if( direction > 0 ) if( direction < 0 )
++button; ++button;
INVOKE_WCB( *window, Mouse, INVOKE_WCB( *window, Mouse,
( button, GLUT_DOWN, ( button, GLUT_DOWN,
@ -1489,7 +1492,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
); );
INVOKE_WCB( *window, Mouse, INVOKE_WCB( *window, Mouse,
( button, GLUT_UP, ( button, GLUT_UP,
window->State.MouseX, window->State.MouseX ) window->State.MouseX, window->State.MouseY )
); );
} }