diff options
author | Bernd Weimer <bernd.weimer@qt.io> | 2023-07-11 10:52:20 +0200 |
---|---|---|
committer | Bernd Weimer <bernd.weimer@qt.io> | 2023-07-12 08:15:10 +0200 |
commit | fee9011f88e385081a211505067e7d83d4b8d66c (patch) | |
tree | ffcb8e4d8bbe00e1e79c6b2833d22e57b24ecd15 /src/compositor | |
parent | 742a00ccaed5ca3a4ad5a791ccd3685c001162c1 (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
Pick-to: 6.6 6.5
Change-Id: I79c7e7813b380daf586916eeca68acc4ab392872
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/compositor')
-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) |