6#include <QtInputSupport/private/qevdevutil_p.h>
9#include <QGuiApplication>
11#include <QLoggingCategory>
12#include <qpa/qwindowsysteminterface.h>
13#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
14#include <private/qguiapplication_p.h>
15#include <private/qinputdevicemanager_p_p.h>
16#include <private/qhighdpiscaling_p.h>
35 m_spec = std::move(parsed.spec);
37 for (
const auto &
arg : std::as_const(parsed.args)) {
38 if (
arg.startsWith(
"xoffset="_L1)) {
39 m_xoffset =
arg.mid(8).toInt();
40 }
else if (
arg.startsWith(
"yoffset="_L1)) {
41 m_yoffset =
arg.mid(8).toInt();
49 if (parsed.devices.isEmpty()) {
50 qCDebug(qLcEvdevMouse,
"evdevmouse: Using device discovery");
76void QEvdevMouseManager::clampPosition()
81 if (m_x + m_xoffset <
g.left())
82 m_x =
g.left() - m_xoffset;
83 else if (m_x + m_xoffset >
g.right())
84 m_x =
g.right() - m_xoffset;
86 if (m_y + m_yoffset <
g.top())
87 m_y =
g.top() - m_yoffset;
88 else if (m_y + m_yoffset >
g.bottom())
89 m_y =
g.bottom() - m_yoffset;
106 QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
114 QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
127 m_mice.
add(deviceNode, std::move(handler));
136 if (m_mice.
remove(deviceNode)) {
142void QEvdevMouseManager::updateDeviceCount()
IOBluetoothDevice * device
void deviceDetected(const QString &deviceNode)
static QDeviceDiscovery * create(QDeviceTypes type, QObject *parent=nullptr)
void deviceRemoved(const QString &deviceNode)
void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons, Qt::MouseButton button, QEvent::Type type)
static std::unique_ptr< QEvdevMouseHandler > create(const QString &device, const QString &specification)
void handleWheelEvent(QPoint delta)
void addMouse(const QString &deviceNode=QString())
void removeMouse(const QString &deviceNode)
void handleWheelEvent(QPoint delta)
void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons, Qt::MouseButton button, QEvent::Type type)
Type
This enum type defines the valid event types in Qt.
static QInputDeviceManager * inputDeviceManager()
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
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect virtualGeometry
the pixel geometry of the virtual desktop to which this screen belongs
\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...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
ParsedSpecification parseSpecification(const QString &specification)
T toNativePixels(const T &value, const C *context)
Combined button and popup list for selecting options.
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLint GLint GLint GLint GLint x
[0]
#define qUtf16Printable(string)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QNetworkAccessManager manager
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent