Author: Carl Friedrich Bolz <[email protected]>
Branch: 
Changeset: r69058:b23c7d2fbe5b
Date: 2014-02-03 11:45 +0100
http://bitbucket.org/pypy/pypy/changeset/b23c7d2fbe5b/

Log:    support the scroll wheel (and the fany all-direction scrolling)

diff --git a/dotviewer/graphdisplay.py b/dotviewer/graphdisplay.py
--- a/dotviewer/graphdisplay.py
+++ b/dotviewer/graphdisplay.py
@@ -613,6 +613,19 @@
     def process_MouseButtonUp(self, event):
         self.dragging = None
         pygame.event.set_grab(False)
+        # handle directional scrolling
+        if event.button == 4:
+            self.pan((0, -1))
+            return
+        if event.button == 5:
+            self.pan((0, 1))
+            return
+        if event.button == 6:
+            self.pan((-1, 0))
+            return
+        if event.button == 7:
+            self.pan((1, 0))
+            return
         if self.click_time is not None and abs(time.time() - self.click_time) 
< 1:
             # click (no significant dragging)
             self.notifyclick(self.click_origin)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to