7#include <QSocketNotifier>
8#include <QGuiApplication>
9#include <QPointingDevice>
10#include <QLoggingCategory>
11#include <QtCore/private/qcore_unix_p.h>
12#include <qpa/qwindowsysteminterface.h>
14#include <dev/evdev/input.h>
16#include <linux/input.h>
30 void processInputEvent(input_event *ev);
38 } minValues, maxValues;
48 :
q(q_ptr), lastEventType(0)
52 memset(
static_cast<void *
>(&
state), 0,
sizeof(
state));
57 if (ev->type == EV_ABS) {
74 }
else if (ev->type == EV_KEY) {
81 state.down = ev->value != 0;
92 }
else if (ev->type == EV_SYN && ev->code == SYN_REPORT &&
lastEventType != ev->type) {
107 QPointF globalPos(
nx * winRect.width(),
ny * winRect.height());
111 globalPos =
state.lastReportPos;
122 pressure, 0, 0, 0, 0, 0,
q->deviceId(),
131 state.lastReportPos = globalPos;
136 :
QObject(parent), m_fd(-1), m_device(
device), m_notifier(0),
d(0)
144 m_fd =
QT_OPEN(
device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
150 bool grabSuccess = !ioctl(m_fd, EVIOCGRAB, (
void *) 1);
152 ioctl(m_fd, EVIOCGRAB, (
void *) 0);
177bool QEvdevTabletHandler::queryLimits()
180 input_absinfo absInfo;
181 memset(&absInfo, 0,
sizeof(input_absinfo));
182 ok &= ioctl(m_fd, EVIOCGABS(ABS_X), &absInfo) >= 0;
189 ok &= ioctl(m_fd, EVIOCGABS(ABS_Y), &absInfo) >= 0;
196 if (ioctl(m_fd, EVIOCGABS(ABS_PRESSURE), &absInfo) >= 0) {
202 if (ioctl(m_fd, EVIOCGABS(ABS_DISTANCE), &absInfo) >= 0) {
209 if (ioctl(m_fd, EVIOCGNAME(
sizeof(
name) - 1),
name) >= 0) {
226 if (errno != EINTR && errno != EAGAIN) {
228 if (errno == ENODEV) {
238 if (
n %
sizeof(input_event) == 0)
243 n /=
sizeof(input_event);
245 for (
int i = 0;
i <
n; ++
i)
251 : QDaemonThread(parent), m_device(
device), m_spec(spec), m_handler(0)
IOBluetoothDevice * device
struct QEvdevTabletData::@417 state
void processInputEvent(input_event *ev)
struct QEvdevTabletData::@416 minValues
struct QEvdevTabletData::@416 maxValues
QEvdevTabletData(QEvdevTabletHandler *q_ptr)
QEvdevTabletHandlerThread(const QString &device, const QString &spec, QObject *parent=nullptr)
~QEvdevTabletHandlerThread()
QEvdevTabletHandler(const QString &device, const QString &spec=QString(), QObject *parent=nullptr)
QScreen * primaryScreen
the primary (or default) screen of the application.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QRect geometry
the screen's geometry in pixels
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static bool handleTabletEvent(QWindow *window, ulong timestamp, const QPointingDevice *device, const QPointF &local, const QPointF &global, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
static bool handleTabletLeaveProximityEvent(ulong timestamp, int deviceType, int pointerType, qint64 uid)
static bool handleTabletEnterProximityEvent(ulong timestamp, int deviceType, int pointerType, qint64 uid)
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLint GLint GLint GLint GLint x
[0]
GLsizei const void * pointer
GLdouble GLdouble GLdouble GLdouble q
#define qUtf16Printable(string)