13#include <QKeySequence>
19class KGlobalAccelInterface;
26class GestureRecognizer;
57 void registerPointerShortcut(QAction *action, Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons);
83 bool processKey(Qt::KeyboardModifiers modifiers,
int keyQt);
111 m_kglobalAccelInterface = interface;
115 void objectDeleted(QObject *
object);
118 QList<GlobalShortcut> m_shortcuts;
120 std::unique_ptr<KGlobalAccelD> m_kglobalAccel;
121 KGlobalAccelInterface *m_kglobalAccelInterface =
nullptr;
122 std::unique_ptr<GestureRecognizer> m_touchpadGestureRecognizer;
123 std::unique_ptr<GestureRecognizer> m_touchscreenGestureRecognizer;
178using Shortcut = std::variant<KeyboardShortcut, PointerButtonShortcut, PointerAxisShortcut, RealtimeFeedbackSwipeShortcut, RealtimeFeedbackPinchShortcut>;
193 std::shared_ptr<SwipeGesture> m_swipeGesture;
194 std::shared_ptr<PinchGesture> m_pinchGesture;
196 QAction *m_action =
nullptr;
const Shortcut & shortcut() const
GlobalShortcut(Shortcut &&shortcut, QAction *action)
PinchGesture * pinchGesture() const
SwipeGesture * swipeGesture() const
Manager for the global shortcut system inside KWin.
void setKGlobalAccelInterface(KGlobalAccelInterface *interface)
void registerTouchpadPinch(PinchDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={})
void processSwipeEnd(DeviceType device)
void processPinchUpdate(qreal scale, qreal angleDelta, const QPointF &delta)
GlobalShortcutsManager(QObject *parent=nullptr)
void processSwipeUpdate(DeviceType device, const QPointF &delta)
void processPinchCancel()
void registerPointerShortcut(QAction *action, Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons)
Registers an internal global pointer shortcut.
void processSwipeCancel(DeviceType device)
bool processKeyRelease(Qt::KeyboardModifiers modifiers, int keyQt)
void forceRegisterTouchscreenSwipe(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={})
bool processKey(Qt::KeyboardModifiers modifiers, int keyQt)
Processes a key event to decide whether a shortcut needs to be triggered.
~GlobalShortcutsManager() override
void registerTouchpadSwipe(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={})
bool processAxis(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis)
Processes a pointer axis event to decide whether a shortcut needs to be triggered.
bool processPointerPressed(Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons)
void processPinchStart(uint fingerCount)
void processSwipeStart(DeviceType device, uint fingerCount)
void registerTouchscreenSwipe(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={})
void registerAxisShortcut(QAction *action, Qt::KeyboardModifiers modifiers, PointerAxisDirection axis)
Registers an internal global axis shortcut.
std::variant< KeyboardShortcut, PointerButtonShortcut, PointerAxisShortcut, RealtimeFeedbackSwipeShortcut, RealtimeFeedbackPinchShortcut > Shortcut
PointerAxisDirection
The direction in which a pointer axis is moved.
SwipeDirection
Directions for swipe gestures.
bool operator==(const KeyboardShortcut &rhs) const
Qt::KeyboardModifiers axisModifiers
bool operator==(const PointerAxisShortcut &rhs) const
PointerAxisDirection axisDirection
std::function< void(qreal)> scaleCallback
bool operator==(const T &rhs) const
bool operator==(const T &rhs) const
std::function< void(qreal)> progressCallback