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 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 methods

build

</div>

InputDriver build ()

Build an InputDriver.

Builds an InputDriver with the provided characteristics.</p>

Returns
InputDriver A new InputDriver object.

</div>

setAbsMax

</div>

InputDriver.Builder setAbsMax (int axis,
                int max)

Set the maximum value for an absolute axis.

This method may be called multiple times.</p>

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.

</div>

setAbsMin

</div>

InputDriver.Builder setAbsMin (int axis,
                int min)

Set the minimum values for an absolute axis.

This method may be called multiple times.</p>

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.

</div>

setBusType

</div>

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.

</div>

setKeys

</div>

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.</p>

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.

</div>

setName

</div>

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.

</div>

setProductId

</div>

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.

</div>

setVendorId

</div>

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.

</div>

setVersion

</div>

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.

</div>

results matching ""

    No results matching ""