# InputDriver

Summary:[Nested Classes](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver#nestedclasses)\|[Methods](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver#)  

# InputDriver

`
public


class
InputDriver
`  
`

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


``


`

|---|--------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | com.google.android.things.userdriver.input.InputDriver |

<br />

*** ** * ** ***

Driver to interface with user-connected input devices. User defined drivers should instantiate this class and call the appropriate emit method whenever input events are ready.

## Summary

|                                                                                                                               ### Nested classes                                                                                                                               ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [InputDriver.Builder](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver.Builder) Builder class for[InputDriver](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver)objects. |

|                                                                                                                                                                  ### Public methods                                                                                                                                                                  ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[emit](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver#emit(com.google.android.things.userdriver.input.InputDriverEvent))`(`[InputDriverEvent](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriverEvent)` event) ` Emit a single driver event. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver#)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, int))`(long millis, int nanos) ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long millis) ` Causes the current thread to wait until either another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or a specified amount of time has elapsed.                                                                 | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object.                                                                                                                                  | ||

## Public methods

### emit

```
void emit (InputDriverEvent event)
```

Emit a single driver event.

<br />

|                       Parameters                       ||
|---------|-----------------------------------------------|
| `event` | `InputDriverEvent`: The event to emit. <br /> |

|                                                                                                                                Throws                                                                                                                                 ||
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if the given key is not in the list of keys configured for this driver. IllegalStateException if the driver is not yet registered with the UserDriverManager. |

-

  ## Classes

  - [InputDriver](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver)
  - [InputDriver.Builder](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriver.Builder)
  - [InputDriverEvent](https://developer.android.com/reference/com/google/android/things/userdriver/input/InputDriverEvent)