Export Pointer Axis shortcuts to the effect system

This commit is contained in:
Martin Gräßlin 2013-07-15 12:04:13 +02:00
parent 4b372ba57e
commit 2d4d14b1b7
3 changed files with 14 additions and 0 deletions

View file

@ -830,6 +830,11 @@ void EffectsHandlerImpl::registerPointerShortcut(Qt::KeyboardModifiers modifiers
input()->registerPointerShortcut(modifiers, pointerButtons, action);
}
void EffectsHandlerImpl::registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action)
{
input()->registerAxisShortcut(modifiers, axis, action);
}
void* EffectsHandlerImpl::getProxy(QString name)
{
// All effects start with "kwin4_effect_", prepend it to the name

View file

@ -120,6 +120,7 @@ public:
void stopMouseInterception(Effect *effect) override;
void registerGlobalShortcut(const QKeySequence &shortcut, QAction *action) override;
void registerPointerShortcut(Qt::KeyboardModifiers modifiers, Qt::MouseButton pointerButtons, QAction *action) override;
void registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action) override;
void* getProxy(QString name) override;
void startMousePolling() override;
void stopMousePolling() override;

View file

@ -750,6 +750,14 @@ public:
* @param action The action which gets triggered when the shortcut matches
**/
virtual void registerPointerShortcut(Qt::KeyboardModifiers modifiers, Qt::MouseButton pointerButtons, QAction *action) = 0;
/**
* @brief Registers a global axis shortcut with the provided @p action.
*
* @param modifiers The keyboard modifiers which need to be holded
* @param axis The direction in which the axis needs to be moved
* @param action The action which gets triggered when the shortcut matches
**/
virtual void registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action) = 0;
/**
* Retrieve the proxy class for an effect if it has one. Will return NULL if