[pypy-commit] pypy default: support the scroll wheel (and the fany all-direction scrolling)

cfbolz noreply at buildbot.pypy.org
Mon Feb 3 11:45:47 CET 2014


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
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)


More information about the pypy-commit mailing list