KWin
Loading...
Searching...
No Matches
modifier_only_shortcuts.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, 2017 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "input_event_spy.h"
12#include <kwin_export.h>
13
14#include <QObject>
15#include <QSet>
16
17namespace KWin
18{
19
20class KWIN_EXPORT ModifierOnlyShortcuts : public QObject, public InputEventSpy
21{
22 Q_OBJECT
23public:
24 explicit ModifierOnlyShortcuts();
26
27 void keyEvent(KeyEvent *event) override;
28 void pointerEvent(MouseEvent *event) override;
29 void wheelEvent(WheelEvent *event) override;
30
31 void reset()
32 {
33 m_modifier = Qt::NoModifier;
34 }
35
36private:
37 Qt::KeyboardModifier m_modifier = Qt::NoModifier;
38 Qt::KeyboardModifiers m_cachedMods;
39 Qt::MouseButtons m_pressedButtons;
40 QSet<quint32> m_pressedKeys;
41};
42
43}