From 35029deb8ef47d400dbc3cc567a024410bb80391 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 24 Feb 2023 15:07:42 +0600 Subject: [PATCH] qt: Poll for 4th and 5th mouse buttons on Windows --- src/qt/qt_winrawinputfilter.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qt/qt_winrawinputfilter.cpp b/src/qt/qt_winrawinputfilter.cpp index 6690a08eb..08af142a6 100644 --- a/src/qt/qt_winrawinputfilter.cpp +++ b/src/qt/qt_winrawinputfilter.cpp @@ -340,6 +340,16 @@ WindowsRawInputFilter::mouse_handle(PRAWINPUT raw) else if (state.usButtonFlags & RI_MOUSE_RIGHT_BUTTON_UP) buttons &= ~2; + if (state.usButtonFlags & RI_MOUSE_BUTTON_4_DOWN) + buttons |= 8; + else if (state.usButtonFlags & RI_MOUSE_BUTTON_4_UP) + buttons &= ~8; + + if (state.usButtonFlags & RI_MOUSE_BUTTON_5_DOWN) + buttons |= 16; + else if (state.usButtonFlags & RI_MOUSE_BUTTON_5_UP) + buttons &= ~16; + if (state.usButtonFlags & RI_MOUSE_WHEEL) { dwheel += (SHORT) state.usButtonData / 120; }