From 2d4d14b1b7dc58698e320d83f8a8016755a79451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 15 Jul 2013 12:04:13 +0200 Subject: [PATCH] Export Pointer Axis shortcuts to the effect system --- effects.cpp | 5 +++++ effects.h | 1 + libkwineffects/kwineffects.h | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/effects.cpp b/effects.cpp index f6841a582f..65d4d05c56 100644 --- a/effects.cpp +++ b/effects.cpp @@ -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 diff --git a/effects.h b/effects.h index 3ff4df4fd3..1f0ce6499b 100644 --- a/effects.h +++ b/effects.h @@ -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; diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index c8aabce504..af66d602cc 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -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