Skip to content

Most visited

Recently visited

navigation

InputDriver.Builder

InputDriver.Builder

public static class InputDriver.Builder
extends Object

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


Builder class for InputDriver objects.

Summary

Public constructors

InputDriver.Builder(int source)

Constructs a new builder.

Public methods

InputDriver build()

Build an InputDriver.

InputDriver.Builder setAbsMax(int axis, int max)

Set the maximum value for an absolute axis.

InputDriver.Builder setAbsMin(int axis, int min)

Set the minimum values for an absolute axis.

InputDriver.Builder setBusType(int busType)

Set the bus type of the input device.

InputDriver.Builder setKeys(int[] keys)

Set the keys supported by this driver.

InputDriver.Builder setName(String name)

Set the name of the input driver.

InputDriver.Builder setProductId(int productId)

Set the product code.

InputDriver.Builder setVendorId(int vendorId)

Set the vendor code for the driver.

InputDriver.Builder setVersion(int version)

Set driver version.

Inherited methods

From class java.lang.Object

Public constructors

InputDriver.Builder

InputDriver.Builder (int source)

Constructs a new builder.

Parameters
source int: An int representing the device this driver supports. Supported sources are SOURCE_CLASS_BUTTON, SOURCE_TOUCHPAD, and SOURCE_TOUCHSCREEN.
Returns
A new InputDriver.Builder instance.

Public methods

build

InputDriver build ()

Build an InputDriver. Builds an InputDriver with the provided characteristics.

Returns
InputDriver A new InputDriver object.

setAbsMax

InputDriver.Builder setAbsMax (int axis, 
                int max)

Set the maximum value for an absolute axis. This method may be called multiple times.

Parameters
axis int: One of the axis constants from MotionEvent .
max int: An inclusive maximum value for the axis.
Returns
InputDriver.Builder The same builder instance.

setAbsMin

InputDriver.Builder setAbsMin (int axis, 
                int min)

Set the minimum values for an absolute axis. This method may be called multiple times.

Parameters
axis int: One of the axis constants from MotionEvent .
min int: An inclusive minimum value for the axis.
Returns
InputDriver.Builder The same builder instance.

setBusType

InputDriver.Builder setBusType (int busType)

Set the bus type of the input device.

Parameters
busType int: An int representing the bus the input device is connected on. Defaults to 0.
Returns
InputDriver.Builder The same builder instance.

setKeys

InputDriver.Builder setKeys (int[] keys)

Set the keys supported by this driver. This call is only valid if this driver is of source SOURCE_CLASS_BUTTON.

Parameters
keys int: An aray of ints representing the keys this input driver supports. The keys must be values from KeyEvent.
Returns
InputDriver.Builder The same builder instance.

setName

InputDriver.Builder setName (String name)

Set the name of the input driver.

Parameters
name String: A String representing the name of the driver. If a name is not provided, one will be auto-generated.
Returns
InputDriver.Builder The same builder instance.

setProductId

InputDriver.Builder setProductId (int productId)

Set the product code.

Parameters
productId int: An int representing the input device. Defaults to 0.
Returns
InputDriver.Builder The same builder instance.

setVendorId

InputDriver.Builder setVendorId (int vendorId)

Set the vendor code for the driver.

Parameters
vendorId int: An int representing the vendor code. Defaults to 0.
Returns
InputDriver.Builder The same builder instance.

setVersion

InputDriver.Builder setVersion (int version)

Set driver version.

Parameters
version int: An int representing the version of the input driver. Defaults to 0.
Returns
InputDriver.Builder The same builder instance.
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

Hooray!

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.
(Sep 2017 survey)