语言

View.PointerCaptureModeRelative 字段

定义

注意

This constant will be removed in the future version. Use Android.Views.PointerCaptureMode enum directly instead of this field.

指针捕获模式,触摸板手势可识别并报告为鼠标移动。

[Android.Runtime.Register("POINTER_CAPTURE_MODE_RELATIVE", ApiSince=37)]
[System.Obsolete("This constant will be removed in the future version. Use Android.Views.PointerCaptureMode enum directly instead of this field.", true)]
public const Android.Views.PointerCaptureMode PointerCaptureModeRelative = 2;
[<Android.Runtime.Register("POINTER_CAPTURE_MODE_RELATIVE", ApiSince=37)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Views.PointerCaptureMode enum directly instead of this field.", true)>]
val mutable PointerCaptureModeRelative : Android.Views.PointerCaptureMode

字段值

Value = 2
属性

注解

指针捕获模式,触摸板手势可识别并报告为鼠标移动。

在此捕获模式下,将识别并报告在捕获的触摸板上做出的以下手势:指针移动手势(如在垫上移动单指)将报告为鼠标移动,MotionEvent.ACTION_MOVE操作及其相对位置更改可通过 MotionEvent.getX 和 MotionEvent.getY;滚动手势(如双指轻扫)将报告为鼠标上的滚轮移动,MotionEvent.ACTION_SCROLL操作和滚动量可通过MotionEvent.AXIS_VSCROLL和MotionEvent.AXIS_HSCROLL轴使用。

运动值与手势手指的物理运动成正比,并且可以使用 InputDevice.MotionRange.getResolution 为相关轴报告的分辨率找到 mm 中的物理运动。

这些事件将通过InputDevice.SOURCE_MOUSE_RELATIVE报告。

无论捕获模式如何,鼠标中的事件始终以相同的方式报告。

Android 参考。android.view.View.POINTER_CAPTURE_MODE_RELATIVE

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于