KWin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KWin::GlobalShortcutsManager Class Reference

Manager for the global shortcut system inside KWin. More...

#include <globalshortcuts.h>

Inheritance diagram for KWin::GlobalShortcutsManager:

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GlobalShortcutsManager()

KWin::GlobalShortcutsManager::GlobalShortcutsManager ( QObject * parent = nullptr)
explicit

Definition at line 86 of file globalshortcuts.cpp.

◆ ~GlobalShortcutsManager()

KWin::GlobalShortcutsManager::~GlobalShortcutsManager ( )
override

Definition at line 93 of file globalshortcuts.cpp.

Member Function Documentation

◆ forceRegisterTouchscreenSwipe()

void KWin::GlobalShortcutsManager::forceRegisterTouchscreenSwipe ( SwipeDirection direction,
uint32_t fingerCount,
QAction * action,
std::function< void(qreal)> progressCallback = {} )

Definition at line 161 of file globalshortcuts.cpp.

◆ init()

void KWin::GlobalShortcutsManager::init ( )

Definition at line 97 of file globalshortcuts.cpp.

◆ processAxis()

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.

Parameters
modifiersThe current hold modifiers
axisThe axis direction which has triggered this event
Returns
true if a shortcut triggered, false otherwise

Definition at line 242 of file globalshortcuts.cpp.

◆ processKey()

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.

Parameters
modifiersThe current hold modifiers
keyQtThe Qt::Key which got pressed
Returns
true if a shortcut triggered, false otherwise

Definition at line 175 of file globalshortcuts.cpp.

◆ processKeyRelease()

bool KWin::GlobalShortcutsManager::processKeyRelease ( Qt::KeyboardModifiers modifiers,
int keyQt )

Definition at line 211 of file globalshortcuts.cpp.

◆ processPinchCancel()

void KWin::GlobalShortcutsManager::processPinchCancel ( )

Definition at line 294 of file globalshortcuts.cpp.

◆ processPinchEnd()

void KWin::GlobalShortcutsManager::processPinchEnd ( )

Definition at line 299 of file globalshortcuts.cpp.

◆ processPinchStart()

void KWin::GlobalShortcutsManager::processPinchStart ( uint fingerCount)

Definition at line 284 of file globalshortcuts.cpp.

◆ processPinchUpdate()

void KWin::GlobalShortcutsManager::processPinchUpdate ( qreal scale,
qreal angleDelta,
const QPointF & delta )

Definition at line 289 of file globalshortcuts.cpp.

◆ processPointerPressed()

bool KWin::GlobalShortcutsManager::processPointerPressed ( Qt::KeyboardModifiers modifiers,
Qt::MouseButtons pointerButtons )

Definition at line 237 of file globalshortcuts.cpp.

◆ processSwipeCancel()

void KWin::GlobalShortcutsManager::processSwipeCancel ( DeviceType device)

Definition at line 265 of file globalshortcuts.cpp.

◆ processSwipeEnd()

void KWin::GlobalShortcutsManager::processSwipeEnd ( DeviceType device)

Definition at line 274 of file globalshortcuts.cpp.

◆ processSwipeStart()

void KWin::GlobalShortcutsManager::processSwipeStart ( DeviceType device,
uint fingerCount )

Definition at line 247 of file globalshortcuts.cpp.

◆ processSwipeUpdate()

void KWin::GlobalShortcutsManager::processSwipeUpdate ( DeviceType device,
const QPointF & delta )

Definition at line 256 of file globalshortcuts.cpp.

◆ registerAxisShortcut()

void KWin::GlobalShortcutsManager::registerAxisShortcut ( QAction * action,
Qt::KeyboardModifiers modifiers,
PointerAxisDirection axis )

Registers an internal global axis shortcut.

Parameters
actionThe action to trigger if the shortcut is triggered
modifiersThe modifiers which need to be hold to trigger the action
axisThe pointer axis

Definition at line 141 of file globalshortcuts.cpp.

◆ registerPointerShortcut()

void KWin::GlobalShortcutsManager::registerPointerShortcut ( QAction * action,
Qt::KeyboardModifiers modifiers,
Qt::MouseButtons pointerButtons )

Registers an internal global pointer shortcut.

Parameters
actionThe action to trigger if the shortcut is pressed
modifiersThe modifiers which need to be hold to trigger the action
pointerButtonsThe pointer button which needs to be pressed

Definition at line 136 of file globalshortcuts.cpp.

◆ registerTouchpadPinch()

void KWin::GlobalShortcutsManager::registerTouchpadPinch ( PinchDirection direction,
uint32_t fingerCount,
QAction * action,
std::function< void(qreal)> progressCallback = {} )

Definition at line 151 of file globalshortcuts.cpp.

◆ registerTouchpadSwipe()

void KWin::GlobalShortcutsManager::registerTouchpadSwipe ( SwipeDirection direction,
uint32_t fingerCount,
QAction * action,
std::function< void(qreal)> progressCallback = {} )

Definition at line 146 of file globalshortcuts.cpp.

◆ registerTouchscreenSwipe()

void KWin::GlobalShortcutsManager::registerTouchscreenSwipe ( SwipeDirection direction,
uint32_t fingerCount,
QAction * action,
std::function< void(qreal)> progressCallback = {} )

Definition at line 156 of file globalshortcuts.cpp.

◆ setKGlobalAccelInterface()

void KWin::GlobalShortcutsManager::setKGlobalAccelInterface ( KGlobalAccelInterface * interface)
inline

Definition at line 109 of file globalshortcuts.h.


The documentation for this class was generated from the following files: