Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qevdevmousehandler_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QEVDEVMOUSEHANDLER_P_H
5#define QEVDEVMOUSEHANDLER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QObject>
19#include <QString>
20#include <QPoint>
21#include <QEvent>
22#include <QLoggingCategory>
23
24#include <private/qglobal_p.h>
25
26#include <memory>
27
29
31
32class QSocketNotifier;
33
35{
37public:
40
41 void readMouseData();
42
44 void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
46 void handleWheelEvent(QPoint delta);
47
48private:
49 QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit);
50
51 void sendMouseEvent();
52#ifndef Q_OS_VXWORKS
53 bool getHardwareMaximum();
54#endif
55 void detectHiResWheelSupport();
56
57 QString m_device;
58 int m_fd;
59 QSocketNotifier *m_notify = nullptr;
60 int m_x = 0, m_y = 0;
61 int m_prevx = 0, m_prevy = 0;
62 bool m_abs;
63 bool m_compression;
64 bool m_hiResWheel = false;
65 bool m_hiResHWheel = false;
66 Qt::MouseButtons m_buttons;
67 Qt::MouseButton m_button;
68 QEvent::Type m_eventType;
69 int m_jitterLimitSquared;
70 bool m_prevInvalid = true;
71 int m_hardwareWidth;
72 int m_hardwareHeight;
73 qreal m_hardwareScalerY;
74 qreal m_hardwareScalerX;
75};
76
77QT_END_NAMESPACE
78
79#endif // QEVDEVMOUSEHANDLER_P_H
void handleWheelEvent(QPoint delta)
#define TEST_BIT(array, bit)
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
#define SYN_REPORT
#define BTN_TOUCH
#define EV_ABS
#define ABS_Y
#define ABS_MAX
#define EV_KEY
#define ABS_X
#define EV_SYN