diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-01-25 23:58:26 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-01-27 16:15:50 +0000 |
commit | c6ecbd4762dd753d34a8ed36bbb4ef3885a2f0fe (patch) | |
tree | 36cac36cbaa1ade4708b170ece73bb98585e8062 /src/plugins/platforms/windows | |
parent | 9c9edaa6f59c83d2f4c9d964f5d78420c5b5ac0e (diff) |
Win: If the combined key is unknown then fall back to the original key pressed
When pressing a combination of keys it is possible that it ends up being
seen as a Key_unknown and as a result it can give strange results when
used. Therefore if the key is Key_unknown in that case then it should
fallback to the unmodified key. For example on a French keyboard, this
means it will correctly allow CTRL+< as a shortcut instead of showing
it as CTRL+\.
Task-number: QTBUG-58304
Change-Id: Iae4c11a1e6e2d4343134ed1e3f9049b6df2613af
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowskeymapper.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 6375f89531..c2b1df26f8 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -970,7 +970,8 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms state = state ^ Qt::ShiftModifier; else if (code == Qt::Key_Alt) state = state ^ Qt::AltModifier; - + else if (code == 0 && modifiersIndex != 0) + code = keyLayout[vk_key].qtKey[0]; // If the bit 24 of lParm is set you received a enter, // otherwise a Return. (This is the extended key bit) if ((code == Qt::Key_Return) && (msg.lParam & 0x1000000)) |