From bac0b4bb2de891514db18d3ace2661d5c00e217e Mon Sep 17 00:00:00 2001 From: rainmakerv2 <30595646+jpau02@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:12:43 +0800 Subject: [PATCH] Fix alt + mousewheel vertical being changed to horizontal for qwidgets --- src/qt_gui/kbm_gui.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qt_gui/kbm_gui.cpp b/src/qt_gui/kbm_gui.cpp index e92766eb9..e43eb282f 100644 --- a/src/qt_gui/kbm_gui.cpp +++ b/src/qt_gui/kbm_gui.cpp @@ -1016,14 +1016,23 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) { } if (wheelEvent->angleDelta().x() > 5) { if (std::find(AxisList.begin(), AxisList.end(), MappingButton) == AxisList.end()) { - SetMapping("mousewheelright"); + // QT changes scrolling to horizontal for all widgets with the alt modifier + if (Qt::AltModifier & QApplication::keyboardModifiers()) { + SetMapping("mousewheelup"); + } else { + SetMapping("mousewheelright"); + } } else { QMessageBox::information(this, "Cannot set mapping", "Mousewheel cannot be mapped to stick outputs"); } } else if (wheelEvent->angleDelta().x() < -5) { if (std::find(AxisList.begin(), AxisList.end(), MappingButton) == AxisList.end()) { - SetMapping("mousewheelleft"); + if (Qt::AltModifier & QApplication::keyboardModifiers()) { + SetMapping("mousewheeldown"); + } else { + SetMapping("mousewheelleft"); + } } else { QMessageBox::information(this, "Cannot set mapping", "Mousewheel cannot be mapped to stick outputs");