The Windows platform plugin was not checking for the control or
shift keyboard modifiers when processing mouse wheel events. Added
a function to convert Windows wheel events to Qt::KeyboardModifiers
and passed this through the event chain.
Task-number: QTBUG-25754
Change-Id: I6551e98b4eaebad5704058bddfb06502ded5155d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
MSG msg, LRESULT *)
{
const Qt::MouseButtons buttons = keyStateToMouseButtons((int)msg.wParam);
+ const Qt::KeyboardModifiers mods = keyStateToModifiers((int)msg.wParam);
+
int delta;
if (msg.message == WM_MOUSEWHEEL || msg.message == WM_MOUSEHWHEEL)
delta = (short) HIWORD (msg.wParam);
QWindowSystemInterface::handleWheelEvent(receiver,
QWindowsGeometryHint::mapFromGlobal(receiver, globalPos),
globalPos,
- delta, orientation);
+ delta, orientation, mods);
return true;
}
LRESULT *result);
static inline Qt::MouseButtons keyStateToMouseButtons(int);
+ static inline Qt::KeyboardModifiers keyStateToModifiers(int);
static inline int mouseButtonsToKeyState(Qt::MouseButtons);
QWindow *windowUnderMouse() const { return m_windowUnderMouse.data(); }
return mb;
}
+Qt::KeyboardModifiers QWindowsMouseHandler::keyStateToModifiers(int wParam)
+{
+ Qt::KeyboardModifiers mods(Qt::NoModifier);
+ if (wParam & MK_CONTROL)
+ mods |= Qt::ControlModifier;
+ if (wParam & MK_SHIFT)
+ mods |= Qt::ShiftModifier;
+ return mods;
+}
+
int QWindowsMouseHandler::mouseButtonsToKeyState(Qt::MouseButtons mb)
{
int result = 0;