diff options
authorMaurice Kalinowski <>2018-11-06 11:03:42 +0100
committerLiang Qi <>2018-11-11 22:09:10 +0000
commit6857cd60dd884a763af26e43863187e9157fe32c (patch)
parent508b9b49b9d178db959d2e2066b8d4b9f5173573 (diff)
win32: Fix text prediction with on screen keyboard
When the on-screen keyboard completes a word via text prediction, the message contains VK_PACKET as identifier for a character sequence. While each character is send, the code only contains the first character of the sequence. Hence, resolve the actual code manually in case of a sequence. This does not modify the virtual key, so that users are able to distinguish between manual and predictive input. Fixes: QTBUG-71210 Change-Id: I787f1f2d83acaf124dfbbab6c4614a1bfe7bb2eb Reviewed-by: Andre de la Rocha <> Reviewed-by: Friedemann Kleint <>
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 9e6101b758..96abfdb9d7 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -1263,6 +1263,13 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
#endif // !QT_NO_SHORTCUT
key_recorder.storeKey(int(msg.wParam), a, state, text);
+ // QTBUG-71210
+ // VK_PACKET specifies multiple characters. The system only sends the first
+ // character of this sequence for each.
+ if (msg.wParam == VK_PACKET)
+ code = asciiToKeycode(char(uch.cell()), state);
QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyPress, code,
modifiers, scancode, quint32(msg.wParam), nModifiers, text, false);
result =true;