http://ftp.ksu.edu.tw/FTP/FreeBSD/distfiles/xscreensaver-4.20.tar.gz
[xscreensaver] / hacks / glx / glknots.c
index 255bc36b488395a51f060ac0766998e942daf957..3c0366efaaec98a2b0b7b0ccf12e097fc2412c95 100644 (file)
@@ -245,7 +245,7 @@ knot_handle_event (ModeInfo *mi, XEvent *event)
   knot_configuration *bp = &bps[MI_SCREEN(mi)];
 
   if (event->xany.type == ButtonPress &&
-      event->xbutton.button & Button1)
+      event->xbutton.button == Button1)
     {
       bp->button_down_p = True;
       gltrackball_start (bp->trackball,
@@ -254,11 +254,19 @@ knot_handle_event (ModeInfo *mi, XEvent *event)
       return True;
     }
   else if (event->xany.type == ButtonRelease &&
-           event->xbutton.button & Button1)
+           event->xbutton.button == Button1)
     {
       bp->button_down_p = False;
       return True;
     }
+  else if (event->xany.type == ButtonPress &&
+           (event->xbutton.button == Button4 ||
+            event->xbutton.button == Button5))
+    {
+      gltrackball_mousewheel (bp->trackball, event->xbutton.button, 5,
+                              !!event->xbutton.state);
+      return True;
+    }
   else if (event->xany.type == MotionNotify &&
            bp->button_down_p)
     {