unify touchpad gesture APIs
There don't need to be separate functions for real time and not real time
This commit is contained in:
parent
e5901070cc
commit
a9334cb9c6
12 changed files with 53 additions and 130 deletions
|
@ -23,15 +23,15 @@ void InputRedirection::registerAxisShortcut(Qt::KeyboardModifiers modifiers, Poi
|
|||
{
|
||||
}
|
||||
|
||||
void InputRedirection::registerTouchpadSwipeShortcut(SwipeDirection, uint fingerCount, QAction *)
|
||||
void InputRedirection::registerTouchpadSwipeShortcut(SwipeDirection direction, uint32_t fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
}
|
||||
|
||||
void InputRedirection::registerRealtimeTouchpadSwipeShortcut(SwipeDirection, uint fingerCount, QAction *, std::function<void(qreal)> progressCallback)
|
||||
void InputRedirection::registerTouchpadPinchShortcut(PinchDirection direction, uint32_t fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
}
|
||||
|
||||
void InputRedirection::registerTouchscreenSwipeShortcut(SwipeDirection, uint, QAction *, std::function<void(qreal)>)
|
||||
void InputRedirection::registerTouchscreenSwipeShortcut(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -806,24 +806,14 @@ void EffectsHandlerImpl::registerAxisShortcut(Qt::KeyboardModifiers modifiers, P
|
|||
input()->registerAxisShortcut(modifiers, axis, action);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::registerRealtimeTouchpadSwipeShortcut(SwipeDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
void EffectsHandlerImpl::registerTouchpadSwipeShortcut(SwipeDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(dir, fingerCount, onUp, progressCallback);
|
||||
input()->registerTouchpadSwipeShortcut(dir, fingerCount, onUp, progressCallback);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::registerTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action)
|
||||
void EffectsHandlerImpl::registerTouchpadPinchShortcut(PinchDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
input()->registerTouchpadSwipeShortcut(direction, fingerCount, action);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::registerRealtimeTouchpadPinchShortcut(PinchDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
input()->registerRealtimeTouchpadPinchShortcut(dir, fingerCount, onUp, progressCallback);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::registerTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *action)
|
||||
{
|
||||
input()->registerTouchpadPinchShortcut(direction, fingerCount, action);
|
||||
input()->registerTouchpadPinchShortcut(dir, fingerCount, onUp, progressCallback);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::registerTouchscreenSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
|
|
|
@ -102,10 +102,8 @@ public:
|
|||
bool isMouseInterception() const;
|
||||
void registerPointerShortcut(Qt::KeyboardModifiers modifiers, Qt::MouseButton pointerButtons, QAction *action) override;
|
||||
void registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action) override;
|
||||
void registerRealtimeTouchpadSwipeShortcut(SwipeDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback) override;
|
||||
void registerTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action) override;
|
||||
void registerRealtimeTouchpadPinchShortcut(PinchDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback) override;
|
||||
void registerTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *action) override;
|
||||
void registerTouchpadSwipeShortcut(SwipeDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback) override;
|
||||
void registerTouchpadPinchShortcut(PinchDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback) override;
|
||||
void registerTouchscreenSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> progressCallback) override;
|
||||
void *getProxy(QString name) override;
|
||||
void startMousePolling() override;
|
||||
|
|
|
@ -60,7 +60,7 @@ DesktopGridEffect::DesktopGridEffect()
|
|||
}
|
||||
});
|
||||
|
||||
effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Up, 4, m_realtimeToggleAction, [this](qreal progress) {
|
||||
effects->registerTouchpadSwipeShortcut(SwipeDirection::Up, 4, m_realtimeToggleAction, [this](qreal progress) {
|
||||
if (!effects->hasActiveFullScreenEffect() || effects->activeFullScreenEffect() == this) {
|
||||
switch (m_status) {
|
||||
case Status::Inactive:
|
||||
|
|
|
@ -65,7 +65,7 @@ OverviewEffect::OverviewEffect()
|
|||
}
|
||||
};
|
||||
|
||||
effects->registerRealtimeTouchpadPinchShortcut(PinchDirection::Contracting, 4, m_realtimeToggleAction, progressCallback);
|
||||
effects->registerTouchpadPinchShortcut(PinchDirection::Contracting, 4, m_realtimeToggleAction, progressCallback);
|
||||
effects->registerTouchscreenSwipeShortcut(SwipeDirection::Up, 3, m_realtimeToggleAction, progressCallback);
|
||||
|
||||
connect(effects, &EffectsHandler::screenAboutToLock, this, &OverviewEffect::realDeactivate);
|
||||
|
|
|
@ -125,7 +125,7 @@ WindowViewEffect::WindowViewEffect()
|
|||
}
|
||||
}
|
||||
};
|
||||
effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Down, 4, m_realtimeToggleAction, gestureCallback);
|
||||
effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, 4, m_realtimeToggleAction, gestureCallback);
|
||||
effects->registerTouchscreenSwipeShortcut(SwipeDirection::Down, 3, m_realtimeToggleAction, gestureCallback);
|
||||
|
||||
reconfigure(ReconfigureAll);
|
||||
|
|
|
@ -39,39 +39,27 @@ GlobalShortcut::GlobalShortcut(Shortcut &&sc, QAction *action)
|
|||
static const QMap<PinchDirection, PinchGesture::Direction> pinchDirs = {
|
||||
{PinchDirection::Expanding, PinchGesture::Direction::Expanding},
|
||||
{PinchDirection::Contracting, PinchGesture::Direction::Contracting}};
|
||||
if (auto swipeGesture = std::get_if<SwipeShortcut>(&sc)) {
|
||||
m_swipeGesture.reset(new SwipeGesture());
|
||||
if (auto swipeGesture = std::get_if<RealtimeFeedbackSwipeShortcut>(&sc)) {
|
||||
m_swipeGesture = std::make_unique<SwipeGesture>();
|
||||
m_swipeGesture->setDirection(swipeDirs[swipeGesture->direction]);
|
||||
m_swipeGesture->setMinimumDelta(QPointF(200, 200));
|
||||
m_swipeGesture->setMaximumFingerCount(swipeGesture->fingerCount);
|
||||
m_swipeGesture->setMinimumFingerCount(swipeGesture->fingerCount);
|
||||
QObject::connect(m_swipeGesture.get(), &SwipeGesture::triggered, m_action, &QAction::trigger, Qt::QueuedConnection);
|
||||
} else if (auto rtSwipeGesture = std::get_if<RealtimeFeedbackSwipeShortcut>(&sc)) {
|
||||
m_swipeGesture.reset(new SwipeGesture());
|
||||
m_swipeGesture->setDirection(swipeDirs[rtSwipeGesture->direction]);
|
||||
m_swipeGesture->setMinimumDelta(QPointF(200, 200));
|
||||
m_swipeGesture->setMaximumFingerCount(rtSwipeGesture->fingerCount);
|
||||
m_swipeGesture->setMinimumFingerCount(rtSwipeGesture->fingerCount);
|
||||
QObject::connect(m_swipeGesture.get(), &SwipeGesture::triggered, m_action, &QAction::trigger, Qt::QueuedConnection);
|
||||
QObject::connect(m_swipeGesture.get(), &SwipeGesture::cancelled, m_action, &QAction::trigger, Qt::QueuedConnection);
|
||||
QObject::connect(m_swipeGesture.get(), &SwipeGesture::progress, [cb = rtSwipeGesture->progressCallback](qreal v) {
|
||||
cb(v);
|
||||
});
|
||||
} else if (auto pinchGesture = std::get_if<PinchShortcut>(&sc)) {
|
||||
m_pinchGesture.reset(new PinchGesture());
|
||||
if (swipeGesture->progressCallback) {
|
||||
QObject::connect(m_swipeGesture.get(), &SwipeGesture::progress, swipeGesture->progressCallback);
|
||||
}
|
||||
} else if (auto pinchGesture = std::get_if<RealtimeFeedbackPinchShortcut>(&sc)) {
|
||||
m_pinchGesture = std::make_unique<PinchGesture>();
|
||||
m_pinchGesture->setDirection(pinchDirs[pinchGesture->direction]);
|
||||
m_pinchGesture->setMaximumFingerCount(pinchGesture->fingerCount);
|
||||
m_pinchGesture->setMinimumFingerCount(pinchGesture->fingerCount);
|
||||
QObject::connect(m_pinchGesture.get(), &PinchGesture::triggered, m_action, &QAction::trigger, Qt::QueuedConnection);
|
||||
} else if (auto rtPinchGesture = std::get_if<RealtimeFeedbackPinchShortcut>(&sc)) {
|
||||
m_pinchGesture.reset(new PinchGesture());
|
||||
m_pinchGesture->setDirection(pinchDirs[rtPinchGesture->direction]);
|
||||
m_pinchGesture->setMaximumFingerCount(rtPinchGesture->fingerCount);
|
||||
m_pinchGesture->setMinimumFingerCount(rtPinchGesture->fingerCount);
|
||||
QObject::connect(m_pinchGesture.get(), &PinchGesture::triggered, m_action, &QAction::trigger, Qt::QueuedConnection);
|
||||
QObject::connect(m_pinchGesture.get(), &PinchGesture::cancelled, m_action, &QAction::trigger, Qt::QueuedConnection);
|
||||
QObject::connect(m_pinchGesture.get(), &PinchGesture::progress, [cb = rtPinchGesture->scaleCallback](qreal v) {
|
||||
cb(v);
|
||||
});
|
||||
if (pinchGesture->scaleCallback) {
|
||||
QObject::connect(m_pinchGesture.get(), &PinchGesture::progress, pinchGesture->scaleCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,9 +138,9 @@ bool GlobalShortcutsManager::addIfNotExists(GlobalShortcut sc, DeviceType device
|
|||
}
|
||||
|
||||
const auto &recognizer = device == DeviceType::Touchpad ? m_touchpadGestureRecognizer : m_touchscreenGestureRecognizer;
|
||||
if (std::holds_alternative<SwipeShortcut>(sc.shortcut()) || std::holds_alternative<RealtimeFeedbackSwipeShortcut>(sc.shortcut())) {
|
||||
if (std::holds_alternative<RealtimeFeedbackSwipeShortcut>(sc.shortcut())) {
|
||||
recognizer->registerSwipeGesture(sc.swipeGesture());
|
||||
} else if (std::holds_alternative<PinchShortcut>(sc.shortcut()) || std::holds_alternative<RealtimeFeedbackPinchShortcut>(sc.shortcut())) {
|
||||
} else if (std::holds_alternative<RealtimeFeedbackPinchShortcut>(sc.shortcut())) {
|
||||
recognizer->registerPinchGesture(sc.pinchGesture());
|
||||
}
|
||||
connect(sc.action(), &QAction::destroyed, this, &GlobalShortcutsManager::objectDeleted);
|
||||
|
@ -170,32 +158,22 @@ void GlobalShortcutsManager::registerAxisShortcut(QAction *action, Qt::KeyboardM
|
|||
addIfNotExists(GlobalShortcut(PointerAxisShortcut{modifiers, axis}, action));
|
||||
}
|
||||
|
||||
void GlobalShortcutsManager::registerTouchpadSwipe(QAction *action, SwipeDirection direction, uint fingerCount)
|
||||
{
|
||||
addIfNotExists(GlobalShortcut(SwipeShortcut{DeviceType::Touchpad, direction, fingerCount}, action), DeviceType::Touchpad);
|
||||
}
|
||||
|
||||
void GlobalShortcutsManager::registerRealtimeTouchpadSwipe(QAction *action, std::function<void(qreal)> progressCallback, SwipeDirection direction, uint fingerCount)
|
||||
void GlobalShortcutsManager::registerTouchpadSwipe(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
addIfNotExists(GlobalShortcut(RealtimeFeedbackSwipeShortcut{DeviceType::Touchpad, direction, progressCallback, fingerCount}, action), DeviceType::Touchpad);
|
||||
}
|
||||
|
||||
void GlobalShortcutsManager::registerTouchpadPinch(QAction *action, PinchDirection direction, uint fingerCount)
|
||||
void GlobalShortcutsManager::registerTouchpadPinch(PinchDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
addIfNotExists(GlobalShortcut(PinchShortcut{direction, fingerCount}, action), DeviceType::Touchpad);
|
||||
addIfNotExists(GlobalShortcut(RealtimeFeedbackPinchShortcut{direction, progressCallback, fingerCount}, action), DeviceType::Touchpad);
|
||||
}
|
||||
|
||||
void GlobalShortcutsManager::registerRealtimeTouchpadPinch(QAction *onUp, std::function<void(qreal)> progressCallback, PinchDirection direction, uint fingerCount)
|
||||
{
|
||||
addIfNotExists(GlobalShortcut(RealtimeFeedbackPinchShortcut{direction, progressCallback, fingerCount}, onUp), DeviceType::Touchpad);
|
||||
}
|
||||
|
||||
void GlobalShortcutsManager::registerTouchscreenSwipe(QAction *action, std::function<void(qreal)> progressCallback, SwipeDirection direction, uint fingerCount)
|
||||
void GlobalShortcutsManager::registerTouchscreenSwipe(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
addIfNotExists(GlobalShortcut(RealtimeFeedbackSwipeShortcut{DeviceType::Touchscreen, direction, progressCallback, fingerCount}, action), DeviceType::Touchscreen);
|
||||
}
|
||||
|
||||
void GlobalShortcutsManager::forceRegisterTouchscreenSwipe(QAction *action, std::function<void(qreal)> progressCallback, SwipeDirection direction, uint fingerCount)
|
||||
void GlobalShortcutsManager::forceRegisterTouchscreenSwipe(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
GlobalShortcut shortcut{RealtimeFeedbackSwipeShortcut{DeviceType::Touchscreen, direction, progressCallback, fingerCount}, action};
|
||||
const auto it = std::find_if(m_shortcuts.begin(), m_shortcuts.end(), [&shortcut](const auto &s) {
|
||||
|
|
|
@ -64,16 +64,10 @@ public:
|
|||
*/
|
||||
void registerAxisShortcut(QAction *action, Qt::KeyboardModifiers modifiers, PointerAxisDirection axis);
|
||||
|
||||
void registerTouchpadSwipe(QAction *action, SwipeDirection direction, uint fingerCount = 4);
|
||||
|
||||
void registerRealtimeTouchpadSwipe(QAction *onUp, std::function<void(qreal)> progressCallback, SwipeDirection direction, uint fingerCount = 4);
|
||||
|
||||
void registerTouchpadPinch(QAction *action, PinchDirection direction, uint fingerCount = 4);
|
||||
|
||||
void registerRealtimeTouchpadPinch(QAction *onUp, std::function<void(qreal)> progressCallback, PinchDirection direction, uint fingerCount = 4);
|
||||
|
||||
void registerTouchscreenSwipe(QAction *action, std::function<void(qreal)> progressCallback, SwipeDirection direction, uint fingerCount);
|
||||
void forceRegisterTouchscreenSwipe(QAction *action, std::function<void(qreal)> progressCallback, SwipeDirection direction, uint fingerCount);
|
||||
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 = {});
|
||||
|
||||
/**
|
||||
* @brief Processes a key event to decide whether a shortcut needs to be triggered.
|
||||
|
@ -155,16 +149,6 @@ struct PointerAxisShortcut
|
|||
return axisModifiers == rhs.axisModifiers && axisDirection == rhs.axisDirection;
|
||||
}
|
||||
};
|
||||
struct SwipeShortcut
|
||||
{
|
||||
DeviceType device;
|
||||
SwipeDirection direction;
|
||||
uint fingerCount;
|
||||
bool operator==(const SwipeShortcut &rhs) const
|
||||
{
|
||||
return direction == rhs.direction && fingerCount == rhs.fingerCount && device == rhs.device;
|
||||
}
|
||||
};
|
||||
struct RealtimeFeedbackSwipeShortcut
|
||||
{
|
||||
DeviceType device;
|
||||
|
@ -178,17 +162,6 @@ struct RealtimeFeedbackSwipeShortcut
|
|||
return direction == rhs.direction && fingerCount == rhs.fingerCount && device == rhs.device;
|
||||
}
|
||||
};
|
||||
|
||||
struct PinchShortcut
|
||||
{
|
||||
PinchDirection direction;
|
||||
uint fingerCount;
|
||||
bool operator==(const PinchShortcut &rhs) const
|
||||
{
|
||||
return direction == rhs.direction && fingerCount == rhs.fingerCount;
|
||||
}
|
||||
};
|
||||
|
||||
struct RealtimeFeedbackPinchShortcut
|
||||
{
|
||||
PinchDirection direction;
|
||||
|
@ -202,7 +175,7 @@ struct RealtimeFeedbackPinchShortcut
|
|||
}
|
||||
};
|
||||
|
||||
using Shortcut = std::variant<KeyboardShortcut, PointerButtonShortcut, PointerAxisShortcut, SwipeShortcut, RealtimeFeedbackSwipeShortcut, PinchShortcut, RealtimeFeedbackPinchShortcut>;
|
||||
using Shortcut = std::variant<KeyboardShortcut, PointerButtonShortcut, PointerAxisShortcut, RealtimeFeedbackSwipeShortcut, RealtimeFeedbackPinchShortcut>;
|
||||
|
||||
class GlobalShortcut
|
||||
{
|
||||
|
|
|
@ -3230,24 +3230,14 @@ void InputRedirection::registerAxisShortcut(Qt::KeyboardModifiers modifiers, Poi
|
|||
m_shortcuts->registerAxisShortcut(action, modifiers, axis);
|
||||
}
|
||||
|
||||
void InputRedirection::registerRealtimeTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> cb)
|
||||
void InputRedirection::registerTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> cb)
|
||||
{
|
||||
m_shortcuts->registerRealtimeTouchpadSwipe(action, cb, direction, fingerCount);
|
||||
m_shortcuts->registerTouchpadSwipe(direction, fingerCount, action, cb);
|
||||
}
|
||||
|
||||
void InputRedirection::registerTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action)
|
||||
void InputRedirection::registerTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
m_shortcuts->registerTouchpadSwipe(action, direction, fingerCount);
|
||||
}
|
||||
|
||||
void InputRedirection::registerTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *action)
|
||||
{
|
||||
m_shortcuts->registerTouchpadPinch(action, direction, fingerCount);
|
||||
}
|
||||
|
||||
void InputRedirection::registerRealtimeTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
m_shortcuts->registerRealtimeTouchpadPinch(onUp, progressCallback, direction, fingerCount);
|
||||
m_shortcuts->registerTouchpadPinch(direction, fingerCount, onUp, progressCallback);
|
||||
}
|
||||
|
||||
void InputRedirection::registerGlobalAccel(KGlobalAccelInterface *interface)
|
||||
|
@ -3257,12 +3247,12 @@ void InputRedirection::registerGlobalAccel(KGlobalAccelInterface *interface)
|
|||
|
||||
void InputRedirection::registerTouchscreenSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
m_shortcuts->registerTouchscreenSwipe(action, progressCallback, direction, fingerCount);
|
||||
m_shortcuts->registerTouchscreenSwipe(direction, fingerCount, action, progressCallback);
|
||||
}
|
||||
|
||||
void InputRedirection::forceRegisterTouchscreenSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> progressCallback)
|
||||
{
|
||||
m_shortcuts->forceRegisterTouchscreenSwipe(action, progressCallback, direction, fingerCount);
|
||||
m_shortcuts->forceRegisterTouchscreenSwipe(direction, fingerCount, action, progressCallback);
|
||||
}
|
||||
|
||||
void InputRedirection::warpPointer(const QPointF &pos)
|
||||
|
|
10
src/input.h
10
src/input.h
|
@ -127,12 +127,10 @@ public:
|
|||
|
||||
void registerPointerShortcut(Qt::KeyboardModifiers modifiers, Qt::MouseButton pointerButtons, QAction *action);
|
||||
void registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action);
|
||||
void registerTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action);
|
||||
void registerRealtimeTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback);
|
||||
void registerTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *action);
|
||||
void registerRealtimeTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback);
|
||||
void registerTouchscreenSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> progressCallback);
|
||||
void forceRegisterTouchscreenSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action, std::function<void(qreal)> progressCallback);
|
||||
void registerTouchpadSwipeShortcut(SwipeDirection direction, uint32_t fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback = {});
|
||||
void registerTouchpadPinchShortcut(PinchDirection direction, uint32_t fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback = {});
|
||||
void registerTouchscreenSwipeShortcut(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback = {});
|
||||
void forceRegisterTouchscreenSwipeShortcut(SwipeDirection direction, uint32_t fingerCount, QAction *action, std::function<void(qreal)> progressCallback = {});
|
||||
void registerGlobalAccel(KGlobalAccelInterface *interface);
|
||||
|
||||
bool supportsPointerWarping() const;
|
||||
|
|
|
@ -912,13 +912,9 @@ public:
|
|||
* @param action The action which gets triggered when the gesture triggers
|
||||
* @since 5.10
|
||||
*/
|
||||
virtual void registerTouchpadSwipeShortcut(SwipeDirection direction, uint fingerCount, QAction *action) = 0;
|
||||
virtual void registerTouchpadSwipeShortcut(SwipeDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback = {}) = 0;
|
||||
|
||||
virtual void registerRealtimeTouchpadSwipeShortcut(SwipeDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback) = 0;
|
||||
|
||||
virtual void registerRealtimeTouchpadPinchShortcut(PinchDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback) = 0;
|
||||
|
||||
virtual void registerTouchpadPinchShortcut(PinchDirection direction, uint fingerCount, QAction *action) = 0;
|
||||
virtual void registerTouchpadPinchShortcut(PinchDirection dir, uint fingerCount, QAction *onUp, std::function<void(qreal)> progressCallback = {}) = 0;
|
||||
|
||||
/**
|
||||
* @brief Registers a global touchscreen swipe gesture shortcut with the provided @p action.
|
||||
|
|
|
@ -827,17 +827,17 @@ void VirtualDesktopManager::initShortcuts()
|
|||
Q_EMIT currentChanging(current(), m_currentDesktopOffset);
|
||||
}
|
||||
};
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Left, 3, m_swipeGestureReleasedX.get(), left);
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Right, 3, m_swipeGestureReleasedX.get(), right);
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Left, 4, m_swipeGestureReleasedX.get(), left);
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Right, 4, m_swipeGestureReleasedX.get(), right);
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Down, 3, m_swipeGestureReleasedY.get(), [this](qreal cb) {
|
||||
input()->registerTouchpadSwipeShortcut(SwipeDirection::Left, 3, m_swipeGestureReleasedX.get(), left);
|
||||
input()->registerTouchpadSwipeShortcut(SwipeDirection::Right, 3, m_swipeGestureReleasedX.get(), right);
|
||||
input()->registerTouchpadSwipeShortcut(SwipeDirection::Left, 4, m_swipeGestureReleasedX.get(), left);
|
||||
input()->registerTouchpadSwipeShortcut(SwipeDirection::Right, 4, m_swipeGestureReleasedX.get(), right);
|
||||
input()->registerTouchpadSwipeShortcut(SwipeDirection::Down, 3, m_swipeGestureReleasedY.get(), [this](qreal cb) {
|
||||
if (grid().height() > 1) {
|
||||
m_currentDesktopOffset.setY(-cb);
|
||||
Q_EMIT currentChanging(current(), m_currentDesktopOffset);
|
||||
}
|
||||
});
|
||||
input()->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Up, 3, m_swipeGestureReleasedY.get(), [this](qreal cb) {
|
||||
input()->registerTouchpadSwipeShortcut(SwipeDirection::Up, 3, m_swipeGestureReleasedY.get(), [this](qreal cb) {
|
||||
if (grid().height() > 1) {
|
||||
m_currentDesktopOffset.setY(cb);
|
||||
Q_EMIT currentChanging(current(), m_currentDesktopOffset);
|
||||
|
|
Loading…
Reference in a new issue