diff --git a/src/kcms/xwayland/ui/main.qml b/src/kcms/xwayland/ui/main.qml index 366cc44495..34d0422d8a 100644 --- a/src/kcms/xwayland/ui/main.qml +++ b/src/kcms/xwayland/ui/main.qml @@ -68,7 +68,7 @@ KCM.SimpleKCM { text: i18n("Only non-character keys") } QQC2.RadioButton { - text: i18n("As above, plus any key typed while a modifier key is pressed") + text: i18n("As above, plus any key typed while the Control, Alt, or Meta keys are pressed") } QQC2.RadioButton { id: always diff --git a/src/xwayland/xwayland.cpp b/src/xwayland/xwayland.cpp index 9c989343ef..64b6ec9451 100644 --- a/src/xwayland/xwayland.cpp +++ b/src/xwayland/xwayland.cpp @@ -110,11 +110,10 @@ public: void setMode(XwaylandEavesdropsMode mode) { - static const QSet modifierKeys = { - Qt::Key_Control, - Qt::Key_Shift, - Qt::Key_Alt, - Qt::Key_Meta, + static const Qt::KeyboardModifiers modifierKeys = { + Qt::ControlModifier, + Qt::AltModifier, + Qt::MetaModifier, }; static const QSet characterKeys = { @@ -347,9 +346,7 @@ public: break; case AllKeysWithModifier: m_filter = [](int key, Qt::KeyboardModifiers m) { - return m != Qt::NoModifier - || modifierKeys.contains(key) - || !characterKeys.contains(key); + return m.testAnyFlags(modifierKeys) || !characterKeys.contains(key); }; break; case All: