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 <QLoggingCategory>
23
24#include <private/qglobal_p.h>
25
26#include <memory>
27
29
30Q_DECLARE_LOGGING_CATEGORY(qLcEvdevMouse)
31
32class QSocketNotifier;
33
35{
37public:
38 static std::unique_ptr<QEvdevMouseHandler> create(const QString &device, const QString &specification);
40
41 void readMouseData();
42
44 void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
47
48private:
49 QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit);
50
51 void sendMouseEvent();
52 bool getHardwareMaximum();
53 void detectHiResWheelSupport();
54
55 QString m_device;
56 int m_fd;
57 QSocketNotifier *m_notify = nullptr;
58 int m_x = 0, m_y = 0;
59 int m_prevx = 0, m_prevy = 0;
60 bool m_abs;
61 bool m_compression;
62 bool m_hiResWheel = false;
63 bool m_hiResHWheel = false;
64 Qt::MouseButtons m_buttons;
65 Qt::MouseButton m_button;
66 QEvent::Type m_eventType;
67 int m_jitterLimitSquared;
68 bool m_prevInvalid = true;
69 int m_hardwareWidth;
70 int m_hardwareHeight;
71 qreal m_hardwareScalerY;
72 qreal m_hardwareScalerX;
73};
74
76
77#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
#define Q_DECLARE_LOGGING_CATEGORY(name)
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()