Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 <private/qglobal_p.h>
23
24#include <memory>
25
27
28class QSocketNotifier;
29
31{
33public:
34 static std::unique_ptr<QEvdevMouseHandler> create(const QString &device, const QString &specification);
36
37 void readMouseData();
38
40 void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
43
44private:
45 QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit);
46
47 void sendMouseEvent();
48 bool getHardwareMaximum();
49 void detectHiResWheelSupport();
50
51 QString m_device;
52 int m_fd;
53 QSocketNotifier *m_notify = nullptr;
54 int m_x = 0, m_y = 0;
55 int m_prevx = 0, m_prevy = 0;
56 bool m_abs;
57 bool m_compression;
58 bool m_hiResWheel = false;
59 bool m_hiResHWheel = false;
60 Qt::MouseButtons m_buttons;
61 Qt::MouseButton m_button;
62 QEvent::Type m_eventType;
63 int m_jitterLimitSquared;
64 bool m_prevInvalid = true;
65 int m_hardwareWidth;
66 int m_hardwareHeight;
67 qreal m_hardwareScalerY;
68 qreal m_hardwareScalerX;
69};
70
72
73#endif // QEVDEVMOUSEHANDLER_P_H
IOBluetoothDevice * device
void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons, Qt::MouseButton button, QEvent::Type type)
void handleWheelEvent(QPoint delta)
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QPushButton * button
[2]
Combined button and popup list for selecting options.
MouseButton
Definition qnamespace.h:56
GLint GLint GLint GLint GLint x
[0]
GLenum type
GLuint64 GLenum GLint fd
GLint y
#define Q_OBJECT
#define signals
double qreal
Definition qtypes.h:187
view create()