From b7112ee7e7306ab2d7457b512748aed699767c8d Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Tue, 28 May 2024 16:12:24 +0900 Subject: [PATCH] For Frame Event When processing multiple multi-touches, they are grouped and processed. Add handledMultiTouch condition for grouping. Change-Id: I9870485f03c0ef16f7ba7231f47d5bd3e8bc1f84 --- .../events/touch-event-combiner.cpp | 22 +++++++++++++++++----- dali/integration-api/events/touch-event-combiner.h | 11 ++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/dali/integration-api/events/touch-event-combiner.cpp b/dali/integration-api/events/touch-event-combiner.cpp index 4f01dfd..879df14 100644 --- a/dali/integration-api/events/touch-event-combiner.cpp +++ b/dali/integration-api/events/touch-event-combiner.cpp @@ -80,7 +80,7 @@ TouchEventCombiner::TouchEventCombiner(uint32_t minMotionTime, Vector2 minMotion TouchEventCombiner::~TouchEventCombiner() = default; -TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(const Point& point, uint32_t time, TouchEvent& touchEvent, HoverEvent& hoverEvent) +TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(const Point& point, uint32_t time, TouchEvent& touchEvent, HoverEvent& hoverEvent, bool isMultiTouchEvent) { TouchEventCombiner::EventDispatchType dispatchEvent(TouchEventCombiner::DISPATCH_NONE); const PointState::Type state = point.GetState(); @@ -99,7 +99,10 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(cons { if(iter->point.GetDeviceId() != deviceId) { - iter->point.SetState(PointState::STATIONARY); + if(!isMultiTouchEvent) + { + iter->point.SetState(PointState::STATIONARY); + } } else { @@ -170,7 +173,10 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(cons } else { - iter->point.SetState(PointState::STATIONARY); + if(!isMultiTouchEvent) + { + iter->point.SetState(PointState::STATIONARY); + } touchEvent.AddPoint(iter->point); } } @@ -242,7 +248,10 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(cons } else { - iter->point.SetState(PointState::STATIONARY); + if(!isMultiTouchEvent) + { + iter->point.SetState(PointState::STATIONARY); + } touchEvent.AddPoint(iter->point); } } @@ -300,7 +309,10 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(cons } else { - iter->point.SetState(PointState::STATIONARY); + if(!isMultiTouchEvent) + { + iter->point.SetState(PointState::STATIONARY); + } hoverEvent.AddPoint(iter->point); } } diff --git a/dali/integration-api/events/touch-event-combiner.h b/dali/integration-api/events/touch-event-combiner.h index 95a49fb..8cde275 100644 --- a/dali/integration-api/events/touch-event-combiner.h +++ b/dali/integration-api/events/touch-event-combiner.h @@ -94,14 +94,15 @@ public: * @note If the thresholds set have not been passed, then false is returned and the TouchEvent and/or HoverEvent should not be sent * to Dali Core. * - * @param[in] point The new Point. - * @param[in] time The time the event occurred. - * @param[out] touchEvent This is populated with the correct Point(s) and time information. - * @param[out] hoverEvent This is populated with the correct Point(s) and time information. + * @param[in] point The new Point. + * @param[in] time The time the event occurred. + * @param[out] touchEvent This is populated with the correct Point(s) and time information. + * @param[out] hoverEvent This is populated with the correct Point(s) and time information. + * @param[in] isMultiTouchEvent The Flag whether multitouch is being. * * @return true if the point is beyond the different thresholds set thus, should be sent to core, false otherwise. */ - EventDispatchType GetNextTouchEvent(const Point& point, uint32_t time, TouchEvent& touchEvent, HoverEvent& hoverEvent); + EventDispatchType GetNextTouchEvent(const Point& point, uint32_t time, TouchEvent& touchEvent, HoverEvent& hoverEvent, bool isMultiTouchEvent = false); /** * Sets the minimum time (in ms) that should occur between motion events. -- 2.7.4