parent
b619f39555
commit
1e3a06560f
3 changed files with 15 additions and 0 deletions
|
|
@ -89,6 +89,18 @@ std::expected<void, std::string> CTrackpadGestures::addGesture(UP<ITrackpadGestu
|
|||
return {};
|
||||
}
|
||||
|
||||
std::expected<void, std::string> CTrackpadGestures::removeGesture(size_t fingerCount, eTrackpadGestureDirection direction, uint32_t modMask, float deltaScale) {
|
||||
const auto IT = std::ranges::find_if(
|
||||
m_gestures, [&](const auto& g) { return g->fingerCount == fingerCount && g->direction == direction && g->modMask == modMask && g->deltaScale == deltaScale; });
|
||||
|
||||
if (IT == m_gestures.end())
|
||||
return std::unexpected("Can't remove a non-existent gesture");
|
||||
|
||||
std::erase(m_gestures, *IT);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CTrackpadGestures::gestureBegin(const IPointer::SSwipeBeginEvent& e) {
|
||||
if (m_activeGesture) {
|
||||
Debug::log(ERR, "CTrackpadGestures::gestureBegin (swipe) but m_activeGesture is already present");
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class CTrackpadGestures {
|
|||
public:
|
||||
void clearGestures();
|
||||
std::expected<void, std::string> addGesture(UP<ITrackpadGesture>&& gesture, size_t fingerCount, eTrackpadGestureDirection direction, uint32_t modMask, float deltaScale);
|
||||
std::expected<void, std::string> removeGesture(size_t fingerCount, eTrackpadGestureDirection direction, uint32_t modMask, float deltaScale);
|
||||
|
||||
void gestureBegin(const IPointer::SSwipeBeginEvent& e);
|
||||
void gestureUpdate(const IPointer::SSwipeUpdateEvent& e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue