Fixed assert in Windows key handling
authorOliver Wolff <oliver.wolff@digia.com>
Tue, 19 Nov 2013 11:47:03 +0000 (12:47 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 27 Nov 2013 07:04:46 +0000 (08:04 +0100)
commit0af360cff29fbc1182d3553255091de2cc673194
tree6a1568294c8d3ed6767b3778c33e7325bb35ab08
parent157da36977213237939df14608753bb3ec280f0b
Fixed assert in Windows key handling

Certain key sequences (like press alt, press left, release left,
release alt) can cause an assert in qwindowskeymapper. This
behavior was introduced in change
I4f7709a90906b03f4504deea1ff5c361e9f94b3f (Fix virtual key
mapping on MS Windows). The place that seems to cause the new
behavior is changing the bitmask for obtaining the event's scancode.

With the changed bitmask releasing the alt key in the given
key sequence causes the WM_KEYUP event to trigger a WM_CHAR event
which should not happen there. To be honest I don't know how having
the extended bit inside the scancode fixes the behavior but it seems
to do and I could not find another place which might cause the
breakage.

Task-number: QTBUG-35005
Change-Id: Ia18c2681ea311196441a5cd15017e220ac095674
(cherry picked from commit d4c548ce5c0bd8a70c82ed082bc69fd41e9c47ed)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Juan Luis Boya GarcĂ­a <ntrrgc@gmail.com>
src/gui/kernel/qkeymapper_win.cpp