From 9a01d0519fa56fa75864cb96045c6ee832a39ff4 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Mon, 27 Sep 2010 16:35:11 -0700 Subject: Fix pointer index when splitting secondary pointers. Change-Id: Ib01e810ea5b64501b1303000bbef0f0a1db2114e --- libs/ui/InputDispatcher.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/ui') diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp index 5da1676..b5744b3 100644 --- a/libs/ui/InputDispatcher.cpp +++ b/libs/ui/InputDispatcher.cpp @@ -1916,6 +1916,14 @@ InputDispatcher::splitMotionEvent(const MotionEntry* originalMotionEntry, BitSet // The first/last pointer went down/up. action = maskedAction == AMOTION_EVENT_ACTION_POINTER_DOWN ? AMOTION_EVENT_ACTION_DOWN : AMOTION_EVENT_ACTION_UP; + } else { + // A secondary pointer went down/up. + uint32_t splitPointerIndex = 0; + while (pointerId != splitPointerIds[splitPointerIndex]) { + splitPointerIndex += 1; + } + action = maskedAction | (splitPointerIndex + << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT); } } else { // An unrelated pointer changed. -- cgit v1.1