tAdd buttons 4 and 5 (scrolling on X). - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit ff8bbc7987bd23cffd029d5968e76dbdeb67c7fa
parent 2d67e4cc561e04f247d0dda2ea942a7cfcccac5b
Author: rsc 
Date:   Wed,  9 Jun 2004 14:01:30 +0000

Add buttons 4 and 5 (scrolling on X).

Diffstat:
  M src/libdraw/x11-itrans.c            |      17 ++++++++++++++++-

1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/libdraw/x11-itrans.c b/src/libdraw/x11-itrans.c
t@@ -220,6 +220,12 @@ _xtoplan9mouse(XDisplay *xd, XEvent *e, Mouse *m)
                 case 3:
                         s |= Button3Mask;
                         break;
+                case 4:
+                        s |= Button4Mask;
+                        break;
+                case 5:
+                        s |= Button5Mask;
+                        break;
                 }
                 break;
         case ButtonRelease:
t@@ -238,6 +244,12 @@ _xtoplan9mouse(XDisplay *xd, XEvent *e, Mouse *m)
                 case 3:
                         s &= ~Button3Mask;
                         break;
+                case 4:
+                        s &= ~Button4Mask;
+                        break;
+                case 5:
+                        s &= ~Button5Mask;
+                        break;
                 }
                 break;
 
t@@ -260,7 +272,10 @@ _xtoplan9mouse(XDisplay *xd, XEvent *e, Mouse *m)
                 m->buttons |= 2;
         if(s & Button3Mask)
                 m->buttons |= 4;
-
+        if(s & Button4Mask)
+                m->buttons |= 8;
+        if(s & Button5Mask)
+                m->buttons |= 16;
         return 0;
 }