2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2017-02-03 16:26:51 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2016, 2017 Martin Gräßlin <mgraesslin@kde.org>
|
2017-02-03 16:26:51 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2022-12-16 20:08:44 +00:00
|
|
|
#pragma once
|
2017-02-03 16:26:51 +00:00
|
|
|
|
|
|
|
#include "input_event_spy.h"
|
|
|
|
#include <kwin_export.h>
|
|
|
|
|
|
|
|
#include <QObject>
|
2017-02-15 06:00:53 +00:00
|
|
|
#include <QSet>
|
2017-02-03 16:26:51 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class KWIN_EXPORT ModifierOnlyShortcuts : public QObject, public InputEventSpy
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit ModifierOnlyShortcuts();
|
|
|
|
~ModifierOnlyShortcuts() override;
|
|
|
|
|
|
|
|
void keyEvent(KeyEvent *event) override;
|
|
|
|
void pointerEvent(MouseEvent *event) override;
|
|
|
|
void wheelEvent(WheelEvent *event) override;
|
|
|
|
|
2022-03-23 10:13:38 +00:00
|
|
|
void reset()
|
|
|
|
{
|
2017-02-03 16:26:51 +00:00
|
|
|
m_modifier = Qt::NoModifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Qt::KeyboardModifier m_modifier = Qt::NoModifier;
|
|
|
|
Qt::KeyboardModifiers m_cachedMods;
|
2021-07-02 20:23:13 +00:00
|
|
|
Qt::MouseButtons m_pressedButtons;
|
2017-02-15 06:00:53 +00:00
|
|
|
QSet<quint32> m_pressedKeys;
|
2017-02-03 16:26:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|