From d58b2a2ff81e3ee0c6888ce7eb7268603d4e72d4 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 26 May 2021 14:49:40 +0200 Subject: [PATCH 08/49] Hook up queryKeyboardModifers Can be useful when upon enter a modifiers event is received but no key event so no QKeyEvent is generated. Fixes: QTBUG-62786 Change-Id: I30b57fc78ce6d54d8f644ca95ba40e7e26eb24ed Reviewed-by: Marco Martin Reviewed-by: David Edmundson (cherry picked from commit 4fa2baba8181ade4958a94e9531ec4f6919438a9) --- src/client/qwaylandintegration.cpp | 8 ++++++++ src/client/qwaylandintegration_p.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index c53ccb78..e5e7dd42 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -262,6 +262,14 @@ QWaylandDisplay *QWaylandIntegration::display() const return mDisplay.data(); } +Qt::KeyboardModifiers QWaylandIntegration::queryKeyboardModifiers() const +{ + if (auto *seat = mDisplay->currentInputDevice()) { + return seat->modifiers(); + } + return Qt::NoModifier; +} + QList QWaylandIntegration::possibleKeys(const QKeyEvent *event) const { if (auto *seat = mDisplay->currentInputDevice()) diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index ff70ae25..73b80658 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -107,6 +107,8 @@ public: QWaylandDisplay *display() const; + Qt::KeyboardModifiers queryKeyboardModifiers() const override; + QList possibleKeys(const QKeyEvent *event) const override; QStringList themeNames() const override; -- 2.37.3