summaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2014-11-05 21:07:39 +0100
committerAndrzej Rybczak <electricityispower@gmail.com>2014-11-06 16:57:08 +0100
commit60749ea4bd83f991c1c967f25b8410ac9aeacf71 (patch)
tree85fe98f8e26cc7ea71ba30454c2159a28d39e4bb /src/window.h
parent0f254b164e0eb814093aa2c84df3ea2536c5715a (diff)
window: fix wheel scrolling if NCURSES_MOUSE_VERSION > 1
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/window.h b/src/window.h
index b769e16f..7f751056 100644
--- a/src/window.h
+++ b/src/window.h
@@ -95,13 +95,12 @@
// undefine scroll macro as it collides with Window::scroll
#undef scroll
-#ifndef USE_PDCURSES
-// NOTICE: redefine BUTTON2_PRESSED as it doesn't always work, I noticed
-// that it sometimes returns 134217728 (2^27) instead of expected mask, so the
-// modified define does it right but is rather experimental.
-# undef BUTTON2_PRESSED
-# define BUTTON2_PRESSED (NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED) | (1U << 27))
-#endif // USE_PDCURSES
+#if !defined(USE_PDCURSES) && NCURSES_MOUSE_VERSION == 1
+// NOTICE: define BUTTON5_PRESSED to be BUTTON2_PRESSED with additional mask
+// (I noticed that it sometimes returns 134217728 (2^27) instead of expected
+// mask, so the modified define does it right.
+# define BUTTON5_PRESSED (BUTTON2_PRESSED | (1U << 27))
+#endif // !defined(USE_PDCURSES) && NCURSES_MOUSE_VERSION == 1
// workaraund for win32
#ifdef WIN32