KWin
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
device.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "core/inputdevice.h"
12
13#include <libinput.h>
14
15#include <KConfigGroup>
16
17#include <QList>
18#include <QMatrix4x4>
19#include <QObject>
20#include <QPointer>
21#include <QSizeF>
22
23struct libinput_device;
24
25namespace KWin
26{
27class Output;
28
29namespace LibInput
30{
31enum class ConfigKey;
32
33class KWIN_EXPORT Device : public InputDevice
34{
35 Q_OBJECT
36 Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.InputDevice")
37 //
38 // general
39 Q_PROPERTY(bool keyboard READ isKeyboard CONSTANT)
40 Q_PROPERTY(bool alphaNumericKeyboard READ isAlphaNumericKeyboard CONSTANT)
41 Q_PROPERTY(bool pointer READ isPointer CONSTANT)
42 Q_PROPERTY(bool touchpad READ isTouchpad CONSTANT)
43 Q_PROPERTY(bool touch READ isTouch CONSTANT)
44 Q_PROPERTY(bool tabletTool READ isTabletTool CONSTANT)
45 Q_PROPERTY(bool tabletPad READ isTabletPad CONSTANT)
46 Q_PROPERTY(bool gestureSupport READ supportsGesture CONSTANT)
47 Q_PROPERTY(QString name READ name CONSTANT)
48 Q_PROPERTY(QString sysName READ sysName CONSTANT)
49 Q_PROPERTY(QString outputName READ outputName WRITE setOutputName NOTIFY outputNameChanged)
50 Q_PROPERTY(QSizeF size READ size CONSTANT)
51 Q_PROPERTY(quint32 product READ product CONSTANT)
52 Q_PROPERTY(quint32 vendor READ vendor CONSTANT)
53 Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT)
54 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
55 Q_PROPERTY(bool enabledByDefault READ isEnabledByDefault CONSTANT)
56 //
57 // advanced
58 Q_PROPERTY(int supportedButtons READ supportedButtons CONSTANT)
59 Q_PROPERTY(bool supportsCalibrationMatrix READ supportsCalibrationMatrix CONSTANT)
60 Q_PROPERTY(QMatrix4x4 defaultCalibrationMatrix READ defaultCalibrationMatrix CONSTANT)
61 Q_PROPERTY(QMatrix4x4 calibrationMatrix READ calibrationMatrix WRITE setCalibrationMatrix NOTIFY calibrationMatrixChanged)
62 Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
63 Q_PROPERTY(int orientationDBus READ orientation WRITE setOrientationDBus NOTIFY orientationChanged)
64
65 Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT)
66 Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT)
67 Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged)
68
69 Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT)
70
71 Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT)
72 Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT)
73 Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged)
74 //
75 // acceleration speed and profile
76 Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT)
77 Q_PROPERTY(qreal defaultPointerAcceleration READ defaultPointerAcceleration CONSTANT)
78 Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged)
79
80 Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT)
81 Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT)
82 Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY pointerAccelerationProfileChanged)
83
84 Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT)
85 Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT)
86 Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY pointerAccelerationProfileChanged)
87 //
88 // tapping
89 Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT)
90 Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT)
91 Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged)
92
93 Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT)
94 Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT)
95 Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY tapButtonMapChanged)
96
97 Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT)
98 Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged)
99 Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT)
100 Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged)
101
102 Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT)
103 Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT)
104 Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged)
105 //
106 // scrolling
107 Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT)
108 Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT)
109 Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged)
110
111 Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT)
112 Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT)
113 Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged)
114
115 Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT)
116 Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT)
117 Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged)
118
119 Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT)
120 Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT)
121 Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT)
122 Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged)
123 Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged)
124
125 Q_PROPERTY(qreal scrollFactor READ scrollFactor WRITE setScrollFactor NOTIFY scrollFactorChanged)
126 //
127 // switches
128 Q_PROPERTY(bool switchDevice READ isSwitch CONSTANT)
129 Q_PROPERTY(bool lidSwitch READ isLidSwitch CONSTANT)
130 Q_PROPERTY(bool tabletModeSwitch READ isTabletModeSwitch CONSTANT)
131
132 // Click Methods
133 Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT)
134 Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT)
135 Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged)
136
137 Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT)
138 Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT)
139 Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged)
140
141 Q_PROPERTY(bool supportsOutputArea READ supportsOutputArea CONSTANT)
142 Q_PROPERTY(QRectF defaultOutputArea READ defaultOutputArea CONSTANT)
143 Q_PROPERTY(QRectF outputArea READ outputArea WRITE setOutputArea NOTIFY outputAreaChanged)
144 Q_PROPERTY(bool defaultMapToWorkspace READ defaultMapToWorkspace CONSTANT)
145 Q_PROPERTY(bool mapToWorkspace READ isMapToWorkspace WRITE setMapToWorkspace NOTIFY mapToWorkspaceChanged)
146
147public:
148 explicit Device(libinput_device *device, QObject *parent = nullptr);
149 ~Device() override;
150
151 bool isKeyboard() const override
152 {
153 return m_keyboard;
154 }
159 {
160 return m_alphaNumericKeyboard;
161 }
162 bool isPointer() const override
163 {
164 return m_pointer;
165 }
166 bool isTouchpad() const override
167 {
168 return m_pointer &&
169 // ignore all combined devices. E.g. a touchpad on a keyboard we don't want to toggle
170 // as that would result in the keyboard going off as well
171 !(m_keyboard || m_touch || m_tabletPad || m_tabletTool) &&
172 // is this a touch pad? We don't really know, let's do some assumptions
173 (m_tapFingerCount > 0 || m_supportsDisableWhileTyping || m_supportsDisableEventsOnExternalMouse);
174 }
175 bool isTouch() const override
176 {
177 return m_touch;
178 }
179 bool isTabletTool() const override
180 {
181 return m_tabletTool;
182 }
183 bool isTabletPad() const override
184 {
185 return m_tabletPad;
186 }
187 bool supportsGesture() const
188 {
189 return m_supportsGesture;
190 }
191 QString name() const override
192 {
193 return m_name;
194 }
195 QString sysName() const override
196 {
197 return m_sysName;
198 }
199 QString outputName() const override
200 {
201 return m_outputName;
202 }
203 QSizeF size() const
204 {
205 return m_size;
206 }
207 quint32 product() const
208 {
209 return m_product;
210 }
211 quint32 vendor() const
212 {
213 return m_vendor;
214 }
215 Qt::MouseButtons supportedButtons() const
216 {
217 return m_supportedButtons;
218 }
219 int tapFingerCount() const
220 {
221 return m_tapFingerCount;
222 }
224 {
225 return defaultValue("TapToClick", m_tapToClickEnabledByDefault);
226 }
227 bool isTapToClick() const
228 {
229 return m_tapToClick;
230 }
234 void setTapToClick(bool set);
236 {
237 return defaultValue("TapAndDrag", m_tapAndDragEnabledByDefault);
238 }
239 bool isTapAndDrag() const
240 {
241 return m_tapAndDrag;
242 }
243 void setTapAndDrag(bool set);
245 {
246 return defaultValue("TapDragLock", m_tapDragLockEnabledByDefault);
247 }
248 bool isTapDragLock() const
249 {
250 return m_tapDragLock;
251 }
252 void setTapDragLock(bool set);
254 {
255 return m_supportsDisableWhileTyping;
256 }
258 {
259 return defaultValue("DisableWhileTyping", m_disableWhileTypingEnabledByDefault);
260 }
262 {
263 return m_supportsPointerAcceleration;
264 }
266 {
267 return m_supportsLeftHanded;
268 }
270 {
271 return m_supportsCalibrationMatrix;
272 }
274 {
275 return m_supportsDisableEvents;
276 }
278 {
279 return m_supportsDisableEventsOnExternalMouse;
280 }
282 {
283 return m_supportsMiddleEmulation;
284 }
286 {
287 return m_supportsNaturalScroll;
288 }
290 {
291 return (m_supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_2FG);
292 }
294 {
295 return (m_supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_EDGE);
296 }
298 {
299 return (m_supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
300 }
302 {
303 return defaultValue("LeftHanded", m_leftHandedEnabledByDefault);
304 }
306 {
307 return defaultValue("MiddleButtonEmulation", m_middleEmulationEnabledByDefault);
308 }
310 {
311 return defaultValue("NaturalScroll", m_naturalScrollEnabledByDefault);
312 }
313 enum libinput_config_scroll_method defaultScrollMethod() const
314 {
315 quint32 defaultScrollMethod = defaultValue("ScrollMethod", static_cast<quint32>(m_defaultScrollMethod));
316 return static_cast<libinput_config_scroll_method>(defaultScrollMethod);
317 }
319 {
320 return static_cast<quint32>(defaultScrollMethod());
321 }
323 {
324 return defaultScrollMethod() == LIBINPUT_CONFIG_SCROLL_2FG;
325 }
327 {
328 return defaultScrollMethod() == LIBINPUT_CONFIG_SCROLL_EDGE;
329 }
331 {
332 return defaultScrollMethod() == LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
333 }
335 {
336 return m_tapFingerCount > 1;
337 }
339 {
340 quint32 lmrButtonMap = defaultValue("LmrTapButtonMap", static_cast<quint32>(m_defaultTapButtonMap));
341 return lmrButtonMap == LIBINPUT_CONFIG_TAP_MAP_LMR;
342 }
343
344 void setLmrTapButtonMap(bool set);
345 bool lmrTapButtonMap() const
346 {
347 return m_tapButtonMap & LIBINPUT_CONFIG_TAP_MAP_LMR;
348 }
349
350 quint32 defaultScrollButton() const
351 {
352 return m_defaultScrollButton;
353 }
354 bool isMiddleEmulation() const
355 {
356 return m_middleEmulation;
357 }
358 void setMiddleEmulation(bool set);
359 bool isNaturalScroll() const override
360 {
361 return m_naturalScroll;
362 }
363 void setNaturalScroll(bool set);
364 void setScrollMethod(bool set, enum libinput_config_scroll_method method);
365 bool isScrollTwoFinger() const
366 {
367 return m_scrollMethod & LIBINPUT_CONFIG_SCROLL_2FG;
368 }
369 void setScrollTwoFinger(bool set)
370 {
371 setScrollMethod(set, LIBINPUT_CONFIG_SCROLL_2FG);
372 }
373 bool isScrollEdge() const
374 {
375 return m_scrollMethod & LIBINPUT_CONFIG_SCROLL_EDGE;
376 }
377 void setScrollEdge(bool set)
378 {
379 setScrollMethod(set, LIBINPUT_CONFIG_SCROLL_EDGE);
380 }
382 {
383 return m_scrollMethod & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
384 }
386 {
387 setScrollMethod(set, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
388 }
389 void activateScrollMethodFromInt(quint32 method)
390 {
391 setScrollMethod(true, (libinput_config_scroll_method)method);
392 }
393 quint32 scrollButton() const
394 {
395 return m_scrollButton;
396 }
397 void setScrollButton(quint32 button);
398
400 {
401 return defaultValue("ScrollFactor", 1.0);
402 }
403 qreal scrollFactor() const
404 {
405 return m_scrollFactor;
406 }
407 void setScrollFactor(qreal factor);
408
409 void setDisableWhileTyping(bool set);
411 {
412 return m_disableWhileTyping;
413 }
414 bool isLeftHanded() const
415 {
416 return m_leftHanded;
417 }
422 void setLeftHanded(bool set);
423
424 QMatrix4x4 defaultCalibrationMatrix() const
425 {
426 auto list = defaultValue("CalibrationMatrix", QList<float>{});
427 if (list.size() == 16) {
428 return QMatrix4x4{list.constData()};
429 }
430
431 return m_defaultCalibrationMatrix;
432 }
433 QMatrix4x4 calibrationMatrix() const
434 {
435 return m_calibrationMatrix;
436 }
437 void setCalibrationMatrix(const QMatrix4x4 &matrix);
438
439 Qt::ScreenOrientation defaultOrientation() const
440 {
441 quint32 orientation = defaultValue("Orientation", static_cast<quint32>(Qt::PrimaryOrientation));
442 return static_cast<Qt::ScreenOrientation>(orientation);
443 }
444 Qt::ScreenOrientation orientation() const
445 {
446 return m_orientation;
447 }
448 void setOrientation(Qt::ScreenOrientation orientation);
449 void setOrientationDBus(int orientation)
450 {
451 setOrientation(Qt::ScreenOrientation(orientation));
452 }
453
455 {
456 return m_defaultPointerAcceleration;
457 }
459 {
460 return m_pointerAcceleration;
461 }
465 void setPointerAcceleration(qreal acceleration);
466 void setPointerAccelerationFromString(const QString &acceleration)
467 {
468 setPointerAcceleration(acceleration.toDouble());
469 }
471 {
472 return QString::number(m_pointerAcceleration, 'f', 3);
473 }
475 {
476 return (m_supportedPointerAccelerationProfiles & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
477 }
479 {
480 return (m_supportedPointerAccelerationProfiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
481 }
483 {
484 return (m_defaultPointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
485 }
487 {
488 return (m_defaultPointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
489 }
491 {
492 return (m_pointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
493 }
495 {
496 return (m_pointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
497 }
498 void setPointerAccelerationProfile(bool set, enum libinput_config_accel_profile profile);
500 {
501 setPointerAccelerationProfile(set, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
502 }
504 {
505 setPointerAccelerationProfile(set, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
506 }
508 {
509 setPointerAccelerationProfile(true, (libinput_config_accel_profile)profile);
510 }
512 {
513 return defaultValue("PointerAccelerationProfile", static_cast<quint32>(m_defaultPointerAccelerationProfile));
514 }
516 {
517 return (m_supportedClickMethods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
518 }
520 {
521 return (defaultClickMethod() == LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
522 }
524 {
525 return (m_clickMethod == LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
526 }
528 {
529 return (m_supportedClickMethods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
530 }
532 {
533 return (defaultClickMethod() == LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
534 }
536 {
537 return (m_clickMethod == LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
538 }
539 void setClickMethod(bool set, enum libinput_config_click_method method);
540 void setClickMethodAreas(bool set)
541 {
542 setClickMethod(set, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
543 }
545 {
546 setClickMethod(set, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
547 }
548 void setClickMethodFromInt(quint32 method)
549 {
550 setClickMethod(true, (libinput_config_click_method)method);
551 }
552 libinput_config_click_method defaultClickMethod() const
553 {
554 return static_cast<libinput_config_click_method>(defaultClickMethodToInt());
555 }
557 {
558 return defaultValue("ClickMethod", static_cast<quint32>(m_defaultClickMethod));
559 }
560
561 bool isEnabled() const override
562 {
563 return m_enabled;
564 }
565 void setEnabled(bool enabled) override;
566
568 {
569 return defaultValue("Enabled", true);
570 }
571
573 {
574 return m_device;
575 }
576
581 void setConfig(const KConfigGroup &config)
582 {
583 m_config = config;
584 }
585
586 void setDefaultConfig(const KConfigGroup &config)
587 {
588 m_defaultConfig = config;
589 }
590
594 void setOutputName(const QString &uuid) override;
595 QString defaultOutputName() const
596 {
597 return {};
598 }
599
603 void loadConfiguration();
604
605 bool isSwitch() const
606 {
607 return m_switch;
608 }
609
610 bool isLidSwitch() const override
611 {
612 return m_lidSwitch;
613 }
614
615 bool isTabletModeSwitch() const override
616 {
617 return m_tabletSwitch;
618 }
619
620 int stripsCount() const;
621 int ringsCount() const;
622
623 void *groupUserData() const;
624
625 Output *output() const;
626 void setOutput(Output *output);
627
628 LEDs leds() const override;
629 void setLeds(LEDs leds) override;
630
631 QRectF defaultOutputArea() const;
632 bool supportsOutputArea() const;
633 QRectF outputArea() const;
634 void setOutputArea(const QRectF &outputArea);
635
637 {
638 return defaultValue("MapToWorkspace", false);
639 }
640
641 bool isMapToWorkspace() const
642 {
643 return m_mapToWorkspace;
644 }
645
646 void setMapToWorkspace(bool mapToWorkspace);
647
651 static Device *get(libinput_device *native);
652
653Q_SIGNALS:
674
675private:
676 template<typename T>
677 void writeEntry(const ConfigKey &key, const T &value);
678
679 template<typename T>
680 T defaultValue(const char *key, const T &fallback) const
681 {
682 if (m_defaultConfig.isValid() && m_defaultConfig.hasKey(key)) {
683 return m_defaultConfig.readEntry(key, fallback);
684 }
685
686 return fallback;
687 }
688
689 libinput_device *m_device;
690 bool m_keyboard;
691 bool m_alphaNumericKeyboard = false;
692 bool m_pointer;
693 bool m_touch;
694 bool m_tabletTool;
695 bool m_tabletPad;
696 bool m_supportsGesture;
697 bool m_switch = false;
698 bool m_lidSwitch = false;
699 bool m_tabletSwitch = false;
700 QString m_name;
701 QString m_sysName;
702 QString m_outputName;
703 QSizeF m_size;
704 quint32 m_product;
705 quint32 m_vendor;
706 Qt::MouseButtons m_supportedButtons = Qt::NoButton;
707 int m_tapFingerCount;
708 enum libinput_config_tap_button_map m_defaultTapButtonMap;
709 enum libinput_config_tap_button_map m_tapButtonMap;
710 bool m_tapToClickEnabledByDefault;
711 bool m_tapToClick;
712 bool m_tapAndDragEnabledByDefault;
713 bool m_tapAndDrag;
714 bool m_tapDragLockEnabledByDefault;
715 bool m_tapDragLock;
716 bool m_supportsDisableWhileTyping;
717 bool m_supportsPointerAcceleration;
718 bool m_supportsLeftHanded;
719 bool m_supportsCalibrationMatrix;
720 bool m_supportsDisableEvents;
721 bool m_supportsDisableEventsOnExternalMouse;
722 bool m_supportsMiddleEmulation;
723 bool m_supportsNaturalScroll;
724 quint32 m_supportedScrollMethods;
725 bool m_supportsScrollEdge;
726 bool m_supportsScrollOnButtonDown;
727 bool m_leftHandedEnabledByDefault;
728 bool m_middleEmulationEnabledByDefault;
729 bool m_naturalScrollEnabledByDefault;
730 enum libinput_config_scroll_method m_defaultScrollMethod;
731 quint32 m_defaultScrollButton;
732 bool m_disableWhileTypingEnabledByDefault;
733 bool m_disableWhileTyping;
734 bool m_middleEmulation;
735 bool m_leftHanded;
736 bool m_naturalScroll;
737 enum libinput_config_scroll_method m_scrollMethod;
738 quint32 m_scrollButton;
739 qreal m_defaultPointerAcceleration;
740 qreal m_pointerAcceleration;
741 qreal m_scrollFactor;
742 quint32 m_supportedPointerAccelerationProfiles;
743 enum libinput_config_accel_profile m_defaultPointerAccelerationProfile;
744 enum libinput_config_accel_profile m_pointerAccelerationProfile;
745 bool m_enabled;
746
747 KConfigGroup m_config;
748 KConfigGroup m_defaultConfig;
749 bool m_loading = false;
750
751 QPointer<Output> m_output;
752 Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation;
753 QMatrix4x4 m_defaultCalibrationMatrix;
754 QMatrix4x4 m_calibrationMatrix;
755 quint32 m_supportedClickMethods;
756 enum libinput_config_click_method m_defaultClickMethod;
757 enum libinput_config_click_method m_clickMethod;
758
759 LEDs m_leds;
760 QRectF m_outputArea = QRectF(0, 0, 1, 1);
761 bool m_mapToWorkspace = false;
762};
763
764}
765}
766
qreal defaultPointerAcceleration() const
Definition device.h:454
bool supportsCalibrationMatrix() const
Definition device.h:269
bool scrollOnButtonDownEnabledByDefault() const
Definition device.h:330
QString name() const override
Definition device.h:191
bool supportsPointerAcceleration() const
Definition device.h:261
quint32 defaultScrollMethodToInt() const
Definition device.h:318
bool isClickMethodClickfinger() const
Definition device.h:535
bool isAlphaNumericKeyboard() const
Definition device.h:158
quint32 defaultClickMethodToInt() const
Definition device.h:556
void setNaturalScroll(bool set)
bool isTouchpad() const override
Definition device.h:166
bool isTabletTool() const override
Definition device.h:179
bool isScrollEdge() const
Definition device.h:373
void setOrientationDBus(int orientation)
Definition device.h:449
bool supportsLmrTapButtonMap() const
Definition device.h:334
bool isMiddleEmulation() const
Definition device.h:354
qreal pointerAcceleration() const
Definition device.h:458
QString defaultOutputName() const
Definition device.h:595
bool isScrollTwoFinger() const
Definition device.h:365
enum libinput_config_scroll_method defaultScrollMethod() const
Definition device.h:313
bool isTabletModeSwitch() const override
Definition device.h:615
bool lmrTapButtonMap() const
Definition device.h:345
libinput_config_click_method defaultClickMethod() const
Definition device.h:552
bool defaultPointerAccelerationProfileFlat() const
Definition device.h:482
void setTapAndDrag(bool set)
void setTapDragLock(bool set)
QSizeF size() const
Definition device.h:203
bool supportsScrollEdge() const
Definition device.h:293
void setDisableWhileTyping(bool set)
bool isTabletPad() const override
Definition device.h:183
bool middleEmulationEnabledByDefault() const
Definition device.h:305
bool supportsClickMethodClickfinger() const
Definition device.h:527
QMatrix4x4 defaultCalibrationMatrix() const
Definition device.h:424
quint32 scrollButton() const
Definition device.h:393
bool supportsDisableEventsOnExternalMouse() const
Definition device.h:277
void setScrollEdge(bool set)
Definition device.h:377
bool isLidSwitch() const override
Definition device.h:610
bool supportsPointerAccelerationProfileAdaptive() const
Definition device.h:478
bool supportsMiddleEmulation() const
Definition device.h:281
int tapFingerCount() const
Definition device.h:219
void setPointerAccelerationProfileFlat(bool set)
Definition device.h:499
bool isSwitch() const
Definition device.h:605
bool tapDragLockEnabledByDefault() const
Definition device.h:244
bool tapToClickEnabledByDefault() const
Definition device.h:223
QString sysName() const override
Definition device.h:195
quint32 defaultPointerAccelerationProfileToInt() const
Definition device.h:511
quint32 vendor() const
Definition device.h:211
void setScrollOnButtonDown(bool set)
Definition device.h:385
void setScrollTwoFinger(bool set)
Definition device.h:369
bool supportsGesture() const
Definition device.h:187
bool supportsScrollOnButtonDown() const
Definition device.h:297
void setMiddleEmulation(bool set)
quint32 defaultScrollButton() const
Definition device.h:350
void setClickMethodAreas(bool set)
Definition device.h:540
void activateScrollMethodFromInt(quint32 method)
Definition device.h:389
bool isEnabledByDefault() const
Definition device.h:567
QString defaultPointerAccelerationToString() const
Definition device.h:470
bool naturalScrollEnabledByDefault() const
Definition device.h:309
bool scrollEdgeEnabledByDefault() const
Definition device.h:326
bool isTapToClick() const
Definition device.h:227
void setDefaultConfig(const KConfigGroup &config)
Definition device.h:586
Qt::ScreenOrientation orientation() const
Definition device.h:444
bool disableWhileTypingEnabledByDefault() const
Definition device.h:257
bool scrollTwoFingerEnabledByDefault() const
Definition device.h:322
void setTapToClick(bool set)
bool isMapToWorkspace() const
Definition device.h:641
void setConfig(const KConfigGroup &config)
Definition device.h:581
bool pointerAccelerationProfileAdaptive() const
Definition device.h:494
qreal scrollFactor() const
Definition device.h:403
bool defaultClickMethodAreas() const
Definition device.h:519
bool supportsDisableWhileTyping() const
Definition device.h:253
bool lmrTapButtonMapEnabledByDefault() const
Definition device.h:338
bool supportsPointerAccelerationProfileFlat() const
Definition device.h:474
bool isTapAndDrag() const
Definition device.h:239
QMatrix4x4 calibrationMatrix() const
Definition device.h:433
Qt::MouseButtons supportedButtons() const
Definition device.h:215
void setLeftHanded(bool set)
qreal scrollFactorDefault() const
Definition device.h:399
bool isTouch() const override
Definition device.h:175
void setClickMethodClickfinger(bool set)
Definition device.h:544
bool isLeftHanded() const
Definition device.h:414
bool defaultPointerAccelerationProfileAdaptive() const
Definition device.h:486
void setClickMethodFromInt(quint32 method)
Definition device.h:548
quint32 product() const
Definition device.h:207
QString outputName() const override
Definition device.h:199
void setPointerAccelerationFromString(const QString &acceleration)
Definition device.h:466
bool pointerAccelerationProfileFlat() const
Definition device.h:490
bool supportsLeftHanded() const
Definition device.h:265
Qt::ScreenOrientation defaultOrientation() const
Definition device.h:439
bool defaultClickMethodClickfinger() const
Definition device.h:531
libinput_device * device() const
Definition device.h:572
bool isNaturalScroll() const override
Definition device.h:359
bool isScrollOnButtonDown() const
Definition device.h:381
void pointerAccelerationProfileChanged()
bool supportsDisableEvents() const
Definition device.h:273
bool supportsScrollTwoFinger() const
Definition device.h:289
bool isTapDragLock() const
Definition device.h:248
void setPointerAccelerationProfileAdaptive(bool set)
Definition device.h:503
bool tapAndDragEnabledByDefault() const
Definition device.h:235
bool leftHandedEnabledByDefault() const
Definition device.h:301
bool isClickMethodAreas() const
Definition device.h:523
bool defaultMapToWorkspace() const
Definition device.h:636
bool supportsNaturalScroll() const
Definition device.h:285
bool isPointer() const override
Definition device.h:162
void setPointerAccelerationProfileFromInt(quint32 profile)
Definition device.h:507
bool isEnabled() const override
Definition device.h:561
void setEnabled(bool enabled) override
bool supportsClickMethodAreas() const
Definition device.h:515
bool isDisableWhileTyping() const
Definition device.h:410
Q_DECLARE_METATYPE(KWin::SwitchEvent::State)
#define explicit