From 389b4ec28b6bb402d3575ff9c648ef878257ea84 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 22 Nov 2016 15:45:36 +0100 Subject: Windows QPA: Do not send key events for mouse-synthesized app commands Sending key events in addition causes applications to respond twice to for example the back / forward extra mouse buttons. Suppress the keypress by checking on the device. This is in line with the other platforms, which do not send keypresses either. Native event filters will still be able to listen for WM_APPCOMMAND. Task-number: QTBUG-48117 Task-number: QTBUG-57198 Change-Id: I219e17244087663f06ab2c5a8cf4b880c3655700 Reviewed-by: Andy Shaw --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/platforms/windows/qwindowskeymapper.cpp') diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 60361e436d..a52ae7c2a9 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -861,6 +861,9 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd, bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, const MSG &msg) { #if defined(WM_APPCOMMAND) + // QTBUG-57198, do not send mouse-synthesized commands as key events in addition + if (GET_DEVICE_LPARAM(msg.lParam) == FAPPCOMMAND_MOUSE) + return false; const int cmd = GET_APPCOMMAND_LPARAM(msg.lParam); const int dwKeys = GET_KEYSTATE_LPARAM(msg.lParam); int state = 0; -- cgit v1.2.3