Android: import touchedCount patch

This commit is contained in:
sfan5 2021-03-07 01:50:11 +01:00
parent 10a188e967
commit dfe077134d
2 changed files with 5 additions and 0 deletions

View File

@ -425,6 +425,9 @@ struct SEvent
// Y position of simple touch. // Y position of simple touch.
s32 Y; s32 Y;
// number of current touches
s32 touchedCount;
//! Type of touch event. //! Type of touch event.
ETOUCH_INPUT_EVENT Event; ETOUCH_INPUT_EVENT Event;
}; };

View File

@ -393,6 +393,7 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i); event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
event.TouchInput.X = AMotionEvent_getX(androidEvent, i); event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i); event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
device->postEventFromUser(event); device->postEventFromUser(event);
} }
@ -404,6 +405,7 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex); event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex); event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex); event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
device->postEventFromUser(event); device->postEventFromUser(event);
} }