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