Ported Qt 4 fix when getting an invalid native key on Windows

Task-number: QTBUG-36061
Change-Id: Ibde65735d861af4e1ef768e9e4314d30fed534a1
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
This commit is contained in:
Samuel Gaist 2016-03-09 23:16:29 +01:00
parent ac8dae8b5e
commit cf827f2167

View File

@ -1247,7 +1247,12 @@ QList<int> QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const
{
QList<int> result;
const KeyboardLayoutItem &kbItem = keyLayout[e->nativeVirtualKey()];
const quint32 nativeVirtualKey = e->nativeVirtualKey();
if (nativeVirtualKey > 255)
return result;
const KeyboardLayoutItem &kbItem = keyLayout[nativeVirtualKey];
if (!kbItem.exists)
return result;