summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@digia.com>2013-12-16 13:56:59 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-10 06:49:45 (GMT)
commitf6002697ece87a99c52b32872194fc8217579e17 (patch)
tree0cebb88032f5420d40751a0b4165773e1b67ac14
parent0cc34cf0f4e9b64f3efa21ec57e7e27f4a6d879e (diff)
downloadQt-f6002697ece87a99c52b32872194fc8217579e17.zip
Qt-f6002697ece87a99c52b32872194fc8217579e17.tar.gz
Qt-f6002697ece87a99c52b32872194fc8217579e17.tar.bz2
Fixed another assert in qwindowskeymapper
When we get a WM_CHAR message we do not need to add anything to the key map as these messages already contain the character code in question. Task-number: QTBUG-35532 Change-Id: If73993cd873b7c616876b9ba52ceba6b27a6a7b1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> (cherry picked from commit 8e2f95e5a2ebc54c600d1db416b1dd84e433d115)
-rw-r--r--src/gui/kernel/qkeymapper_win.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp
index 159c47d..b88186e 100644
--- a/src/gui/kernel/qkeymapper_win.cpp
+++ b/src/gui/kernel/qkeymapper_win.cpp
@@ -803,8 +803,11 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool
bool k0 = false;
bool k1 = false;
int msgType = msg.message;
- // Add this key to the keymap if it is not present yet.
- updateKeyMap(msg);
+ // WM_CHAR messages already contain the character in question so there is
+ // no need to fiddle with our key map. In any other case add this key to the
+ // keymap if it is not present yet.
+ if (msg.message != WM_CHAR)
+ updateKeyMap(msg);
const quint32 scancode = (msg.lParam >> 16) & scancodeBitmask;
const quint32 vk_key = msg.wParam;