DtkDevice
DTK library for device.
dinputdevicetrackpoint.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DINPUTDEVICETRACKPOINT_H
6#define DINPUTDEVICETRACKPOINT_H
8#include "dtkdevice_global.h"
9#include <DExpected>
10#include <QObject>
11DDEVICE_BEGIN_NAMESPACE
12using DCORE_NAMESPACE::DExpected;
13class DInputDeviceTrackPointPrivate;
14class LIBDTKDEVICESHARED_EXPORT DInputDeviceTrackPoint : public DInputDevicePointer
15{
16 Q_OBJECT
17 Q_PROPERTY(bool middleButtonEnabled READ middleButtonEnabled WRITE setMiddleButtonEnabled NOTIFY middleButtonEnabledChanged)
18 Q_PROPERTY(qint32 middleButtonTimeout READ middleButtonTimeout WRITE setMiddleButtonTimeout NOTIFY middleButtonTimeoutChanged)
19 Q_PROPERTY(bool wheelEmulation READ wheelEmulation WRITE setWheelEmulation NOTIFY wheelEmulationChanged)
20 Q_PROPERTY(
21 qint32 wheelEmulationButton READ wheelEmulationButton WRITE setWheelEmulationButton NOTIFY wheelEmulationButtonChanged)
22 Q_PROPERTY(qint32 wheelEmulationTimeout READ wheelEmulationTimeout WRITE setWheelEmulationTimeout NOTIFY
23 wheelEmulationTimeoutChanged)
24 Q_PROPERTY(
25 bool wheelHorizontalScroll READ wheelHorizontalScroll WRITE setWheelHorizontalScroll NOTIFY wheelHorizontalScrollChanged)
26
27public:
28 ~DInputDeviceTrackPoint() override;
29
30 bool middleButtonEnabled() const;
31 qint32 middleButtonTimeout() const;
32 bool wheelEmulation() const;
33 qint32 wheelEmulationButton() const;
34 qint32 wheelEmulationTimeout() const;
36
37 void setMiddleButtonEnabled(bool enabled);
38 void setMiddleButtonTimeout(qint32 timeout);
39 void setWheelEmulation(bool emulation);
40 void setWheelEmulationButton(qint32 button);
41 void setWheelEmulationTimeout(qint32 timeout);
42 void setWheelHorizontalScroll(bool horizontalScroll);
43
44 bool leftHanded() const override;
45 ScrollMethod scrollMethod() const override;
47 double accelerationSpeed() const override;
48 void setLeftHanded(bool leftHanded) override;
49 void setScrollMethod(ScrollMethod scrollMethod) override;
50 void setAccelerationProfile(AccelerationProfile accelerationProfile) override;
51 void setAccelerationSpeed(double accelerationSpeed) override;
52
53Q_SIGNALS:
54
55 void middleButtonEnabledChanged(bool enabled);
56 void middleButtonTimeoutChanged(qint32 timeout);
57 void wheelEmulationChanged(bool emulation);
58 void wheelEmulationButtonChanged(qint32 button);
59 void wheelEmulationTimeoutChanged(qint32 timeout);
60 void wheelHorizontalScrollChanged(bool horizontalScroll);
61
62public Q_SLOTS:
63 DExpected<void> reset() override;
64
65protected:
66 DInputDeviceTrackPoint(const DeviceInfo &info = DeviceInfoInitializer, bool enabled = true, QObject *parent = nullptr);
67
68private:
69 friend class DInputDeviceManager;
70 D_DECLARE_PRIVATE(DInputDeviceTrackPoint)
71};
72DDEVICE_END_NAMESPACE
73#endif // DINPUTDEVICETRACKPOINT_H
Manager类
Definition: dinputdevicemanager.h:27
抽象指针设备类
Definition: dinputdevicepointer.h:20
指针杆设备类(小红点)
Definition: dinputdevicetrackpoint.h:15
void middleButtonEnabledChanged(bool enabled)
是否启用中键模拟改变信号
double accelerationSpeed() const override
获取指针加速度
qint32 middleButtonTimeout() const
获取中键模拟超时时间
DInputDeviceTrackPoint(const DeviceInfo &info=DeviceInfoInitializer, bool enabled=true, QObject *parent=nullptr)
空参构造函数和指定父对象的构造函数
void setMiddleButtonEnabled(bool enabled)
设置是否启用中键模拟
void wheelEmulationButtonChanged(qint32 button)
滚轮模拟修饰键改变信号
bool wheelHorizontalScroll() const
获取是否开启水平滚动
bool wheelEmulation() const
获取是否开启滚轮模拟
void setWheelHorizontalScroll(bool horizontalScroll)
设置是否开启水平滚动
ScrollMethod scrollMethod() const override
获取当前滚动模式
void setWheelEmulationTimeout(qint32 timeout)
设置滚轮模拟超时时间
AccelerationProfile accelerationProfile() const override
获取当前的指针加速方式
void setLeftHanded(bool leftHanded) override
设置是否是左手模式
void wheelEmulationTimeoutChanged(qint32 timeout)
滚轮模拟超时时间改变信号
void wheelEmulationChanged(bool emulation)
是否开启滚轮模拟改变信号
void setAccelerationProfile(AccelerationProfile accelerationProfile) override
设置指针加速方式
void setScrollMethod(ScrollMethod scrollMethod) override
设置滚动模式
void setAccelerationSpeed(double accelerationSpeed) override
设置指针加速度
void setWheelEmulationButton(qint32 button)
设置滚轮模拟修饰键
void setWheelEmulation(bool emulation)
设置是否开启滚轮模拟
qint32 wheelEmulationTimeout() const
获取滚轮模拟触发超时时间
DExpected< void > reset() override
重置指针杆的所有设置
void wheelHorizontalScrollChanged(bool horizontalScroll)
是否开启水平滚动改变信号
void middleButtonTimeoutChanged(qint32 timeout)
中键模拟超时时间改变信号
qint32 wheelEmulationButton() const
获取滚轮模拟修饰键
void setMiddleButtonTimeout(qint32 timeout)
设置中键模拟超时时间
bool middleButtonEnabled() const
获取是否启用中键模拟
bool leftHanded() const override
获取是否是左手模式
ScrollMethod
滚动方式
Definition: dtkinputdevices_types.h:33
AccelerationProfile
指针加速方式
Definition: dtkinputdevices_types.h:27
设备信息类
Definition: dtkinputdevices_types.h:16