7#include <QtCore/qcoreapplication.h>
8#include <QtDBus/qdbuspendingreply.h>
11#if QT_CONFIG(accessibility)
12#include "deviceeventcontroller_adaptor.h"
13#include "atspi/atspi-constants.h"
15#if __has_include(<xcb/xproto.h>)
16#include <xcb/xproto.h>
39enum QSpiKeyEventType {
41 QSPI_KEY_EVENT_RELEASE,
42 QSPI_KEY_EVENT_LAST_DEFINED
48 qApp->installEventFilter(
this);
50 qApp->removeEventFilter(
this);
57 if (!
event->spontaneous())
60 switch (
event->type()) {
73 de.
type = QSPI_KEY_EVENT_PRESS;
75 de.type = QSPI_KEY_EVENT_RELEASE;
123 de.text = keyEvent->
text();
127 de.isText = !de.text.
isEmpty();
131 de.modifiers |= 1 << ATSPI_MODIFIER_SHIFT;
132#ifdef XCB_MOD_MASK_LOCK
136 de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK;
140 de.modifiers |= 1 << ATSPI_MODIFIER_CONTROL;
142 de.modifiers |= 1 << ATSPI_MODIFIER_ALT;
144 de.modifiers |= 1 << ATSPI_MODIFIER_META;
147 qDebug() <<
"Key event text:" <<
event->type() << de.text
148 <<
"native virtual key:" << de.id
149 <<
"hardware code/scancode:" << de.hardwareCode
150 <<
"modifiers:" << de.modifiers
151 <<
"text:" << de.text;
184 if (!keyEvents.
size()) {
185 qWarning(
"QSpiApplication::notifyKeyboardListenerCallback with no queued key called");
189 if (
message.arguments().at(0).toBool() ==
true) {
211#include "moc_qspiapplicationadaptor_p.cpp"
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
bool callWithCallback(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout=-1) const
Sends the message over this connection and returns immediately.
static QDBusMessage createMethodCall(const QString &destination, const QString &path, const QString &interface, const QString &method)
Constructs a new DBus message representing a method call.
static qint64 currentMSecsSinceEpoch() noexcept
Type type() const
Returns the event type.
QString platformName
The name of the underlying platform plugin.
The QKeyEvent class describes a key event.
int count() const
Returns the number of keys involved in this event.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
quint32 nativeScanCode() const
QString text() const
Returns the Unicode text that this key generated.
quint32 nativeVirtualKey() const
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
quint32 nativeModifiers() const
int key() const
Returns the code of the key that was pressed or released.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void enqueue(const T &t)
Adds value t to the tail of the queue.
T dequeue()
Removes the head item in the queue and returns it.
QSpiApplicationAdaptor(const QDBusConnection &connection, QObject *parent)
bool eventFilter(QObject *obj, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void sendEvents(bool active)
void windowActivated(QObject *window, bool active)
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Combined button and popup list for selecting options.
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
std::pair< T1, T2 > QPair
DBusConnection const char DBusError * error
DBusConnection * connection
QList< QVariant > QVariantList
GLbitfield GLuint64 timeout
[4]
GLuint GLsizei const GLchar * message
#define QStringLiteral(str)