AccessibilityService.OnMotionEvent(MotionEvent) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
允许辅助功能服务观察泛型 MotionEvent
的回调。
[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
参数
- 属性
注解
允许辅助功能服务观察泛型 MotionEvent
的回调。
更喜欢 TouchInteractionController
观察和控制触摸屏事件,包括触摸手势。 如果此服务或任何已启用的服务正在使用 AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE
,则 #onMotionEvent
不会收到触摸屏事件。
<strong Note:</strong>> The service must first request to listen to events using AccessibilityServiceInfo#setMotionEventSources
. MotionEvent
来自源 AccessibilityServiceInfo#getMotionEventSources()
的 s 不会发送到系统的其余部分。 若要停止侦听给定源的事件,请删除该源的调用 AccessibilityServiceInfo#setMotionEventSources
。
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。