[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2016 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
#ifndef KWIN_LIBINPUT_DEVICE_H
|
|
|
|
#define KWIN_LIBINPUT_DEVICE_H
|
|
|
|
|
2016-10-28 18:17:20 +00:00
|
|
|
#include <libinput.h>
|
|
|
|
|
2016-11-04 14:31:35 +00:00
|
|
|
#include <KConfigGroup>
|
|
|
|
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
#include <QObject>
|
2017-11-10 17:07:15 +00:00
|
|
|
#include <QMatrix4x4>
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
#include <QSizeF>
|
2016-05-24 07:57:07 +00:00
|
|
|
#include <QVector>
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
|
|
|
|
struct libinput_device;
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
namespace LibInput
|
|
|
|
{
|
2016-11-04 14:31:35 +00:00
|
|
|
enum class ConfigKey;
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
|
|
|
|
class Device : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2016-05-13 08:04:28 +00:00
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.InputDevice")
|
2016-12-02 13:58:56 +00:00
|
|
|
//
|
|
|
|
// general
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
Q_PROPERTY(bool keyboard READ isKeyboard CONSTANT)
|
|
|
|
Q_PROPERTY(bool alphaNumericKeyboard READ isAlphaNumericKeyboard CONSTANT)
|
|
|
|
Q_PROPERTY(bool pointer READ isPointer CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
Q_PROPERTY(bool touchpad READ isTouchpad CONSTANT)
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
Q_PROPERTY(bool touch READ isTouch CONSTANT)
|
|
|
|
Q_PROPERTY(bool tabletTool READ isTabletTool CONSTANT)
|
|
|
|
Q_PROPERTY(bool tabletPad READ isTabletPad CONSTANT)
|
|
|
|
Q_PROPERTY(bool gestureSupport READ supportsGesture CONSTANT)
|
|
|
|
Q_PROPERTY(QString name READ name CONSTANT)
|
|
|
|
Q_PROPERTY(QString sysName READ sysName CONSTANT)
|
|
|
|
Q_PROPERTY(QString outputName READ outputName CONSTANT)
|
|
|
|
Q_PROPERTY(QSizeF size READ size CONSTANT)
|
|
|
|
Q_PROPERTY(quint32 product READ product CONSTANT)
|
|
|
|
Q_PROPERTY(quint32 vendor READ vendor CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT)
|
|
|
|
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
|
|
|
|
//
|
|
|
|
// advanced
|
2018-12-10 10:10:33 +00:00
|
|
|
Q_PROPERTY(int supportedButtons READ supportedButtons CONSTANT)
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
Q_PROPERTY(bool supportsCalibrationMatrix READ supportsCalibrationMatrix CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT)
|
|
|
|
Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged)
|
|
|
|
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT)
|
|
|
|
Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged)
|
|
|
|
//
|
|
|
|
// acceleration speed and profile
|
|
|
|
Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT)
|
|
|
|
Q_PROPERTY(qreal defaultPointerAcceleration READ defaultPointerAcceleration CONSTANT)
|
|
|
|
Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT)
|
|
|
|
Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT)
|
|
|
|
Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY pointerAccelerationProfileChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT)
|
|
|
|
Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT)
|
|
|
|
Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY pointerAccelerationProfileChanged)
|
|
|
|
//
|
|
|
|
// tapping
|
|
|
|
Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT)
|
|
|
|
Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT)
|
|
|
|
Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY tapButtonMapChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged)
|
|
|
|
Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged)
|
|
|
|
|
2016-10-27 17:06:34 +00:00
|
|
|
Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT)
|
|
|
|
Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged)
|
|
|
|
//
|
|
|
|
// scrolling
|
|
|
|
Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT)
|
2016-10-28 16:30:10 +00:00
|
|
|
Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT)
|
2016-10-28 18:17:20 +00:00
|
|
|
Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT)
|
2016-10-28 18:17:20 +00:00
|
|
|
Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT)
|
2016-12-02 13:58:56 +00:00
|
|
|
Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT)
|
2016-10-28 18:17:20 +00:00
|
|
|
Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT)
|
|
|
|
Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT)
|
|
|
|
Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged)
|
|
|
|
Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged)
|
2016-12-02 13:58:56 +00:00
|
|
|
|
2017-12-27 16:57:00 +00:00
|
|
|
// switches
|
|
|
|
Q_PROPERTY(bool switchDevice READ isSwitch CONSTANT)
|
|
|
|
Q_PROPERTY(bool lidSwitch READ isLidSwitch CONSTANT)
|
|
|
|
Q_PROPERTY(bool tabletModeSwitch READ isTabletModeSwitch CONSTANT)
|
|
|
|
|
[libinput] Add support for clickfinger and button areas click method
Summary:
Added support for libinput clickfinger , areas method for touchpad KCM
Also added mock methods.
Included commits in branch libinputClickMethod:
Added libinput mock methods
Added : 1. setScrollMethod 2. added key value pair in QMap 3. added methods for Q_Props
Added Q_Props for click method, signal
Added variables and initialize in constructor
Reviewers: #kwin, graesslin, davidedmundson, zzag
Reviewed By: #kwin, graesslin, zzag
Subscribers: zzag, graesslin, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17577
2018-12-22 16:29:41 +00:00
|
|
|
// Click Methods
|
|
|
|
Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT)
|
|
|
|
Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT)
|
|
|
|
Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT)
|
|
|
|
Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT)
|
|
|
|
Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged)
|
2016-12-02 13:58:56 +00:00
|
|
|
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
public:
|
|
|
|
explicit Device(libinput_device *device, QObject *parent = nullptr);
|
|
|
|
virtual ~Device();
|
|
|
|
|
|
|
|
bool isKeyboard() const {
|
|
|
|
return m_keyboard;
|
|
|
|
}
|
|
|
|
bool isAlphaNumericKeyboard() const {
|
|
|
|
return m_alphaNumericKeyboard;
|
|
|
|
}
|
|
|
|
bool isPointer() const {
|
|
|
|
return m_pointer;
|
|
|
|
}
|
2016-12-02 13:58:56 +00:00
|
|
|
bool isTouchpad() const{
|
|
|
|
return m_pointer &&
|
|
|
|
// ignore all combined devices. E.g. a touchpad on a keyboard we don't want to toggle
|
|
|
|
// as that would result in the keyboard going off as well
|
|
|
|
!(m_keyboard || m_touch || m_tabletPad || m_tabletTool) &&
|
|
|
|
// is this a touch pad? We don't really know, let's do some assumptions
|
|
|
|
(m_tapFingerCount > 0 || m_supportsDisableWhileTyping || m_supportsDisableEventsOnExternalMouse);
|
|
|
|
}
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
bool isTouch() const {
|
|
|
|
return m_touch;
|
|
|
|
}
|
|
|
|
bool isTabletTool() const {
|
|
|
|
return m_tabletTool;
|
|
|
|
}
|
|
|
|
bool isTabletPad() const {
|
|
|
|
return m_tabletPad;
|
|
|
|
}
|
|
|
|
bool supportsGesture() const {
|
|
|
|
return m_supportsGesture;
|
|
|
|
}
|
|
|
|
QString name() const {
|
|
|
|
return m_name;
|
|
|
|
}
|
|
|
|
QString sysName() const {
|
|
|
|
return m_sysName;
|
|
|
|
}
|
|
|
|
QString outputName() const {
|
|
|
|
return m_outputName;
|
|
|
|
}
|
|
|
|
QSizeF size() const {
|
|
|
|
return m_size;
|
|
|
|
}
|
|
|
|
quint32 product() const {
|
|
|
|
return m_product;
|
|
|
|
}
|
|
|
|
quint32 vendor() const {
|
|
|
|
return m_vendor;
|
|
|
|
}
|
|
|
|
Qt::MouseButtons supportedButtons() const {
|
|
|
|
return m_supportedButtons;
|
|
|
|
}
|
|
|
|
int tapFingerCount() const {
|
|
|
|
return m_tapFingerCount;
|
|
|
|
}
|
2016-08-11 13:18:40 +00:00
|
|
|
bool tapToClickEnabledByDefault() const {
|
|
|
|
return m_tapToClickEnabledByDefault;
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
}
|
2016-08-11 13:13:36 +00:00
|
|
|
bool isTapToClick() const {
|
|
|
|
return m_tapToClick;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Set the Device to tap to click if @p set is @c true.
|
|
|
|
**/
|
|
|
|
void setTapToClick(bool set);
|
2016-08-11 14:02:26 +00:00
|
|
|
bool tapAndDragEnabledByDefault() const {
|
|
|
|
return m_tapAndDragEnabledByDefault;
|
|
|
|
}
|
|
|
|
bool isTapAndDrag() const {
|
|
|
|
return m_tapAndDrag;
|
|
|
|
}
|
|
|
|
void setTapAndDrag(bool set);
|
2016-08-11 14:32:00 +00:00
|
|
|
bool tapDragLockEnabledByDefault() const {
|
|
|
|
return m_tapDragLockEnabledByDefault;
|
|
|
|
}
|
|
|
|
bool isTapDragLock() const {
|
|
|
|
return m_tapDragLock;
|
|
|
|
}
|
|
|
|
void setTapDragLock(bool set);
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
bool supportsDisableWhileTyping() const {
|
|
|
|
return m_supportsDisableWhileTyping;
|
|
|
|
}
|
2016-12-02 13:58:56 +00:00
|
|
|
bool disableWhileTypingEnabledByDefault() const {
|
|
|
|
return m_disableWhileTypingEnabledByDefault;
|
|
|
|
}
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
bool supportsPointerAcceleration() const {
|
|
|
|
return m_supportsPointerAcceleration;
|
|
|
|
}
|
|
|
|
bool supportsLeftHanded() const {
|
|
|
|
return m_supportsLeftHanded;
|
|
|
|
}
|
|
|
|
bool supportsCalibrationMatrix() const {
|
|
|
|
return m_supportsCalibrationMatrix;
|
|
|
|
}
|
|
|
|
bool supportsDisableEvents() const {
|
|
|
|
return m_supportsDisableEvents;
|
|
|
|
}
|
|
|
|
bool supportsDisableEventsOnExternalMouse() const {
|
|
|
|
return m_supportsDisableEventsOnExternalMouse;
|
|
|
|
}
|
2016-10-27 17:06:34 +00:00
|
|
|
bool supportsMiddleEmulation() const {
|
|
|
|
return m_supportsMiddleEmulation;
|
|
|
|
}
|
2016-10-28 16:30:10 +00:00
|
|
|
bool supportsNaturalScroll() const {
|
|
|
|
return m_supportsNaturalScroll;
|
|
|
|
}
|
2016-10-28 18:17:20 +00:00
|
|
|
bool supportsScrollTwoFinger() const {
|
|
|
|
return (m_supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_2FG);
|
|
|
|
}
|
|
|
|
bool supportsScrollEdge() const {
|
|
|
|
return (m_supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_EDGE);
|
|
|
|
}
|
|
|
|
bool supportsScrollOnButtonDown() const {
|
|
|
|
return (m_supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
|
|
|
|
}
|
2016-11-22 13:49:01 +00:00
|
|
|
bool leftHandedEnabledByDefault() const {
|
|
|
|
return m_leftHandedEnabledByDefault;
|
|
|
|
}
|
2016-10-27 17:06:34 +00:00
|
|
|
bool middleEmulationEnabledByDefault() const {
|
|
|
|
return m_middleEmulationEnabledByDefault;
|
|
|
|
}
|
2016-10-28 16:30:10 +00:00
|
|
|
bool naturalScrollEnabledByDefault() const {
|
|
|
|
return m_naturalScrollEnabledByDefault;
|
|
|
|
}
|
2016-11-22 18:18:15 +00:00
|
|
|
enum libinput_config_scroll_method defaultScrollMethod() const {
|
|
|
|
return m_defaultScrollMethod;
|
|
|
|
}
|
|
|
|
quint32 defaultScrollMethodToInt() const {
|
|
|
|
return (quint32) m_defaultScrollMethod;
|
|
|
|
}
|
2016-10-28 18:17:20 +00:00
|
|
|
bool scrollTwoFingerEnabledByDefault() const {
|
|
|
|
return m_defaultScrollMethod == LIBINPUT_CONFIG_SCROLL_2FG;
|
|
|
|
}
|
|
|
|
bool scrollEdgeEnabledByDefault() const {
|
|
|
|
return m_defaultScrollMethod == LIBINPUT_CONFIG_SCROLL_EDGE;
|
|
|
|
}
|
|
|
|
bool scrollOnButtonDownEnabledByDefault() const {
|
|
|
|
return m_defaultScrollMethod == LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
|
|
|
|
}
|
2016-12-02 13:58:56 +00:00
|
|
|
bool supportsLmrTapButtonMap() const {
|
|
|
|
return m_tapFingerCount > 1;
|
|
|
|
}
|
|
|
|
bool lmrTapButtonMapEnabledByDefault() const {
|
|
|
|
return m_defaultTapButtonMap == LIBINPUT_CONFIG_TAP_MAP_LMR;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setLmrTapButtonMap(bool set);
|
|
|
|
bool lmrTapButtonMap() const {
|
|
|
|
return m_tapButtonMap & LIBINPUT_CONFIG_TAP_MAP_LMR;
|
|
|
|
}
|
|
|
|
|
2016-10-28 18:17:20 +00:00
|
|
|
quint32 defaultScrollButton() const {
|
|
|
|
return m_defaultScrollButton;
|
|
|
|
}
|
2016-10-27 17:06:34 +00:00
|
|
|
bool isMiddleEmulation() const {
|
|
|
|
return m_middleEmulation;
|
|
|
|
}
|
|
|
|
void setMiddleEmulation(bool set);
|
2016-10-28 16:30:10 +00:00
|
|
|
bool isNaturalScroll() const {
|
|
|
|
return m_naturalScroll;
|
|
|
|
}
|
|
|
|
void setNaturalScroll(bool set);
|
2016-11-22 18:18:15 +00:00
|
|
|
void setScrollMethod(bool set, enum libinput_config_scroll_method method);
|
2016-10-28 18:17:20 +00:00
|
|
|
bool isScrollTwoFinger() const {
|
|
|
|
return m_scrollMethod & LIBINPUT_CONFIG_SCROLL_2FG;
|
|
|
|
}
|
2016-11-22 18:18:15 +00:00
|
|
|
void setScrollTwoFinger(bool set) {
|
|
|
|
setScrollMethod(set, LIBINPUT_CONFIG_SCROLL_2FG);
|
|
|
|
}
|
2016-10-28 18:17:20 +00:00
|
|
|
bool isScrollEdge() const {
|
|
|
|
return m_scrollMethod & LIBINPUT_CONFIG_SCROLL_EDGE;
|
|
|
|
}
|
2016-11-22 18:18:15 +00:00
|
|
|
void setScrollEdge(bool set) {
|
|
|
|
setScrollMethod(set, LIBINPUT_CONFIG_SCROLL_EDGE);
|
|
|
|
}
|
2016-10-28 18:17:20 +00:00
|
|
|
bool isScrollOnButtonDown() const {
|
|
|
|
return m_scrollMethod & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
|
|
|
|
}
|
2016-11-22 18:18:15 +00:00
|
|
|
void setScrollOnButtonDown(bool set) {
|
|
|
|
setScrollMethod(set, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
|
|
|
|
}
|
|
|
|
void activateScrollMethodFromInt(quint32 method) {
|
|
|
|
setScrollMethod(true, (libinput_config_scroll_method) method);
|
|
|
|
}
|
2016-10-28 18:17:20 +00:00
|
|
|
quint32 scrollButton() const {
|
|
|
|
return m_scrollButton;
|
|
|
|
}
|
|
|
|
void setScrollButton(quint32 button);
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
|
2016-12-02 13:58:56 +00:00
|
|
|
void setDisableWhileTyping(bool set);
|
|
|
|
bool isDisableWhileTyping() const {
|
|
|
|
return m_disableWhileTyping;
|
|
|
|
}
|
2016-05-06 07:53:36 +00:00
|
|
|
bool isLeftHanded() const {
|
|
|
|
return m_leftHanded;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Sets the Device to left handed mode if @p set is @c true.
|
|
|
|
* If @p set is @c false the device is set to right handed mode
|
|
|
|
**/
|
|
|
|
void setLeftHanded(bool set);
|
|
|
|
|
2016-12-02 13:58:56 +00:00
|
|
|
qreal defaultPointerAcceleration() const {
|
|
|
|
return m_defaultPointerAcceleration;
|
|
|
|
}
|
2016-05-06 09:25:11 +00:00
|
|
|
qreal pointerAcceleration() const {
|
|
|
|
return m_pointerAcceleration;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @param acceleration mapped to range [-1,1] with -1 being the slowest, 1 being the fastest supported acceleration.
|
|
|
|
**/
|
|
|
|
void setPointerAcceleration(qreal acceleration);
|
2016-12-02 13:58:56 +00:00
|
|
|
void setPointerAccelerationFromString(QString acceleration) {
|
|
|
|
setPointerAcceleration(acceleration.toDouble());
|
|
|
|
}
|
|
|
|
QString defaultPointerAccelerationToString() const {
|
|
|
|
return QString::number(m_pointerAcceleration, 'f', 3);
|
|
|
|
}
|
|
|
|
bool supportsPointerAccelerationProfileFlat() const {
|
|
|
|
return (m_supportedPointerAccelerationProfiles & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
|
|
|
|
}
|
|
|
|
bool supportsPointerAccelerationProfileAdaptive() const {
|
|
|
|
return (m_supportedPointerAccelerationProfiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
|
|
|
|
}
|
|
|
|
bool defaultPointerAccelerationProfileFlat() const {
|
|
|
|
return (m_defaultPointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
|
|
|
|
}
|
|
|
|
bool defaultPointerAccelerationProfileAdaptive() const {
|
|
|
|
return (m_defaultPointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
|
|
|
|
}
|
|
|
|
bool pointerAccelerationProfileFlat() const {
|
|
|
|
return (m_pointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
|
|
|
|
}
|
|
|
|
bool pointerAccelerationProfileAdaptive() const {
|
|
|
|
return (m_pointerAccelerationProfile & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
|
|
|
|
}
|
|
|
|
void setPointerAccelerationProfile(bool set, enum libinput_config_accel_profile profile);
|
|
|
|
void setPointerAccelerationProfileFlat(bool set) {
|
|
|
|
setPointerAccelerationProfile(set, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT);
|
|
|
|
}
|
|
|
|
void setPointerAccelerationProfileAdaptive(bool set) {
|
|
|
|
setPointerAccelerationProfile(set, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE);
|
|
|
|
}
|
2016-12-06 12:45:54 +00:00
|
|
|
void setPointerAccelerationProfileFromInt(quint32 profile) {
|
2016-12-02 13:58:56 +00:00
|
|
|
setPointerAccelerationProfile(true, (libinput_config_accel_profile) profile);
|
|
|
|
}
|
|
|
|
quint32 defaultPointerAccelerationProfileToInt() const {
|
|
|
|
return (quint32) m_defaultPointerAccelerationProfile;
|
|
|
|
}
|
[libinput] Add support for clickfinger and button areas click method
Summary:
Added support for libinput clickfinger , areas method for touchpad KCM
Also added mock methods.
Included commits in branch libinputClickMethod:
Added libinput mock methods
Added : 1. setScrollMethod 2. added key value pair in QMap 3. added methods for Q_Props
Added Q_Props for click method, signal
Added variables and initialize in constructor
Reviewers: #kwin, graesslin, davidedmundson, zzag
Reviewed By: #kwin, graesslin, zzag
Subscribers: zzag, graesslin, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17577
2018-12-22 16:29:41 +00:00
|
|
|
bool supportsClickMethodAreas() const {
|
|
|
|
return (m_supportedClickMethods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
|
|
|
|
}
|
|
|
|
bool defaultClickMethodAreas() const {
|
|
|
|
return (m_defaultClickMethod == LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
|
|
|
|
}
|
|
|
|
bool isClickMethodAreas() const {
|
|
|
|
return (m_clickMethod == LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
|
|
|
|
}
|
|
|
|
bool supportsClickMethodClickfinger() const {
|
|
|
|
return (m_supportedClickMethods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
|
|
|
|
}
|
|
|
|
bool defaultClickMethodClickfinger() const {
|
|
|
|
return (m_defaultClickMethod == LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
|
|
|
|
}
|
|
|
|
bool isClickMethodClickfinger() const {
|
|
|
|
return (m_clickMethod == LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
|
|
|
|
}
|
|
|
|
void setClickMethod(bool set, enum libinput_config_click_method method);
|
|
|
|
void setClickMethodAreas(bool set) {
|
|
|
|
setClickMethod(set, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
|
|
|
|
}
|
|
|
|
void setClickMethodClickfinger(bool set) {
|
|
|
|
setClickMethod(set, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
|
|
|
|
}
|
|
|
|
void setClickMethodFromInt(quint32 method) {
|
|
|
|
setClickMethod(true, (libinput_config_click_method) method);
|
|
|
|
}
|
|
|
|
quint32 defaultClickMethodToInt() const {
|
|
|
|
return (quint32) m_defaultClickMethod;
|
|
|
|
}
|
|
|
|
|
2016-05-06 10:28:07 +00:00
|
|
|
bool isEnabled() const {
|
|
|
|
return m_enabled;
|
|
|
|
}
|
|
|
|
void setEnabled(bool enabled);
|
|
|
|
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
libinput_device *device() const {
|
|
|
|
return m_device;
|
|
|
|
}
|
|
|
|
|
2016-11-04 14:31:35 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p config to load the Device configuration from and to store each
|
|
|
|
* successful Device configuration.
|
|
|
|
**/
|
|
|
|
void setConfig(const KConfigGroup &config) {
|
|
|
|
m_config = config;
|
|
|
|
}
|
|
|
|
|
2017-11-10 17:07:15 +00:00
|
|
|
/**
|
2019-01-12 10:31:32 +00:00
|
|
|
* The id of the screen in KWin identifiers. Set from KWin through setScreenId.
|
2017-11-10 17:07:15 +00:00
|
|
|
**/
|
|
|
|
int screenId() const {
|
|
|
|
return m_screenId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the KWin screen id for the device
|
|
|
|
**/
|
|
|
|
void setScreenId(int screenId) {
|
|
|
|
m_screenId = screenId;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setOrientation(Qt::ScreenOrientation orientation);
|
|
|
|
|
2016-11-04 14:31:35 +00:00
|
|
|
/**
|
|
|
|
* Loads the configuration and applies it to the Device
|
|
|
|
**/
|
|
|
|
void loadConfiguration();
|
|
|
|
|
2017-12-27 16:57:00 +00:00
|
|
|
bool isSwitch() const {
|
|
|
|
return m_switch;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isLidSwitch() const {
|
|
|
|
return m_lidSwitch;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isTabletModeSwitch() const {
|
|
|
|
return m_tabletSwitch;
|
|
|
|
}
|
|
|
|
|
2016-05-24 07:57:07 +00:00
|
|
|
/**
|
|
|
|
* All created Devices
|
|
|
|
**/
|
|
|
|
static QVector<Device*> devices() {
|
|
|
|
return s_devices;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Gets the Device for @p native. @c null if there is no Device for @p native.
|
|
|
|
**/
|
|
|
|
static Device *getDevice(libinput_device *native);
|
|
|
|
|
2016-05-06 07:53:36 +00:00
|
|
|
Q_SIGNALS:
|
2016-12-02 13:58:56 +00:00
|
|
|
void tapButtonMapChanged();
|
2016-05-06 07:53:36 +00:00
|
|
|
void leftHandedChanged();
|
2016-12-02 13:58:56 +00:00
|
|
|
void disableWhileTypingChanged();
|
2016-05-06 09:25:11 +00:00
|
|
|
void pointerAccelerationChanged();
|
2016-12-02 13:58:56 +00:00
|
|
|
void pointerAccelerationProfileChanged();
|
2016-05-06 10:28:07 +00:00
|
|
|
void enabledChanged();
|
2016-08-11 13:13:36 +00:00
|
|
|
void tapToClickChanged();
|
2016-08-11 14:02:26 +00:00
|
|
|
void tapAndDragChanged();
|
2016-08-11 14:32:00 +00:00
|
|
|
void tapDragLockChanged();
|
2016-10-27 17:06:34 +00:00
|
|
|
void middleEmulationChanged();
|
2016-10-28 16:30:10 +00:00
|
|
|
void naturalScrollChanged();
|
2016-10-28 18:17:20 +00:00
|
|
|
void scrollMethodChanged();
|
|
|
|
void scrollButtonChanged();
|
[libinput] Add support for clickfinger and button areas click method
Summary:
Added support for libinput clickfinger , areas method for touchpad KCM
Also added mock methods.
Included commits in branch libinputClickMethod:
Added libinput mock methods
Added : 1. setScrollMethod 2. added key value pair in QMap 3. added methods for Q_Props
Added Q_Props for click method, signal
Added variables and initialize in constructor
Reviewers: #kwin, graesslin, davidedmundson, zzag
Reviewed By: #kwin, graesslin, zzag
Subscribers: zzag, graesslin, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17577
2018-12-22 16:29:41 +00:00
|
|
|
void clickMethodChanged();
|
2016-05-06 07:53:36 +00:00
|
|
|
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
private:
|
2016-11-04 14:31:35 +00:00
|
|
|
template <typename T>
|
|
|
|
void writeEntry(const ConfigKey &key, const T &value);
|
|
|
|
template <typename T, typename Setter>
|
|
|
|
void readEntry(const QByteArray &key, const Setter &s, const T &defaultValue = T());
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
libinput_device *m_device;
|
|
|
|
bool m_keyboard;
|
|
|
|
bool m_alphaNumericKeyboard = false;
|
|
|
|
bool m_pointer;
|
|
|
|
bool m_touch;
|
|
|
|
bool m_tabletTool;
|
|
|
|
bool m_tabletPad;
|
|
|
|
bool m_supportsGesture;
|
2017-12-27 16:57:00 +00:00
|
|
|
bool m_switch = false;
|
|
|
|
bool m_lidSwitch = false;
|
|
|
|
bool m_tabletSwitch = false;
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
QString m_name;
|
|
|
|
QString m_sysName;
|
|
|
|
QString m_outputName;
|
|
|
|
QSizeF m_size;
|
|
|
|
quint32 m_product;
|
|
|
|
quint32 m_vendor;
|
|
|
|
Qt::MouseButtons m_supportedButtons = Qt::NoButton;
|
|
|
|
int m_tapFingerCount;
|
2016-12-02 13:58:56 +00:00
|
|
|
enum libinput_config_tap_button_map m_defaultTapButtonMap;
|
|
|
|
enum libinput_config_tap_button_map m_tapButtonMap;
|
2016-08-11 13:18:40 +00:00
|
|
|
bool m_tapToClickEnabledByDefault;
|
2016-08-11 13:13:36 +00:00
|
|
|
bool m_tapToClick;
|
2016-08-11 14:02:26 +00:00
|
|
|
bool m_tapAndDragEnabledByDefault;
|
|
|
|
bool m_tapAndDrag;
|
2016-08-11 14:32:00 +00:00
|
|
|
bool m_tapDragLockEnabledByDefault;
|
|
|
|
bool m_tapDragLock;
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
bool m_supportsDisableWhileTyping;
|
|
|
|
bool m_supportsPointerAcceleration;
|
|
|
|
bool m_supportsLeftHanded;
|
|
|
|
bool m_supportsCalibrationMatrix;
|
|
|
|
bool m_supportsDisableEvents;
|
|
|
|
bool m_supportsDisableEventsOnExternalMouse;
|
2016-10-27 17:06:34 +00:00
|
|
|
bool m_supportsMiddleEmulation;
|
2016-10-28 16:30:10 +00:00
|
|
|
bool m_supportsNaturalScroll;
|
2016-10-28 18:17:20 +00:00
|
|
|
quint32 m_supportedScrollMethods;
|
|
|
|
bool m_supportsScrollEdge;
|
|
|
|
bool m_supportsScrollOnButtonDown;
|
2016-11-22 13:49:01 +00:00
|
|
|
bool m_leftHandedEnabledByDefault;
|
2016-10-27 17:06:34 +00:00
|
|
|
bool m_middleEmulationEnabledByDefault;
|
2016-10-28 16:30:10 +00:00
|
|
|
bool m_naturalScrollEnabledByDefault;
|
2016-10-28 18:17:20 +00:00
|
|
|
enum libinput_config_scroll_method m_defaultScrollMethod;
|
|
|
|
quint32 m_defaultScrollButton;
|
2016-12-02 13:58:56 +00:00
|
|
|
bool m_disableWhileTypingEnabledByDefault;
|
|
|
|
bool m_disableWhileTyping;
|
2016-10-27 17:06:34 +00:00
|
|
|
bool m_middleEmulation;
|
2016-05-06 07:53:36 +00:00
|
|
|
bool m_leftHanded;
|
2016-10-28 16:30:10 +00:00
|
|
|
bool m_naturalScroll;
|
2016-10-28 18:17:20 +00:00
|
|
|
enum libinput_config_scroll_method m_scrollMethod;
|
|
|
|
quint32 m_scrollButton;
|
2016-12-02 13:58:56 +00:00
|
|
|
qreal m_defaultPointerAcceleration;
|
2016-05-06 09:25:11 +00:00
|
|
|
qreal m_pointerAcceleration;
|
2016-12-02 13:58:56 +00:00
|
|
|
quint32 m_supportedPointerAccelerationProfiles;
|
|
|
|
enum libinput_config_accel_profile m_defaultPointerAccelerationProfile;
|
|
|
|
enum libinput_config_accel_profile m_pointerAccelerationProfile;
|
2016-05-06 10:28:07 +00:00
|
|
|
bool m_enabled;
|
2016-05-24 07:57:07 +00:00
|
|
|
|
2016-11-04 14:31:35 +00:00
|
|
|
KConfigGroup m_config;
|
|
|
|
bool m_loading = false;
|
|
|
|
|
2017-11-10 17:07:15 +00:00
|
|
|
int m_screenId = 0;
|
|
|
|
Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation;
|
|
|
|
QMatrix4x4 m_defaultCalibrationMatrix;
|
[libinput] Add support for clickfinger and button areas click method
Summary:
Added support for libinput clickfinger , areas method for touchpad KCM
Also added mock methods.
Included commits in branch libinputClickMethod:
Added libinput mock methods
Added : 1. setScrollMethod 2. added key value pair in QMap 3. added methods for Q_Props
Added Q_Props for click method, signal
Added variables and initialize in constructor
Reviewers: #kwin, graesslin, davidedmundson, zzag
Reviewed By: #kwin, graesslin, zzag
Subscribers: zzag, graesslin, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17577
2018-12-22 16:29:41 +00:00
|
|
|
quint32 m_supportedClickMethods;
|
|
|
|
enum libinput_config_click_method m_defaultClickMethod;
|
|
|
|
enum libinput_config_click_method m_clickMethod;
|
2017-11-10 17:07:15 +00:00
|
|
|
|
2016-05-24 07:57:07 +00:00
|
|
|
static QVector<Device*> s_devices;
|
[libinput] Add a wrapper class Device for a libinput_device
Summary:
The Device class wraps all the information we can get from libinput
about the device, like whether it's a keyboard, pointer, touch, etc.
In addition some more information is queried to figure out how "useful"
a device is. For a keyboard all alphanumeric keys are checked whether
they exist, for a pointer all (normal) buttons are queried.
All the information is exposed as Q_PROPERTY and used by the
DebugConsole. The DebugConsole gained a new tab "Input Devices" which
renders all devices and their properties in a tree view. When plugging
in/out a device, the model gets reset, so it's always up to date.
The new Device class can be used in future to configure the device,
e.g. disable touch pad, set mouse acceleration, etc.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1538
2016-05-04 11:42:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(KWin::LibInput::Device*)
|
|
|
|
|
|
|
|
#endif
|