AccessibilityService.OnMotionEvent(MotionEvent) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Callback that allows an accessibility service to observe generic MotionEvent
s.
[Android.Runtime.Register("onMotionEvent", "(Landroid/view/MotionEvent;)V", "GetOnMotionEvent_Landroid_view_MotionEvent_Handler", ApiSince=34)]
public virtual void OnMotionEvent (Android.Views.MotionEvent e);
[<Android.Runtime.Register("onMotionEvent", "(Landroid/view/MotionEvent;)V", "GetOnMotionEvent_Landroid_view_MotionEvent_Handler", ApiSince=34)>]
abstract member OnMotionEvent : Android.Views.MotionEvent -> unit
override this.OnMotionEvent : Android.Views.MotionEvent -> unit
Parameters
- Attributes
Remarks
Callback that allows an accessibility service to observe generic MotionEvent
s.
Prefer TouchInteractionController
to observe and control touchscreen events, including touch gestures. If this or any enabled service is using AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE
then #onMotionEvent
will not receive touchscreen events.
<strong>Note:</strong> The service must first request to listen to events using AccessibilityServiceInfo#setMotionEventSources
. MotionEvent
s from sources in AccessibilityServiceInfo#getMotionEventSources()
are not sent to the rest of the system. To stop listening to events from a given source, call AccessibilityServiceInfo#setMotionEventSources
with that source removed.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.