From bcbeeb7a70479bda3eaba382019303d40a70c141 Mon Sep 17 00:00:00 2001 From: Johannes Grunenberg Date: Tue, 10 Oct 2023 19:26:28 +0200 Subject: [PATCH] Windows QPA: Omit native virtual key in WM_CHAR WM_CHAR doesn't send the native virtual key in wParam, but it sends the generated UTF-16 code unit, so no assumptions can be made about the pressed key. lParam still contains the scancode. Fixes: QTBUG-117903 Pick-to: 6.6 6.5 Change-Id: Iedc5936118936009db8f6b0c1ce6147db2739422 Reviewed-by: Oliver Wolff (cherry picked from commit d53e42d974c90797d28511470d0b188dcab134fe) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index c8e655704b0..af1230d2408 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -958,7 +958,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg, // A multi-character key or a Input method character // not found by our look-ahead if (msgType == WM_CHAR || msgType == WM_IME_CHAR) { - sendExtendedPressRelease(receiver, 0, Qt::KeyboardModifier(state), scancode, vk_key, nModifiers, messageKeyText(msg), false); + sendExtendedPressRelease(receiver, 0, Qt::KeyboardModifier(state), scancode, 0, nModifiers, messageKeyText(msg), false); return true; }