Most visited

Recently visited

Added in API level 9

InputDevice.MotionRange

public static final class InputDevice.MotionRange
extends Object

java.lang.Object
    android.view.InputDevice.MotionRange


提供有关特定轴 MotionEvent的值范围的信息。

也可以看看:

摘要(Summary)

公共方法(Public methods)

int getAxis()

获取轴号。

float getFlat()

获取相对于该轴的中心平坦位置的范围。

float getFuzz()

获取相对于此轴的输入设备测量的容差。

float getMax()

获取轴的包含最大值。

float getMin()

获取该轴的包含最小值。

float getRange()

获取轴的范围(最大值和最小值之间的差值)。

float getResolution()

获取相对于该轴的输入设备测量的分辨率。

int getSource()

获取定义轴的源。

boolean isFromSource(int source)

确定事件是否来自给定源。

继承方法(Inherited methods)

From class java.lang.Object

公共方法(Public methods)

getAxis

Added in API level 12
int getAxis ()

获取轴号。

返回(Returns)
int The axis id.

getFlat

Added in API level 9
float getFlat ()

获取相对于该轴的中心平坦位置的范围。

例如,8的平坦值意味着中心位置在-8和+8之间。 该值主要用于校准自对中设备。

返回(Returns)
float The extent of the center flat position.

getFuzz

Added in API level 9
float getFuzz ()

获取相对于此轴的输入设备测量的容差。

例如,值2表示由于噪声和设备灵敏度限制,测量值可能高达实际值的+/- 2个单位。

返回(Returns)
float The error tolerance.

getMax

Added in API level 9
float getMax ()

获取轴的包含最大值。

返回(Returns)
float The inclusive maximum value.

getMin

Added in API level 9
float getMin ()

获取该轴的包含最小值。

返回(Returns)
float The inclusive minimum value.

getRange

Added in API level 9
float getRange ()

获取轴的范围(最大值和最小值之间的差值)。

返回(Returns)
float The range of values.

getResolution

Added in API level 18
float getResolution ()

获取相对于该轴的输入设备测量的分辨率。

返回(Returns)
float The resolution in units per millimeter, or units per radian for rotational axes.

getSource

Added in API level 12
int getSource ()

获取定义轴的源。

返回(Returns)
int The source.

isFromSource

Added in API level 18
boolean isFromSource (int source)

确定事件是否来自给定源。

参数(Parameters)
source int: The input source to check against. This can be a specific device type, such as SOURCE_TOUCH_NAVIGATION, or a more generic device class, such as SOURCE_CLASS_POINTER.
返回(Returns)
boolean Whether the event is from the given source.

Hooray!