- ( ( (GetKeyState( VK_LSHIFT ) < 0 ) || ( GetKeyState( VK_RSHIFT ) < 0 )) ? GLUT_ACTIVE_SHIFT : 0 ) |
- ( ( (GetKeyState( VK_LCONTROL ) < 0 ) || ( GetKeyState( VK_RCONTROL ) < 0 )) ? GLUT_ACTIVE_CTRL : 0 ) |
- ( ( (GetKeyState( VK_LMENU ) < 0 ) || ( GetKeyState( VK_RMENU ) < 0 )) ? GLUT_ACTIVE_ALT : 0 );
-
- if ( window->Callbacks.MouseWheel )
- window->Callbacks.MouseWheel(
- wheel_number,
- direction,
- window->State.MouseX,
- window->State.MouseY
- ) ;
- else // No mouse wheel, call the mouse button callback twice
- {
- window->Callbacks.Mouse ( ( direction > 0 ) ? 4 : 5, GLUT_DOWN, window->State.MouseX, window->State.MouseY ) ;
- window->Callbacks.Mouse ( ( direction > 0 ) ? 4 : 5, GLUT_UP, window->State.MouseX, window->State.MouseY ) ;
- }
+ ( ( (GetKeyState( VK_LSHIFT ) < 0 ) ||
+ ( GetKeyState( VK_RSHIFT ) < 0 )) ? GLUT_ACTIVE_SHIFT : 0 ) |
+ ( ( (GetKeyState( VK_LCONTROL ) < 0 ) ||
+ ( GetKeyState( VK_RCONTROL ) < 0 )) ? GLUT_ACTIVE_CTRL : 0 ) |
+ ( ( (GetKeyState( VK_LMENU ) < 0 ) ||
+ ( GetKeyState( VK_RMENU ) < 0 )) ? GLUT_ACTIVE_ALT : 0 );
+
+ while( ticks-- )
+ if ( window->Callbacks.MouseWheel )
+ window->Callbacks.MouseWheel(
+ wheel_number,
+ direction,
+ window->State.MouseX,
+ window->State.MouseY
+ ) ;
+ 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;
+ button += (1 + direction)/2;
+ window->Callbacks.Mouse ( button, GLUT_DOWN,
+ window->State.MouseX,
+ window->State.MouseY ) ;
+ window->Callbacks.Mouse ( button, GLUT_UP,
+ window->State.MouseX,
+ window->State.MouseY ) ;
+ }