MotionRange
class MotionRange
kotlin.Any | |
↳ | android.view.InputDevice.MotionRange |
Provides information about the range of values for a particular MotionEvent
axis.
Summary
Public methods | |
---|---|
Int |
getAxis() Gets the axis id. |
Float |
getFlat() Gets the extent of the center flat position with respect to this axis. |
Float |
getFuzz() Gets the error tolerance for input device measurements with respect to this axis. |
Float |
getMax() Gets the inclusive maximum value for the axis. |
Float |
getMin() Gets the inclusive minimum value for the axis. |
Float |
getRange() Gets the range of the axis (difference between maximum and minimum). |
Float |
Gets the resolution for input device measurements with respect to this axis. |
Int |
Gets the source for which the axis is defined. |
Boolean |
isFromSource(source: Int) Determines whether the event is from the given source. |
Public methods
getFlat
fun getFlat(): Float
Gets the extent of the center flat position with respect to this axis.
For example, a flat value of 8 means that the center position is between -8 and +8. This value is mainly useful for calibrating self-centering devices.
Return | |
---|---|
Float |
The extent of the center flat position. |
getFuzz
fun getFuzz(): Float
Gets the error tolerance for input device measurements with respect to this axis.
For example, a value of 2 indicates that the measured value may be up to +/- 2 units away from the actual value due to noise and device sensitivity limitations.
Return | |
---|---|
Float |
The error tolerance. |
getMax
fun getMax(): Float
Gets the inclusive maximum value for the axis.
Return | |
---|---|
Float |
The inclusive maximum value. |
getMin
fun getMin(): Float
Gets the inclusive minimum value for the axis.
Return | |
---|---|
Float |
The inclusive minimum value. |
getRange
fun getRange(): Float
Gets the range of the axis (difference between maximum and minimum).
Return | |
---|---|
Float |
The range of values. |
getResolution
fun getResolution(): Float
Gets the resolution for input device measurements with respect to this axis.
Return | |
---|---|
Float |
The resolution in units per millimeter, or units per radian for rotational axes. |
getSource
fun getSource(): Int
Gets the source for which the axis is defined.
Return | |
---|---|
Int |
The source. |
isFromSource
fun isFromSource(source: Int): Boolean
Determines whether the event is from the given source.
Parameters | |
---|---|
source |
Int: The input source to check against. This can be a specific device type, such as InputDevice#SOURCE_TOUCH_NAVIGATION , or a more generic device class, such as InputDevice#SOURCE_CLASS_POINTER . |
Return | |
---|---|
Boolean |
Whether the event is from the given source. |