diff options
author | Bernd Weimer <bernd.weimer@qt.io> | 2023-07-11 10:52:20 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-07-12 07:09:20 +0000 |
commit | b8eff8bab058f677124c65879c28ec85dd1a1c21 (patch) | |
tree | 3695e89205c66d7c713884426b2804d94b24de93 /src | |
parent | da0fb8c0df9dc0b9591eab2a48780187a84d627a (diff) |
Fix injecting key events in QML tests
Since QTBUG-110268 was fixed, injected key events by the TestCase
QML type take a different code path and don't go through
sendFullKeyEvent() any more that would map the key to a proper scan
code, if not provided. The mapping has been added to the new path,
as well.
Fixes: QTBUG-115112
Change-Id: I79c7e7813b380daf586916eeca68acc4ab392872
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit fee9011f88e385081a211505067e7d83d4b8d66c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor/compositor_api/qwaylandcompositor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index a6d43a810..c8d4d80eb 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -101,6 +101,8 @@ public: ke->nativeScanCode += offset; #endif uint32_t code = ke->nativeScanCode; + if (code == 0) + code = seat->keyboard()->keyToScanCode(ke->key); bool isDown = ke->keyType == QEvent::KeyPress; #if QT_CONFIG(xkbcommon) |