# InputDevice.MotionRange

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/view/InputDevice.MotionRange#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/InputDevice.MotionRange#inhmethods)  

# InputDevice.MotionRange

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange "View this page in Kotlin")\|Java

`
public
static
final

class
InputDevice.MotionRange
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.InputDevice.MotionRange |

<br />

*** ** * ** ***

Provides information about the range of values for a particular[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent)axis.  
**See also:**

- [InputDevice.getMotionRange(int)](https://developer.android.com/reference/android/view/InputDevice#getMotionRange(int))

## Summary

|                                                                                               ### Public methods                                                                                               ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`     | ` `[getAxis](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getAxis())`() ` Gets the axis id.                                                                        |
| ` float`   | ` `[getFlat](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getFlat())`() ` Gets the extent of the center flat position with respect to this axis.                   |
| ` float`   | ` `[getFuzz](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getFuzz())`() ` Gets the error tolerance for input device measurements with respect to this axis.        |
| ` float`   | ` `[getMax](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getMax())`() ` Gets the inclusive maximum value for the axis.                                             |
| ` float`   | ` `[getMin](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getMin())`() ` Gets the inclusive minimum value for the axis.                                             |
| ` float`   | ` `[getRange](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getRange())`() ` Gets the range of the axis (difference between maximum and minimum).                   |
| ` float`   | ` `[getResolution](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getResolution())`() ` Gets the resolution for input device measurements with respect to this axis. |
| ` int`     | ` `[getSource](https://developer.android.com/reference/android/view/InputDevice.MotionRange#getSource())`() ` Gets the source for which the axis is defined.                                       |
| ` boolean` | ` `[isFromSource](https://developer.android.com/reference/android/view/InputDevice.MotionRange#isFromSource(int))`(int source) ` Determines whether the event is from the given source.            |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public methods

### getAxis

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getAxis ()
```

Gets the axis id.

<br />

|          Returns           ||
|-------|---------------------|
| `int` | The axis id. <br /> |

### getFlat

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getFlat ()
```

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.

<br />

<br />

|                         Returns                         ||
|---------|------------------------------------------------|
| `float` | The extent of the center flat position. <br /> |

### getFuzz

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getFuzz ()
```

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.

<br />

<br />

|               Returns                ||
|---------|-----------------------------|
| `float` | The error tolerance. <br /> |

### getMax

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getMax ()
```

Gets the inclusive maximum value for the axis.

<br />

|                   Returns                    ||
|---------|-------------------------------------|
| `float` | The inclusive maximum value. <br /> |

### getMin

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getMin ()
```

Gets the inclusive minimum value for the axis.

<br />

|                   Returns                    ||
|---------|-------------------------------------|
| `float` | The inclusive minimum value. <br /> |

### getRange

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getRange ()
```

Gets the range of the axis (difference between maximum and minimum).

<br />

|               Returns                ||
|---------|-----------------------------|
| `float` | The range of values. <br /> |

### getResolution

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getResolution ()
```

Gets the resolution for input device measurements with respect to this axis.

<br />

|                                             Returns                                              ||
|---------|-----------------------------------------------------------------------------------------|
| `float` | The resolution in units per millimeter, or units per radian for rotational axes. <br /> |

### getSource

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getSource ()
```

Gets the source for which the axis is defined.

<br />

|          Returns          ||
|-------|--------------------|
| `int` | The source. <br /> |

### isFromSource

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isFromSource (int source)
```

Determines whether the event is from the given source.

<br />

|                                                                                                                                                                                                Parameters                                                                                                                                                                                                ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source` | `int`: The input source to check against. This can be a specific device type, such as[InputDevice.SOURCE_TOUCH_NAVIGATION](https://developer.android.com/reference/android/view/InputDevice#SOURCE_TOUCH_NAVIGATION), or a more generic device class, such as[InputDevice.SOURCE_CLASS_POINTER](https://developer.android.com/reference/android/view/InputDevice#SOURCE_CLASS_POINTER). <br /> |

|                            Returns                            ||
|-----------|----------------------------------------------------|
| `boolean` | Whether the event is from the given source. <br /> |