summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-09-20 04:46:44 +0200
committerhut <hut@lepus.uberspace.de>2015-10-04 01:32:58 +0200
commit0d2c7c8b5f21d4c4f9a2c9875557251dee58be92 (patch)
treec79d100b5e49620b29f00bebb4eacafbcc5eae88
parentc75bc573002843a28a3d737a8b78b0e84a6b20d7 (diff)
downloadranger-0d2c7c8b5f21d4c4f9a2c9875557251dee58be92.tar.gz
gui.mouse_event: fix scroll down in recent ncurses versions
-rw-r--r--ranger/gui/mouse_event.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/gui/mouse_event.py b/ranger/gui/mouse_event.py
index f9207138..bc05b2b7 100644
--- a/ranger/gui/mouse_event.py
+++ b/ranger/gui/mouse_event.py
@@ -35,9 +35,12 @@ class MouseEvent(object):
         # If the bstate > ALL_MOUSE_EVENTS, it's an invalid mouse button.
         # I interpret invalid buttons as "scroll down" because all tested
         # systems have a broken curses implementation and this is a workaround.
+        # Recently it seems to have been fixed, as 2**21 was introduced as
+        # the code for the "scroll down" button.
         if self.bstate & curses.BUTTON4_PRESSED:
             return self.ctrl() and -self.CTRL_SCROLLWHEEL_MULTIPLIER or -1
         elif self.bstate & curses.BUTTON2_PRESSED \
+                or self.bstate & 2**21 \
                 or self.bstate > curses.ALL_MOUSE_EVENTS:
             return self.ctrl() and self.CTRL_SCROLLWHEEL_MULTIPLIER or 1
         else: