KWin
|
Manager for the global shortcut system inside KWin. More...
#include <globalshortcuts.h>
Public Member Functions | |
GlobalShortcutsManager (QObject *parent=nullptr) | |
~GlobalShortcutsManager () override | |
void | init () |
void | registerPointerShortcut (QAction *action, Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons) |
Registers an internal global pointer shortcut. | |
void | registerAxisShortcut (QAction *action, Qt::KeyboardModifiers modifiers, PointerAxisDirection axis) |
Registers an internal global axis shortcut. | |
void | registerTouchpadSwipe (SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={}) |
void | registerTouchpadPinch (PinchDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={}) |
void | registerTouchscreenSwipe (SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function< void(qreal)> progressCallback={}) |
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. | |
bool | processKeyRelease (Qt::KeyboardModifiers modifiers, int keyQt) |
bool | processPointerPressed (Qt::KeyboardModifiers modifiers, Qt::MouseButtons pointerButtons) |
bool | processAxis (Qt::KeyboardModifiers modifiers, PointerAxisDirection axis) |
Processes a pointer axis event to decide whether a shortcut needs to be triggered. | |
void | processSwipeStart (DeviceType device, uint fingerCount) |
void | processSwipeUpdate (DeviceType device, const QPointF &delta) |
void | processSwipeCancel (DeviceType device) |
void | processSwipeEnd (DeviceType device) |
void | processPinchStart (uint fingerCount) |
void | processPinchUpdate (qreal scale, qreal angleDelta, const QPointF &delta) |
void | processPinchCancel () |
void | processPinchEnd () |
void | setKGlobalAccelInterface (KGlobalAccelInterface *interface) |
Manager for the global shortcut system inside KWin.
This class is responsible for holding all the global shortcuts and to process a key press event. That is trigger a shortcut if there is a match.
For internal shortcut handling (those which are delivered inside KWin) QActions are used and triggered if the shortcut matches. For external shortcut handling a DBus interface is used.
Definition at line 42 of file globalshortcuts.h.
|
explicit |
Definition at line 86 of file globalshortcuts.cpp.
|
override |
Definition at line 93 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::forceRegisterTouchscreenSwipe | ( | SwipeDirection | direction, |
uint32_t | fingerCount, | ||
QAction * | action, | ||
std::function< void(qreal)> | progressCallback = {} ) |
Definition at line 161 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::init | ( | ) |
Definition at line 97 of file globalshortcuts.cpp.
bool KWin::GlobalShortcutsManager::processAxis | ( | Qt::KeyboardModifiers | modifiers, |
PointerAxisDirection | axis ) |
Processes a pointer axis event to decide whether a shortcut needs to be triggered.
If a shortcut triggered this method returns true
to indicate to the caller that the event should not be further processed. If there is no shortcut which triggered for the key, then false
is returned.
modifiers | The current hold modifiers |
axis | The axis direction which has triggered this event |
true
if a shortcut triggered, false
otherwise Definition at line 242 of file globalshortcuts.cpp.
bool KWin::GlobalShortcutsManager::processKey | ( | Qt::KeyboardModifiers | modifiers, |
int | keyQt ) |
Processes a key event to decide whether a shortcut needs to be triggered.
If a shortcut triggered this method returns true
to indicate to the caller that the event should not be further processed. If there is no shortcut which triggered for the key, then false
is returned.
modifiers | The current hold modifiers |
keyQt | The Qt::Key which got pressed |
true
if a shortcut triggered, false
otherwise Definition at line 175 of file globalshortcuts.cpp.
bool KWin::GlobalShortcutsManager::processKeyRelease | ( | Qt::KeyboardModifiers | modifiers, |
int | keyQt ) |
Definition at line 211 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processPinchCancel | ( | ) |
Definition at line 294 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processPinchEnd | ( | ) |
Definition at line 299 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processPinchStart | ( | uint | fingerCount | ) |
Definition at line 284 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processPinchUpdate | ( | qreal | scale, |
qreal | angleDelta, | ||
const QPointF & | delta ) |
Definition at line 289 of file globalshortcuts.cpp.
bool KWin::GlobalShortcutsManager::processPointerPressed | ( | Qt::KeyboardModifiers | modifiers, |
Qt::MouseButtons | pointerButtons ) |
Definition at line 237 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processSwipeCancel | ( | DeviceType | device | ) |
Definition at line 265 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processSwipeEnd | ( | DeviceType | device | ) |
Definition at line 274 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processSwipeStart | ( | DeviceType | device, |
uint | fingerCount ) |
Definition at line 247 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::processSwipeUpdate | ( | DeviceType | device, |
const QPointF & | delta ) |
Definition at line 256 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::registerAxisShortcut | ( | QAction * | action, |
Qt::KeyboardModifiers | modifiers, | ||
PointerAxisDirection | axis ) |
Registers an internal global axis shortcut.
action | The action to trigger if the shortcut is triggered |
modifiers | The modifiers which need to be hold to trigger the action |
axis | The pointer axis |
Definition at line 141 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::registerPointerShortcut | ( | QAction * | action, |
Qt::KeyboardModifiers | modifiers, | ||
Qt::MouseButtons | pointerButtons ) |
Registers an internal global pointer shortcut.
action | The action to trigger if the shortcut is pressed |
modifiers | The modifiers which need to be hold to trigger the action |
pointerButtons | The pointer button which needs to be pressed |
Definition at line 136 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::registerTouchpadPinch | ( | PinchDirection | direction, |
uint32_t | fingerCount, | ||
QAction * | action, | ||
std::function< void(qreal)> | progressCallback = {} ) |
Definition at line 151 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::registerTouchpadSwipe | ( | SwipeDirection | direction, |
uint32_t | fingerCount, | ||
QAction * | action, | ||
std::function< void(qreal)> | progressCallback = {} ) |
Definition at line 146 of file globalshortcuts.cpp.
void KWin::GlobalShortcutsManager::registerTouchscreenSwipe | ( | SwipeDirection | direction, |
uint32_t | fingerCount, | ||
QAction * | action, | ||
std::function< void(qreal)> | progressCallback = {} ) |
Definition at line 156 of file globalshortcuts.cpp.
|
inline |
Definition at line 109 of file globalshortcuts.h.