#define countof(x) (sizeof((x))/sizeof((*x)))
static XrmOptionDescRec opts[] = {
- {"+rotate", ".chess.rotate", XrmoptionNoArg, (caddr_t) "false" },
- {"-rotate", ".chess.rotate", XrmoptionNoArg, (caddr_t) "true" },
- {"+reflections", ".chess.reflections", XrmoptionNoArg, (caddr_t) "false" },
- {"-reflections", ".chess.reflections", XrmoptionNoArg, (caddr_t) "true" },
- {"+shadows", ".chess.shadows", XrmoptionNoArg, (caddr_t) "false" },
- {"-shadows", ".chess.shadows", XrmoptionNoArg, (caddr_t) "true" },
- {"+smooth", ".chess.smooth", XrmoptionNoArg, (caddr_t) "false" },
- {"-smooth", ".chess.smooth", XrmoptionNoArg, (caddr_t) "true" },
+ {"+rotate", ".chess.rotate", XrmoptionNoArg, "false" },
+ {"-rotate", ".chess.rotate", XrmoptionNoArg, "true" },
+ {"+reflections", ".chess.reflections", XrmoptionNoArg, "false" },
+ {"-reflections", ".chess.reflections", XrmoptionNoArg, "true" },
+ {"+shadows", ".chess.shadows", XrmoptionNoArg, "false" },
+ {"-shadows", ".chess.shadows", XrmoptionNoArg, "true" },
+ {"+smooth", ".chess.smooth", XrmoptionNoArg, "false" },
+ {"-smooth", ".chess.smooth", XrmoptionNoArg, "true" },
};
int rotate, reflections, smooth, shadows;
Bool chess_handle_event (ModeInfo *mi, XEvent *event) {
Chesscreen *c = &qs[MI_SCREEN(mi)];
- if(event->xany.type == ButtonPress && event->xbutton.button & Button1) {
+ if(event->xany.type == ButtonPress && event->xbutton.button == Button1) {
c->button_down_p = True;
gltrackball_start (c->trackball,
event->xbutton.x, event->xbutton.y,
return True;
}
else if(event->xany.type == ButtonRelease
- && event->xbutton.button & Button1) {
+ && event->xbutton.button == Button1) {
c->button_down_p = False;
return True;
}
+ else if (event->xany.type == ButtonPress &&
+ (event->xbutton.button == Button4 ||
+ event->xbutton.button == Button5))
+ {
+ gltrackball_mousewheel (c->trackball, event->xbutton.button, 5,
+ !event->xbutton.state);
+ return True;
+ }
else if(event->xany.type == MotionNotify && c->button_down_p) {
gltrackball_track (c->trackball,
event->xmotion.x, event->xmotion.y,