ITADN

Expose MotionEvent history

#207Openrnikander 创建于 2025-09-24
R
rnikandercommented
Could we maybe put this behind a feature, or ? Or could we just make that `ndk_event` field publicly accessible? I think I need this for a drawing app. I say "think" since I haven't really experimented with the events yet, but I use the equivalent "coalesced touches" on iOS. Code [link](https://github.com/rust-mobile/android-activity/blob/1652ebb229a740f45b72d31ca3bc310173fc8977/android-activity/src/native_activity/input.rs#L123) ```rust /* XXX: Not currently supported with GameActivity so we don't currently expose for NativeActivity either, for consistency. /// Returns the size of the history contained in this event. /// /// See [the NDK /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_gethistorysize) #[inline] pub fn history_size(&self) -> usize { self.ndk_event.history_size() } /// An iterator over the historical events contained in this event. #[inline] pub fn history(&self) -> HistoricalMotionEventsIter<'_> { self.ndk_event.history() } */ ```
1 条评论