Skip to content

Most visited

Recently visited

navigation

InputDriver

InputDriver

public class InputDriver
extends Object

java.lang.Object
   ↳ com.google.android.things.userdriver.InputDriver


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

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

emit

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

Emit a single touch event.

Parameters
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.
Returns
boolean true on success.

emit

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.

Parameters
events KeyEvent: An array of KeyEvents.
Returns
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.

Hooray!

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 one-minute survey?
Help us improve Android tools and documentation.