From 6857cd60dd884a763af26e43863187e9157fe32c Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 6 Nov 2018 11:03:42 +0100 Subject: 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 --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- cgit v1.2.3