a11y: fix the build without xcb headers
This amends 6802065da8706f1fc298a56b9f66ab8a815400d3 . Pure Wayland runtime and build envs without X11/xcb are more common. Need to find solution for ATSPI_MODIFIER_SHIFTLOCK on Wayland later. Pick-to: 6.5 Task-number: QTBUG-117535 Change-Id: I65d41546e3dbb86c3a939a496ed43ac1737cf539 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2ad3da8fce1bd31c3b4e970a505a051b7104765a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f4b91d595c
commit
b3cd75fde7
@ -12,12 +12,16 @@
|
|||||||
#include "deviceeventcontroller_adaptor.h"
|
#include "deviceeventcontroller_adaptor.h"
|
||||||
#include "atspi/atspi-constants.h"
|
#include "atspi/atspi-constants.h"
|
||||||
|
|
||||||
|
#if __has_include(<xcb/xproto.h>)
|
||||||
#include <xcb/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//#define KEYBOARD_DEBUG
|
//#define KEYBOARD_DEBUG
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::Literals::StringLiterals;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QSpiApplicationAdaptor
|
\class QSpiApplicationAdaptor
|
||||||
\internal
|
\internal
|
||||||
@ -125,9 +129,13 @@ bool QSpiApplicationAdaptor::eventFilter(QObject *target, QEvent *event)
|
|||||||
de.modifiers = 0;
|
de.modifiers = 0;
|
||||||
if ((keyEvent->modifiers() & Qt::ShiftModifier) && (keyEvent->key() != Qt::Key_Shift))
|
if ((keyEvent->modifiers() & Qt::ShiftModifier) && (keyEvent->key() != Qt::Key_Shift))
|
||||||
de.modifiers |= 1 << ATSPI_MODIFIER_SHIFT;
|
de.modifiers |= 1 << ATSPI_MODIFIER_SHIFT;
|
||||||
// TODO rather introduce Qt::CapslockModifier into KeyboardModifier
|
#ifdef XCB_MOD_MASK_LOCK
|
||||||
if (keyEvent->nativeModifiers() & XCB_MOD_MASK_LOCK )
|
if (QGuiApplication::platformName().startsWith("xcb"_L1)) {
|
||||||
de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK;
|
// TODO rather introduce Qt::CapslockModifier into KeyboardModifier
|
||||||
|
if (keyEvent->nativeModifiers() & XCB_MOD_MASK_LOCK )
|
||||||
|
de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if ((keyEvent->modifiers() & Qt::ControlModifier) && (keyEvent->key() != Qt::Key_Control))
|
if ((keyEvent->modifiers() & Qt::ControlModifier) && (keyEvent->key() != Qt::Key_Control))
|
||||||
de.modifiers |= 1 << ATSPI_MODIFIER_CONTROL;
|
de.modifiers |= 1 << ATSPI_MODIFIER_CONTROL;
|
||||||
if ((keyEvent->modifiers() & Qt::AltModifier) && (keyEvent->key() != Qt::Key_Alt))
|
if ((keyEvent->modifiers() & Qt::AltModifier) && (keyEvent->key() != Qt::Key_Alt))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user