Changeset View
Changeset View
Standalone View
Standalone View
globalshortcuts.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
48 | { | 48 | { | ||
49 | Q_OBJECT | 49 | Q_OBJECT | ||
50 | public: | 50 | public: | ||
51 | explicit GlobalShortcutsManager(QObject *parent = nullptr); | 51 | explicit GlobalShortcutsManager(QObject *parent = nullptr); | ||
52 | virtual ~GlobalShortcutsManager(); | 52 | virtual ~GlobalShortcutsManager(); | ||
53 | void init(); | 53 | void init(); | ||
54 | 54 | | |||
55 | /** | 55 | /** | ||
56 | * @brief Registers an internal global shortcut | | |||
57 | * | | |||
58 | * @param action The action to trigger if the shortcut is pressed | | |||
59 | * @param shortcut The key sequence which triggers this shortcut | | |||
60 | */ | | |||
61 | void registerShortcut(QAction *action, const QKeySequence &shortcut); | | |||
62 | /** | | |||
63 | * @brief Registers an internal global pointer shortcut | 56 | * @brief Registers an internal global pointer shortcut | ||
64 | * | 57 | * | ||
65 | * @param action The action to trigger if the shortcut is pressed | 58 | * @param action The action to trigger if the shortcut is pressed | ||
66 | * @param modifiers The modifiers which need to be hold to trigger the action | 59 | * @param modifiers The modifiers which need to be hold to trigger the action | ||
67 | * @param pointerButtons The pointer button which needs to be pressed | 60 | * @param pointerButtons The pointer button which needs to be pressed | ||
68 | */ | 61 | */ | ||
69 | void registerPointerShortcut(QAction *action, Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons); | 62 | void registerPointerShortcut(QAction *action, Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons); | ||
70 | /** | 63 | /** | ||
Show All 34 Lines | |||||
105 | 98 | | |||
106 | void setKGlobalAccelInterface(KGlobalAccelInterface *interface) { | 99 | void setKGlobalAccelInterface(KGlobalAccelInterface *interface) { | ||
107 | m_kglobalAccelInterface = interface; | 100 | m_kglobalAccelInterface = interface; | ||
108 | } | 101 | } | ||
109 | 102 | | |||
110 | private: | 103 | private: | ||
111 | void objectDeleted(QObject *object); | 104 | void objectDeleted(QObject *object); | ||
112 | QKeySequence getShortcutForAction(const QString &componentName, const QString &actionName, const QKeySequence &defaultShortcut); | 105 | QKeySequence getShortcutForAction(const QString &componentName, const QString &actionName, const QKeySequence &defaultShortcut); | ||
113 | QHash<Qt::KeyboardModifiers, QHash<uint32_t, GlobalShortcut*> > m_shortcuts; | | |||
114 | QHash<Qt::KeyboardModifiers, QHash<Qt::MouseButtons, GlobalShortcut*> > m_pointerShortcuts; | 106 | QHash<Qt::KeyboardModifiers, QHash<Qt::MouseButtons, GlobalShortcut*> > m_pointerShortcuts; | ||
115 | QHash<Qt::KeyboardModifiers, QHash<PointerAxisDirection, GlobalShortcut*> > m_axisShortcuts; | 107 | QHash<Qt::KeyboardModifiers, QHash<PointerAxisDirection, GlobalShortcut*> > m_axisShortcuts; | ||
116 | KSharedConfigPtr m_config; | 108 | KSharedConfigPtr m_config; | ||
117 | KGlobalAccelD *m_kglobalAccel = nullptr; | 109 | KGlobalAccelD *m_kglobalAccel = nullptr; | ||
118 | KGlobalAccelInterface *m_kglobalAccelInterface = nullptr; | 110 | KGlobalAccelInterface *m_kglobalAccelInterface = nullptr; | ||
119 | }; | 111 | }; | ||
120 | 112 | | |||
121 | class GlobalShortcut | 113 | class GlobalShortcut | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |