KWin
Loading...
Searching...
No Matches
tablet_input.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: 2019 Aleix Pol Gonzalez <aleixpol@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9
10#pragma once
11#include "input.h"
12
13#include <QHash>
14#include <QObject>
15#include <QPointF>
16#include <QPointer>
17
18namespace KWin
19{
20class Window;
21class TabletToolId;
22
23namespace Decoration
24{
25class DecoratedClientImpl;
26}
27
28namespace LibInput
29{
30class Device;
31}
32
34{
35 Q_OBJECT
36public:
39
40 void tabletPad();
41 bool focusUpdatesBlocked() override;
42
44 qreal pressure, int xTilt, int yTilt, qreal rotation, bool tipDown,
45 bool tipNear, const TabletToolId &tabletToolId,
46 std::chrono::microseconds time);
47 void tabletToolButtonEvent(uint button, bool isPressed, const TabletToolId &tabletToolId, std::chrono::microseconds time);
48
49 void tabletPadButtonEvent(uint button, bool isPressed, const TabletPadId &tabletPadId, std::chrono::microseconds time);
50 void tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time);
51 void tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time);
52
53 bool positionValid() const override
54 {
55 return !m_lastPosition.isNull();
56 }
57 void init() override;
58
59 QPointF position() const override
60 {
61 return m_lastPosition;
62 }
63
64private:
65 void cleanupDecoration(Decoration::DecoratedClientImpl *old,
67 void focusUpdate(Window *focusOld, Window *focusNow) override;
68
69 bool m_tipDown = false;
70 bool m_tipNear = false;
71
72 QPointF m_lastPosition;
73 QMetaObject::Connection m_decorationGeometryConnection;
74 QMetaObject::Connection m_decorationDestroyedConnection;
75};
76
77}
This class is responsible for redirecting incoming input to the surface which currently has input or ...
Definition input.h:70
void tabletPadButtonEvent(uint button, bool isPressed, const TabletPadId &tabletPadId, std::chrono::microseconds time)
void tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time)
void tabletToolButtonEvent(uint button, bool isPressed, const TabletToolId &tabletToolId, std::chrono::microseconds time)
bool positionValid() const override
void tabletToolEvent(KWin::InputRedirection::TabletEventType type, const QPointF &pos, qreal pressure, int xTilt, int yTilt, qreal rotation, bool tipDown, bool tipNear, const TabletToolId &tabletToolId, std::chrono::microseconds time)
QPointF position() const override
TabletInputRedirection(InputRedirection *parent)
void tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time)
bool focusUpdatesBlocked() override
Session::Type type
Definition session.cpp:17