Changeset View
Changeset View
Standalone View
Standalone View
modifier_only_shortcuts.h
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_MODIFIER_ONLY_SHORTCUTS_H | 20 | #ifndef KWIN_MODIFIER_ONLY_SHORTCUTS_H | ||
21 | #define KWIN_MODIFIER_ONLY_SHORTCUTS_H | 21 | #define KWIN_MODIFIER_ONLY_SHORTCUTS_H | ||
22 | 22 | | |||
23 | #include "input_event_spy.h" | 23 | #include "input_event_spy.h" | ||
24 | #include <kwin_export.h> | 24 | #include <kwin_export.h> | ||
25 | 25 | | |||
26 | #include <QObject> | 26 | #include <QObject> | ||
27 | #include <QSet> | ||||
27 | 28 | | |||
28 | namespace KWin | 29 | namespace KWin | ||
29 | { | 30 | { | ||
30 | 31 | | |||
31 | class KWIN_EXPORT ModifierOnlyShortcuts : public QObject, public InputEventSpy | 32 | class KWIN_EXPORT ModifierOnlyShortcuts : public QObject, public InputEventSpy | ||
32 | { | 33 | { | ||
33 | Q_OBJECT | 34 | Q_OBJECT | ||
34 | public: | 35 | public: | ||
35 | explicit ModifierOnlyShortcuts(); | 36 | explicit ModifierOnlyShortcuts(); | ||
36 | ~ModifierOnlyShortcuts() override; | 37 | ~ModifierOnlyShortcuts() override; | ||
37 | 38 | | |||
38 | void keyEvent(KeyEvent *event) override; | 39 | void keyEvent(KeyEvent *event) override; | ||
39 | void pointerEvent(MouseEvent *event) override; | 40 | void pointerEvent(MouseEvent *event) override; | ||
40 | void wheelEvent(WheelEvent *event) override; | 41 | void wheelEvent(WheelEvent *event) override; | ||
41 | 42 | | |||
42 | void reset() { | 43 | void reset() { | ||
43 | m_modifier = Qt::NoModifier; | 44 | m_modifier = Qt::NoModifier; | ||
44 | } | 45 | } | ||
45 | 46 | | |||
46 | private: | 47 | private: | ||
47 | uint m_pressCount = 0; | | |||
48 | Qt::KeyboardModifier m_modifier = Qt::NoModifier; | 48 | Qt::KeyboardModifier m_modifier = Qt::NoModifier; | ||
49 | Qt::KeyboardModifiers m_cachedMods; | 49 | Qt::KeyboardModifiers m_cachedMods; | ||
50 | uint m_buttonPressCount = 0; | 50 | uint m_buttonPressCount = 0; | ||
51 | QSet<quint32> m_pressedKeys; | ||||
51 | }; | 52 | }; | ||
52 | 53 | | |||
53 | } | 54 | } | ||
54 | 55 | | |||
55 | #endif | 56 | #endif |