Added mouse wheel handling for Unix platforms.

This commit is contained in:
Casey Langen 2020-12-31 23:04:21 -08:00
parent 5c7415bc45
commit 10a3863f95

View File

@ -58,8 +58,13 @@ namespace cursespp {
bool MouseWheelUp() const { return MOUSE_WHEEL_UP; }
bool MouseWheelDown() const { return MOUSE_WHEEL_DOWN; }
#else
bool MouseWheelUp() const { return false; }
bool MouseWheelDown() const { return false; }
#if NCURSES_MOUSE_VERSION > 1
bool MouseWheelUp() const { return state & BUTTON4_PRESSED; }
bool MouseWheelDown() const { return state & BUTTON5_PRESSED; }
#else
bool MouseWheelUp() const { return state & (BUTTON4_PRESSED | REPORT_MOUSE_POSITION); }
bool MouseWheelDown() const { return state & (BUTTON2_PRESSED | REPORT_MOUSE_POSITION); }
#endif
#endif
int x, y;