diff --git a/src/rcore.c b/src/rcore.c index 1dece1a09..7cf3651c2 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -5439,6 +5439,9 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) return 0; } + // Register touch points count + CORE.Input.Touch.pointCount = AMotionEvent_getPointerCount(event); + int32_t action = AMotionEvent_getAction(event); unsigned int flags = action & AMOTION_EVENT_ACTION_MASK; @@ -5447,9 +5450,6 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) if (flags == AMOTION_EVENT_ACTION_POINTER_UP || flags == AMOTION_EVENT_ACTION_UP) CORE.Input.Touch.pointCount -= 1; - // Register touch points count - CORE.Input.Touch.pointCount = AMotionEvent_getPointerCount(event); - for (int i = 0; (i < CORE.Input.Touch.pointCount) && (i < MAX_TOUCH_POINTS); i++) { // Register touch points id