Skip to content

Most visited

Recently visited




public class InputDriver
extends Object


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.


Nested classes

class InputDriver.Builder

Builder class for InputDriver objects. 

Public methods

boolean emit(int x, int y, boolean press)

Emit a single touch event.

boolean emit(KeyEvent[] events)

Emit a list of KeyEvents.

Inherited methods

From class java.lang.Object

Public methods


boolean emit (int x, 
                int y, 
                boolean press)

Emit a single touch event.

x int: An int denoting the x-axis location of the touch.
y int: An int denoting the y-axis location of the touch.
press boolean: A boolean denoting whether device is being pressed or not.
boolean true on success.


boolean emit (KeyEvent[] events)

Emit a list of KeyEvents. The driver will treat the entire list of events as synchronous, i.e. happened at the same time. If any of the events are not supported by this driver, none of them will be emitted.

events KeyEvent: An array of KeyEvents.
boolean true on success, i.e. the entire array of KeyEvents was emitted.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)