File indexing completed on 2024-04-28 16:48:43

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 #include "input.h"
0011 
0012 #include <QElapsedTimer>
0013 
0014 #include <kwin_export.h>
0015 
0016 namespace KWin
0017 {
0018 
0019 class DrmBackend;
0020 
0021 class KWIN_EXPORT DpmsInputEventFilter : public InputEventFilter
0022 {
0023 public:
0024     DpmsInputEventFilter();
0025     ~DpmsInputEventFilter() override;
0026 
0027     bool pointerEvent(MouseEvent *event, quint32 nativeButton) override;
0028     bool wheelEvent(WheelEvent *event) override;
0029     bool keyEvent(KeyEvent *event) override;
0030     bool touchDown(qint32 id, const QPointF &pos, std::chrono::microseconds time) override;
0031     bool touchMotion(qint32 id, const QPointF &pos, std::chrono::microseconds time) override;
0032     bool touchUp(qint32 id, std::chrono::microseconds time) override;
0033 
0034 private:
0035     void notify();
0036     QElapsedTimer m_doubleTapTimer;
0037     QVector<qint32> m_touchPoints;
0038     bool m_secondTap = false;
0039     bool m_enableDoubleTap;
0040 };
0041 
0042 }