diff options
author | Liang Qi <liang.qi@qt.io> | 2019-07-30 13:47:36 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-07-30 13:47:36 +0200 |
commit | 71ec1d6d79c16c46837dbd10f1cd2a53027a6682 (patch) | |
tree | 5008d058a0ea3ef379c36ad2364d9b2bc78f3aaf /src/plugins/platforms/windows | |
parent | 31753adebe0f19b90f332e81e1a9b063b40f982d (diff) | |
parent | 75f51d2f40746205484b969a72a56d75d5d8ff39 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
qmake/generators/win32/mingw_make.cpp
Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowskeymapper.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 4b54051e0c..4f0f846749 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -1301,7 +1301,23 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg, || code == Qt::Key_Control || code == Qt::Key_Meta || code == Qt::Key_Alt)) { - // Someone ate the key down event + + // Workaround for QTBUG-77153: + // The Surface Pen eraser button generates Meta+F18/19/20 keystrokes, + // but when it is not touching the screen the Fn Down is eaten and only + // a Fn Up with the previous state as "not pressed" is generated, which + // would be ignored. We detect this case and synthesize the expected events. + if ((msg.lParam & 0x40000000) == 0 && + Qt::KeyboardModifier(state) == Qt::NoModifier && + ((code == Qt::Key_F18) || (code == Qt::Key_F19) || (code == Qt::Key_F20))) { + QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyPress, code, + Qt::MetaModifier, scancode, + quint32(msg.wParam), MetaLeft); + QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyRelease, code, + Qt::NoModifier, scancode, + quint32(msg.wParam), 0); + result = true; + } } else { if (!code) code = asciiToKeycode(rec->ascii ? char(rec->ascii) : char(msg.wParam), state); |