For Frame Event 04/311804/9
authorjoogab.yun <joogab.yun@samsung.com>
Tue, 28 May 2024 07:12:24 +0000 (16:12 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Tue, 18 Jun 2024 04:16:35 +0000 (04:16 +0000)
When processing multiple multi-touches, they are grouped and processed. Add handledMultiTouch condition for grouping.

Change-Id: I9870485f03c0ef16f7ba7231f47d5bd3e8bc1f84

dali/integration-api/events/touch-event-combiner.cpp
dali/integration-api/events/touch-event-combiner.h

index 4f01dfd..879df14 100644 (file)
@@ -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);
           }
         }
index 95a49fb..8cde275 100644 (file)
@@ -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.