break;
case EnterNotify:
- {
- GETWINDOW( xcrossing );
- GETMOUSE( xcrossing );
- INVOKE_WCB( *window, Entry, ( GLUT_ENTERED ) );
- }
- break;
- /* XXX Combine EnterNotify and LeaveNotify */
case LeaveNotify:
- {
GETWINDOW( xcrossing );
GETMOUSE( xcrossing );
- INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) );
- }
- break;
+ INVOKE_WCB( *window, Entry, ( ( EnterNotify == event.type ) ?
+ GLUT_ENTERED :
+ GLUT_LEFT ) );
+ break;
case MotionNotify:
{
*
* XXX Use a symbolic constant, *not* "4"!
*/
- if( ( button < 4 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) )
+ if( ( button < 3 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) )
{
INVOKE_WCB( *window, Mouse, ( button,
pressed ? GLUT_DOWN : GLUT_UP,
* XXX since the order and numbering isn't certain
* XXX See XFree86 configuration docs (even back in the
* XXX 3.x days, and especially with 4.x).
+ *
+ * XXX Note that {button} has already been decremeted
+ * XXX in mapping from X button numbering to GLUT.
*/
- int wheel_number = (button - 4) / 2;
- int direction = (button & 1)*2 - 1;
+ int wheel_number = (button - 3) / 2;
+ int direction = -1;
+ if( button % 2 )
+ direction = 1;
if( pressed )
INVOKE_WCB( *window, MouseWheel, ( wheel_number,
}
break;
+ case ReparentNotify:
+ break; /* XXX Should disable this event */
+
default:
fgWarning ("Unknown X event type: %d", event.type);
break;
{
int wheel_number = LOWORD( wParam );
/* THIS IS SPECULATIVE -- John Fay, 10/2/03 */
- short ticks = HIWORD( lParam ) / 120;
+ short ticks = HIWORD( wParam ) / 120;
/* Should be WHEEL_DELTA instead of 120 */
int direction = 1;