path: root/src/platformsupport
diff options
authorLaszlo Agocs <>2014-06-23 12:11:00 +0200
committerLaszlo Agocs <>2014-07-02 14:40:53 +0200
commite8bb49e1d4b6e8eb15d7975bd98894f0577c34c9 (patch)
treea4ccdc6bc9d900c4f817d2ae33dd03e0cc94ea7e /src/platformsupport
parent07297c4eaa58089f72490f3e2dc87c48ee666d73 (diff)
Report keyboard modifiers in evdevmouse
Mouse and wheel events have no modifiers set. This is not ideal. Pass at least QGuiApplication::keyboardModifiers() to get the modifiers from the last key event. Task-number: QTBUG-39812 Change-Id: Ica0c338c60c3e289dccfafa5aa6d602d4e111ad5 Reviewed-by: Leonard Lee <> Reviewed-by: Will Wagner <> Reviewed-by: Shawn Rutledge <>
Diffstat (limited to 'src/platformsupport')
1 files changed, 4 insertions, 2 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 7b834a5c61..87f3a4c9a0 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -135,7 +135,9 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto
m_y = g.bottom() - m_yoffset;
QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
- QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons);
+ // Cannot track the keyboard modifiers ourselves here. Instead, report the
+ // modifiers from the last key event that has been seen by QGuiApplication.
+ QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, QGuiApplication::keyboardModifiers());
qDebug("mouse event %d %d %d", pos.x(), pos.y(), int(buttons));
@@ -145,7 +147,7 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto
void QEvdevMouseManager::handleWheelEvent(int delta, Qt::Orientation orientation)
QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
- QWindowSystemInterface::handleWheelEvent(0, pos, pos, delta, orientation);
+ QWindowSystemInterface::handleWheelEvent(0, pos, pos, delta, orientation, QGuiApplication::keyboardModifiers());
qDebug("mouse wheel event %dx%d %d %d", pos.x(), pos.y(), delta, int(orientation));