From c6ecbd4762dd753d34a8ed36bbb4ef3885a2f0fe Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 25 Jan 2017 23:58:26 +0100 Subject: 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 --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows') 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)) -- cgit v1.2.3