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#include <xcb/xproto.h>
35enum QSpiKeyEventType {
37 QSPI_KEY_EVENT_RELEASE,
38 QSPI_KEY_EVENT_LAST_DEFINED
44 qApp->installEventFilter(
this);
46 qApp->removeEventFilter(
this);
53 if (!
event->spontaneous())
56 switch (
event->type()) {
69 de.
type = QSPI_KEY_EVENT_PRESS;
71 de.
type = QSPI_KEY_EVENT_RELEASE;
127 de.
modifiers |= 1 << ATSPI_MODIFIER_SHIFT;
130 de.
modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK;
132 de.
modifiers |= 1 << ATSPI_MODIFIER_CONTROL;
136 de.
modifiers |= 1 << ATSPI_MODIFIER_META;
139 qDebug() <<
"Key event text:" <<
event->type() << de.
text
140 <<
"native virtual key:" << de.
id
143 <<
"text:" << de.
text;
176 if (!keyEvents.
size()) {
177 qWarning(
"QSpiApplication::notifyKeyboardListenerCallback with no queued key called");
181 if (
message.arguments().at(0).toBool() ==
true) {
203#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.
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
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.
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)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent