DtkDevice
DTK library for device.
dinputdevicesetting.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DDEVICEETTING_H
6#define DDEVICEETTING_H
7
8#include "dtkdevice_global.h"
10
11#include <DExpected>
12#include <DObject>
13
14#include <QObject>
15#include <QSharedPointer>
16
17using DInputKeyAction = DTK_DEVICE_NAMESPACE::KeyAction;
18using DInputKey = DTK_DEVICE_NAMESPACE::Key;
19DDEVICE_BEGIN_NAMESPACE
20using DCORE_NAMESPACE::DExpected;
21using DCORE_NAMESPACE::DObject;
22
23class DInputDeviceSettingPrivate;
24class LIBDTKDEVICESHARED_EXPORT DInputDeviceSetting : public QObject, public DObject
25{
26 Q_OBJECT
27 Q_PROPERTY(bool disableTouchPadWhileMouse READ disableTouchPadWhileMouse WRITE setDisableTouchPadWhileMouse NOTIFY
28 disableTouchPadWhileMouseChanged)
29 Q_PROPERTY(
30 quint32 doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval NOTIFY doubleClickIntervalChanged)
31 Q_PROPERTY(quint32 dragThreshold READ dragThreshold WRITE setDragThreshold NOTIFY dragThresholdChanged)
32 Q_PROPERTY(bool repeatEnabled READ repeatEnabled WRITE setRepeatEnabled NOTIFY repeatEnabledChanged)
33 Q_PROPERTY(quint32 repeatDelay READ repeatDelay WRITE setRepeatDelay NOTIFY repeatDelayChanged)
34 Q_PROPERTY(quint32 repeatInterval READ repeatInterval WRITE setRepeatInterval NOTIFY repeatIntervalChanged)
35 Q_PROPERTY(qint32 cursorBlinkInterval READ cursorBlinkInterval WRITE setCursorBlinkInterval NOTIFY cursorBlinkIntervalChanged)
36 Q_PROPERTY(quint32 wheelSpeed READ wheelSpeed WRITE setWheelSpeed NOTIFY wheelSpeedChanged)
37
38public:
39 using Ptr = QSharedPointer<DInputDeviceSetting>;
40 ~DInputDeviceSetting() override;
41
43 quint32 doubleClickInterval() const;
44 quint32 dragThreshold() const;
45 bool repeatEnabled() const;
46 quint32 repeatDelay() const;
47 quint32 repeatInterval() const;
48 qint32 cursorBlinkInterval() const;
49 quint32 wheelSpeed() const;
50
51 void setDisableTouchPadWhileMouse(bool disabled);
52 void setDoubleClickInterval(quint32 interval);
53 void setDragThreshold(quint32 distance);
54 void setRepeatEnabled(bool enabled);
55 void setRepeatDelay(quint32 delay);
56 void setRepeatInterval(quint32 interval);
57 void setCursorBlinkInterval(qint32 interval);
58 void setWheelSpeed(quint32 speed);
59
60Q_SIGNALS:
62 void doubleClickIntervalChanged(quint32 interval);
63 void dragThresholdChanged(quint32 distance);
64 void repeatEnabledChanged(bool enabled);
65 void repeatDelayChanged(quint32 delay);
66 void repeatIntervalChanged(quint32 interval);
67 void cursorBlinkIntervalChanged(qint32 interval);
68 void wheelSpeedChanged(quint32 speed);
69
70public Q_SLOTS:
71 DExpected<quint32> pressureSensitivity(quint32 id);
72 DExpected<quint32> rawSampleSize(quint32 id);
73 DExpected<quint32> pressureThreshold(quint32 id);
74 DExpected<bool> forceProportions(quint32 id);
75 DExpected<QString> mapOutput(quint32 id);
76 DExpected<bool> mouseEnterRemap(quint32 id);
77 DExpected<quint32> suppress(quint32 id);
78 DExpected<void> setPressureSensitivity(quint32 id, quint32 sensitivity);
79 DExpected<void> setRawSampleSize(quint32 id, quint32 size);
80 DExpected<void> setPressureThreshold(quint32 id, quint32 threshold);
81 DExpected<void> setForceProportions(quint32 id, bool force);
82 DExpected<void> setMouseEnterRemap(quint32 id, bool remap);
83 DExpected<void> setSuppress(quint32 id, quint32 suppress);
84 DExpected<DInputKeyAction> keymap(quint32 id, DInputKey key);
85 DExpected<void> setKeymap(quint32 id, DInputKey key, DInputKeyAction action);
86
87private:
88 explicit DInputDeviceSetting(QObject *parent = nullptr);
89 friend class DInputDeviceManager;
90 D_DECLARE_PRIVATE(DInputDeviceSetting)
91};
92DDEVICE_END_NAMESPACE
93
94#endif
Manager类
Definition: dinputdevicemanager.h:27
全局设置类
Definition: dinputdevicesetting.h:25
void wheelSpeedChanged(quint32 speed)
属性wheelSpeed改变时触发的信号
void setRepeatDelay(quint32 delay)
设置按键重复触发延迟
DExpected< bool > mouseEnterRemap(quint32 id)
获取特定设备是否在进入新的显示时进行重新映射
void disableTouchPadWhileMouseChanged(bool disabled)
属性disableTouchPadWhileMouse改变时触发的信号
DExpected< quint32 > pressureSensitivity(quint32 id)
获取特定设备的压力感应级别
void setRepeatInterval(quint32 interval)
设置按键重复事件触发时间间隔
bool repeatEnabled() const
获取键盘是否开启按键重复
void repeatDelayChanged(quint32 delay)
属性repeatDelay改变时触发的信号
void dragThresholdChanged(quint32 distance)
属性dragThreshold改变时触发的信号
void doubleClickIntervalChanged(quint32 interval)
属性doubleClickInterval改变时触发的信号
DExpected< void > setPressureThreshold(quint32 id, quint32 threshold)
设置特定设备的压感事件阈值
void setCursorBlinkInterval(qint32 interval)
设置光标闪烁时间间隔
DExpected< bool > forceProportions(quint32 id)
获取特定设备是否强制调整为输出的比例
quint32 wheelSpeed() const
获取滚轮速度
DExpected< QString > mapOutput(quint32 id)
获取特定设备的输出映射(显示)
void setWheelSpeed(quint32 speed)
设置滚轮速度
DExpected< void > setMouseEnterRemap(quint32 id, bool remap)
设置特定设备是否在鼠标进入新的输出的时候重新映射
void repeatIntervalChanged(quint32 interval)
属性repeatInterval改变时触发的信号
qint32 cursorBlinkInterval() const
获取光标闪烁间隔时间
quint32 repeatDelay() const
获取按键重复触发延迟
quint32 doubleClickInterval() const
获取鼠标和触摸板双击时间间隔
quint32 repeatInterval() const
获取按键重复触发间隔时间
bool disableTouchPadWhileMouse() const
获取是否在连接鼠标时禁用触摸板
DExpected< void > setKeymap(quint32 id, DInputKey key, DInputKeyAction action)
设置特定设备某个按键对应的行为
DExpected< quint32 > rawSampleSize(quint32 id)
获取特别设备的平滑窗口采样大小
void setDoubleClickInterval(quint32 interval)
设置鼠标和触摸板双击事件的时间间隔
quint32 dragThreshold() const
获取鼠标和触摸板产生拖拽事件的最小移动距离
DExpected< void > setPressureSensitivity(quint32 id, quint32 sensitivity)
设置特定设备的压感灵敏度
DExpected< quint32 > suppress(quint32 id)
获取特定设备坐标或者压感变化事件之间的最小间隔
void setDragThreshold(quint32 distance)
设置拖拽事件的最小距离
void setDisableTouchPadWhileMouse(bool disabled)
设置是否在连接鼠标时禁用触摸板
void setRepeatEnabled(bool enabled)
设置是否开启按键重复
DExpected< void > setSuppress(quint32 id, quint32 suppress)
设置特定设备坐标或者压感变化事件之间的最小间隔
DExpected< DInputKeyAction > keymap(quint32 id, DInputKey key)
获取特定设备特定按键的行为
void repeatEnabledChanged(bool enabled)
属性repeatEnabled改变时触发的信号
void cursorBlinkIntervalChanged(qint32 interval)
属性cursorBlinkInterval改变时触发的信号
DExpected< void > setRawSampleSize(quint32 id, quint32 size)
设置特定设备的平滑窗口取样大小
DExpected< quint32 > pressureThreshold(quint32 id)
获取特定设备的压感事件阈值
DExpected< void > setForceProportions(quint32 id, bool force)
设置特定设备是否强制调整为输出的比例