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
qinputdevice.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 QINPUTDEVICE_H
5#define QINPUTDEVICE_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qobject.h>
9#include <QtGui/qscreen.h>
10
12
13class QDebug;
15
16class Q_GUI_EXPORT QInputDevice : public QObject
17{
19 Q_DECLARE_PRIVATE(QInputDevice)
20 Q_PROPERTY(QString name READ name CONSTANT)
22 Q_PROPERTY(Capabilities capabilities READ capabilities CONSTANT)
23 Q_PROPERTY(qint64 systemId READ systemId CONSTANT)
24 Q_PROPERTY(QString seatName READ seatName CONSTANT)
25 Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry
26 NOTIFY availableVirtualGeometryChanged)
27
28public:
29 enum class DeviceType {
30 Unknown = 0x0000,
31 Mouse = 0x0001,
32 TouchScreen = 0x0002,
33 TouchPad = 0x0004,
34 Puck = 0x0008,
35 Stylus = 0x0010,
36 Airbrush = 0x0020,
37 Keyboard = 0x1000,
38 AllDevices = 0x7FFFFFFF
39 };
40 Q_DECLARE_FLAGS(DeviceTypes, DeviceType)
41 Q_FLAG(DeviceTypes)
42
43 enum class Capability {
44 None = 0,
45 Position = 0x0001,
46 Area = 0x0002,
47 Pressure = 0x0004,
48 Velocity = 0x0008,
49 NormalizedPosition = 0x0020,
50 MouseEmulation = 0x0040,
51 PixelScroll = 0x0080,
52 Scroll = 0x0100,
53 Hover = 0x0200,
54 Rotation = 0x0400,
55 XTilt = 0x0800,
56 YTilt = 0x1000,
57 TangentialPressure = 0x2000,
58 ZPosition = 0x4000,
59 All = 0x7FFFFFFF
60 };
61 Q_DECLARE_FLAGS(Capabilities, Capability)
62 Q_FLAG(Capabilities)
63
64 QInputDevice(QObject *parent = nullptr);
66 QInputDevice(const QString &name, qint64 systemId, DeviceType type,
67 const QString &seatName = QString(), QObject *parent = nullptr);
68
69 QString name() const;
70 DeviceType type() const;
71 Capabilities capabilities() const;
72 bool hasCapability(Capability cap) const;
73 qint64 systemId() const;
74 QString seatName() const;
75 QRect availableVirtualGeometry() const;
76
77 static QStringList seatNames();
78 static QList<const QInputDevice *> devices();
79 static const QInputDevice *primaryKeyboard(const QString& seatName = QString());
80
81 bool operator==(const QInputDevice &other) const;
82
85
86protected:
88
89 Q_DISABLE_COPY_MOVE(QInputDevice)
90};
91
92Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDevice::DeviceTypes)
93Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDevice::Capabilities)
94
95#ifndef QT_NO_DEBUG_STREAM
96Q_GUI_EXPORT QDebug operator<<(QDebug, const QInputDevice *);
97#endif
98
100
101#endif // QINPUTDEVICE_H
\inmodule QtCore
The QInputDevice class describes a device from which a QInputEvent originates.
DeviceType
This enum represents the type of device that generated a QPointerEvent.
Capability
Indicates what kind of information the input device or its driver can provide.
void availableVirtualGeometryChanged(QRect area)
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
@ Keyboard
EGLDeviceEXT * devices
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
@ None
Definition qhash.cpp:531
static int area(const QSize &s)
Definition qicon.cpp:153
Q_GUI_EXPORT QDebug operator<<(QDebug, const QInputDevice *)
GLenum type
GLuint name
GLenum cap
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_FLAG(x)
#define Q_SIGNALS
long long qint64
Definition qtypes.h:60
QSharedPointer< T > other(t)
[5]