# Input controller API

The input controller API allows you to give commands to your [input controller components](https://docs.viam.com/hardware/common-components/add-an-input-controller/) for configuring callbacks for events, allowing you to configure input devices to control your machines.

The input controller component supports the following methods:

| Method Name | Description |
| --- | --- |
| [`GetControls`](https://docs.viam.com/reference/apis/components/input-controller/#getcontrols) | Get a list of the Controls that your controller provides. |
| [`GetEvents`](https://docs.viam.com/reference/apis/components/input-controller/#getevents) | This method returns the current state of the controller as a map of Event Objects, representing the most recent event that has occurred on each available Control. |
| [`TriggerEvent`](https://docs.viam.com/reference/apis/components/input-controller/#triggerevent) | Directly send an Event Object from external code. |
| [`GetGeometries`](https://docs.viam.com/reference/apis/components/input-controller/#getgeometries) | Get all the geometries associated with the input controller in its current configuration, in the frame of the input controller. |
| [`RegisterControlCallback`](https://docs.viam.com/reference/apis/components/input-controller/#registercontrolcallback) | Defines a callback function to execute whenever one of the EventTypes selected occurs on the given Control. |
| [`Reconfigure`](https://docs.viam.com/reference/apis/components/input-controller/#reconfigure) | Reconfigure this resource. |
| [`DoCommand`](https://docs.viam.com/reference/apis/components/input-controller/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. |
| [`GetResourceName`](https://docs.viam.com/reference/apis/components/input-controller/#getresourcename) | Get the `ResourceName` for this input controller. |
| [`Close`](https://docs.viam.com/reference/apis/components/input-controller/#close) | Safely shut down the resource and prevent further use. |

## API

### GetControls

Get a list of the [Controls](https://docs.viam.com/reference/apis/components/input-controller/#control-field) that your controller provides.

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-1-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-1-1)

**Parameters:**

- `extra` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ( [float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- ( [List[viam.components.input.input.Control]](https://python.viam.dev/autoapi/viam/components/input/input/index.html#viam.components.input.input.Control)): : List of controls provided by the Controller.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.get_controls).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call.

**Returns:**

- [([]Control)](https://pkg.go.dev/go.viam.com/rdk/components/input#Control): List of Controls provided by the controller.
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/components/input#Controller).

### GetEvents

This method returns the current state of the controller as a map of [Event Objects](https://docs.viam.com/reference/apis/components/input-controller/#event-object), representing the most recent event that has occurred on each available [Control](https://docs.viam.com/reference/apis/components/input-controller/#control-field).

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-2-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-2-1)
- [TypeScript](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-2-2)

**Parameters:**

**Returns:**

- ( [Dict[viam.components.input.input.Control, viam.components.input.input.Event]](https://python.viam.dev/autoapi/viam/components/input/input/index.html#viam.components.input.input.Control)): : The most recent event for each input.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.get_events).

**Parameters:**

**Returns:**

- [(map[Control]Event)](https://pkg.go.dev/go.viam.com/rdk/components/input#Event): A map mapping the most recent Event for each Control.
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/components/input#Controller).

**Parameters:**

- `extra` (None) (optional)
- `callOptions` (CallOptions) (optional)

**Returns:**

- (Promise< [Event](https://ts.viam.dev/classes/inputControllerApi.Event.html)[]>)

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/InputControllerClient.html#getevents).

### TriggerEvent

Directly send an [Event Object](https://docs.viam.com/reference/apis/components/input-controller/#event-object) from external code.

#### Support Notice

This method is currently only supported for input controllers of model `webgamepad`.

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-3-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-3-1)
- [TypeScript](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-3-2)

**Parameters:**

- `event` ( [viam.components.input.input.Event](https://python.viam.dev/autoapi/viam/components/input/index.html#viam.components.input.Event)) (required): The event to trigger.
- `extra` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ( [float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- None.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.trigger_event).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `event` [(Event)](https://pkg.go.dev/go.viam.com/rdk/components/input#Event): The `Event` to trigger on the controller.
- `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call.

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/components/input#Triggerable).

**Parameters:**

- `event` ( [PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required)
- `extra` (None) (optional)
- `callOptions` (CallOptions) (optional)

**Returns:**

- (Promise)

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/InputControllerClient.html#triggerevent).

### GetGeometries

Get all the geometries associated with the input controller in its current configuration, in the [frame](https://docs.viam.com/reference/services/frame-system/) of the input controller.
The [motion](https://docs.viam.com/reference/services/motion/) and [navigation](https://docs.viam.com/reference/services/navigation/) services use the relative position of inherent geometries to configured geometries representing obstacles for collision detection and obstacle avoidance while motion planning.

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-4-0)

**Parameters:**

**Returns:**

- ( [List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.get_geometries).

### RegisterControlCallback

Defines a callback function to execute whenever one of the [EventTypes](https://docs.viam.com/reference/apis/components/input-controller/#eventtype-field) selected occurs on the given [Control](https://docs.viam.com/reference/apis/components/input-controller/#control-field).

You can only register one callback function per [Event](https://docs.viam.com/reference/apis/components/input-controller/#event-object) for each [Control](https://docs.viam.com/reference/apis/components/input-controller/#control-field).
A second call to register a callback function for a [EventType](https://docs.viam.com/reference/apis/components/input-controller/#eventtype-field) on a [Control](https://docs.viam.com/reference/apis/components/input-controller/#control-field) replaces any function that was already registered.

You can pass a `nil` function here to “deregister” a callback.

#### Tip

Registering a callback for the `ButtonChange` [EventType](https://docs.viam.com/reference/apis/components/input-controller/#eventtype-field) is merely a convenience for filtering.
Doing so registers the same callback to both `ButtonPress` and `ButtonRelease`, but `ButtonChange` is not reported in an actual [Event Object](https://docs.viam.com/reference/apis/components/input-controller/#event-object).

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-5-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-5-1)

**Parameters:**

- `control` ( [viam.components.input.input.Control](https://python.viam.dev/autoapi/viam/components/input/index.html#viam.components.input.Control)) (required): The control to register the function for.
- `triggers` ( [List[viam.components.input.input.EventType]](https://python.viam.dev/autoapi/viam/components/input/index.html#viam.components.input.EventType)) (required): The events that will trigger the function.
- `function` ( [viam.components.input.input.ControlFunction](https://python.viam.dev/autoapi/viam/components/input/index.html#viam.components.input.ControlFunction)) (optional): The function to run on specific triggers.
- `extra` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.

**Returns:**

- None.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.register_control_callback).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `control` [(Control)](https://pkg.go.dev/go.viam.com/rdk/components/input#Control): The [Control](https://docs.viam.com/reference/apis/components/input-controller/#control-field) to register the function for.
- `triggers` [([]EventType)](https://pkg.go.dev/go.viam.com/rdk/components/input#EventType): The [EventTypes](https://docs.viam.com/reference/apis/components/input-controller/#eventtype-field) that trigger the function.
- `ctrlFunc` [(ControlFunction)](https://pkg.go.dev/go.viam.com/rdk/components/input#ControlFunction): The function to run when the specified triggers are invoked.
- `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call.

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/components/input#Controller).

### Reconfigure

Reconfigure this resource.
Reconfigure must reconfigure the resource atomically and in place.

- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-6-0)

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `deps` [(Dependencies)](https://pkg.go.dev/go.viam.com/rdk/resource#Dependencies): The resource dependencies.
- `conf` [(Config)](https://pkg.go.dev/go.viam.com/rdk/resource#Config): The resource configuration.

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/resource#Resource).

### DoCommand

Execute model-specific commands that are not otherwise defined by the component API.
Most models do not implement `DoCommand`.
Any available model-specific commands should be covered in the model’s documentation.
If you are implementing your own input controller and want to add features that have no corresponding built-in API method, you can implement them with [`DoCommand`](https://docs.viam.com/reference/sdks/docommand/).

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-7-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-7-1)

**Parameters:**

- `command` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), ValueTypes]) (required): The command to execute.
- `timeout` ( [float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command.

**Raises:**

- (NotImplementedError): Raised if the Resource does not support arbitrary commands.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.do_command).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `cmd` [(map[string]interface{})](https://go.dev/blog/maps): The command to execute.

**Returns:**

- [(map[string]interface{})](https://pkg.go.dev/builtin#string): The command response.
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/resource#Resource).

### GetResourceName

Get the `ResourceName` for this input controller.

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-8-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-8-1)
- [TypeScript](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-8-2)

**Parameters:**

- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The name of the Resource.

**Returns:**

- ( [viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.get_resource_name).

**Parameters:**

- None.

**Returns:**

- [(Name)](https://pkg.go.dev/go.viam.com/rdk@v0.89.0/resource#Name)

**Example:**

```go

```

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/resource#Resource).

**Parameters:**

- None.

**Returns:**

- (string): The name of the resource.

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/InputControllerClient.html#name).

### Close

Safely shut down the resource and prevent further use.

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-9-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-9-1)

**Parameters:**

- None.

**Returns:**

- None.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.close).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/resource#Resource).

## API types

The `input` API defines the following types:

### Event object

Each `Event` object represents a singular event from the input device, and has four fields:

1. `Time`: `time.Time` the event occurred.
2. `Event`: `EventType` indicating the type of event (for example, a specific button press or axis movement).
3. `Control`: `Control` indicating which [Axis](https://docs.viam.com/reference/apis/components/input-controller/#axis-controls), [Button](https://docs.viam.com/reference/apis/components/input-controller/#button-controls), or Pedal on the controller has been changed.
4. `Value`: `float64` indicating the position of an [Axis](https://docs.viam.com/reference/apis/components/input-controller/#axis-controls) or the state of a [Button](https://docs.viam.com/reference/apis/components/input-controller/#button-controls) on the specified control.

#### EventType field

A string-like type indicating the specific type of input event, such as a button press or axis movement.

- To select for events of all type when registering callback function with [RegisterControlCallback](https://docs.viam.com/reference/apis/components/input-controller/#registercontrolcallback), you can use `AllEvents` as your `EventType`.
- The registered function is then called in addition to any other callback functions you’ve registered, every time an `Event` happens on your controller.
This is useful for debugging without interrupting normal controls, or for capturing extra or unknown events.

Registered `EventTypes` definitions:

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-10-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-10-1)

```python

```

Copy

See [the Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/input/index.html#viam.components.input.EventType) for the most current version of supported `EventTypes`.

```go

```

Copy

See [the Viam RDK](https://github.com/viamrobotics/rdk/blob/main/components/input/input.go) for the most current version of supported `EventTypes`.

#### Control field

A string representing the physical input location, like a specific axis or button, of your `Controller` that the [Event Object](https://docs.viam.com/reference/apis/components/input-controller/#event-object) is coming from.

Registered `Control` types are defined as follows:

- [Python](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-11-0)
- [Go](https://docs.viam.com/reference/apis/components/input-controller/#tabset-referenceapiscomponentsinput-controller-11-1)

```python

```

Copy

See [the Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/input/index.html#viam.components.input.Control) for the most current version of supported `Control` types.

```go

```

Copy

See [GitHub](https://github.com/viamrobotics/rdk/blob/main/components/input/input.go) for the most current version of supported `Control` types.

### Axis controls

#### Support Notice

Currently, only `Absolute` axes are supported.

`Relative` axes, reporting a relative change in distance, used by devices like mice and trackpads, will be supported in the future.

Analog devices like joysticks and thumbsticks which return to center/neutral on their own use `Absolute` axis control types.

These controls report a `PositionChangeAbs` [EventType](https://docs.viam.com/reference/apis/components/input-controller/#eventtype-field).

**Value:** A `float64` between `-1.0` and `+1.0`.

- `1.0`: Maximum position in the positive direction.
- `0.0`: Center, neutral position.
- `-1.0`: Maximum position in the negative direction.

#### AbsoluteXY axes

If your input controller has an analog stick, this is what the stick’s controls report as.

Alternatively, if your input controller has _two_ analog sticks, this is what the left joystick’s controls report as.

| Name | `-1.0` | `0.0` | `1.0` |
| --- | --- | --- | --- |
| `AbsoluteX` | Stick Left | Neutral | Stick Right |
| `AbsoluteY` | Stick Forward | Neutral | Stick Backwards |

#### AbsoluteR-XY axes

If your input controller has _two_ analog sticks, this is what the right joystick’s controls report as.

| Name | `-1.0` | `0.0` | `1.0` |
| --- | --- | --- | --- |
| `AbsoluteRX` | Stick Left | Neutral | Stick Right |
| `AbsoluteRY` | Stick Forward | Neutral | Stick Backwards |

- For `Y` axes, the positive direction is “nose up,” and indicates _pulling_ back on the joystick.

#### Hat/D-Pad axes

If your input controller has a directional pad with analog buttons on the pad, this is what those controls report as.

| Name | `-1.0` | `0.0` | `1.0` |
| --- | --- | --- | --- |
| `AbsoluteHat0X` | Left DPAD Button Press | Neutral | Right DPAD Button Press |
| `AbsoluteHat0Y` | Up DPAD Button Press | Neutral | Down DPAD Button Press |

#### Z axes (analog trigger sticks)

#### Info

Devices like analog triggers and gas or brake pedals use `Absolute` axes, but they only report position change in the positive direction.
The neutral point of the axes is still `0.0`.

| Name | `-1.0` | `0.0` | `1.0` |
| --- | --- | --- | --- |
| `AbsoluteZ` |  | Neutral | Stick Pulled |
| `AbsoluteRZ` |  | Neutral | Stick Pulled |

`Z` axes are usually not present on most controller joysticks.

If present, they are typically analog trigger sticks, and unidirectional, scaling only from `0` to `1.0` as they are pulled, as shown above.

`AbsoluteZ` is reported if there is one trigger stick, and `AbsoluteZ` (left) and `AbsoluteRZ` (right) is reported if there are two trigger sticks.

Z axes can be present on flight-style joysticks, reporting _yaw_, or left/right rotation, as shown below.
This is not common.

| Name | `-1.0` | `0.0` | `1.0` |
| --- | --- | --- | --- |
| `AbsoluteZ` | Stick Left Yaw | Neutral | Stick Right Yaw |
| `AbsoluteRZ` | Stick Left Yaw | Neutral | Stick Right Yaw |

### Button controls

Button Controls report either `ButtonPress` or `ButtonRelease` as their [EventType](https://docs.viam.com/reference/apis/components/input-controller/#eventtype-field).

**Value:**

- `0`: released
- `1`: pressed

#### Action buttons (ABXY)

If your input controller is a gamepad with digital action buttons, this is what the controls for these buttons report as.

#### Tip

As different systems label the actual buttons differently, we use compass directions for consistency.

- `ButtonSouth` corresponds to “B” on Nintendo, “A” on XBox, and “X” on Playstation.
- `ButtonNorth` corresponds to “X” on Nintendo, “Y” on XBox, and “Triangle” on Playstation.

| Diamond 4-Action Button Pad | Rectangle 4-Action Button Pad |
| --- | --- |
| | Name | Description |
| --- | --- |
| `ButtonNorth` | Top |
| `ButtonSouth` | Bottom |
| `ButtonEast` | Right |
| `ButtonWest` | Left | | | Name | Description |
| --- | --- |
| `ButtonNorth` | Top-left |
| `ButtonSouth` | Bottom-right |
| `ButtonEast` | Top-right |
| `ButtonWest` | Bottom-left | |
| --- | --- | --- |
| Horizontal 3-Action Button Pad | Vertical 3-Action Button Pad |
| --- | --- | --- |
| | Name | Description |
| --- | --- |
| `ButtonWest` | Left |
| `ButtonSouth` | Center |
| `ButtonEast` | Right |
| | | Name | Description |
| --- | --- |
| `ButtonWest` | Top |
| `ButtonSouth` | Center |
| `ButtonEast` | Bottom |

#### Trigger buttons (bumpers)

If your input controller is a gamepad with digital trigger buttons, this is what the controls for those buttons report as.

| 2-Trigger Button Pad | 4-Trigger Button Pad |
| --- | --- |
| | Name | Description |
| --- | --- |
| `ButtonLT` | Left |
| `ButtonRT` | Right | | | Name | Description |
| --- | --- |
| `ButtonLT` | Top-left |
| `ButtonRT` | Top-right |
| `ButtonLT2` | Bottom-left |
| `ButtonRT2` | Bottom-right |

#### Digital buttons for sticks

If your input controller is a gamepad with “clickable” thumbsticks, this is what thumbstick presses report as.

| Name | Description |
| --- | --- |
| `ButtonLThumb` | Left or upper button for stick |
| `ButtonRThumb` | Right or lower button for stick |

#### Miscellaneous buttons

Many devices have additional buttons.
If your input controller is a gamepad with these common buttons, this is what the controls for those buttons report as.

| Name | Description |
| --- | --- |
| `ButtonSelect` | Select or - |
| `ButtonStart` | Start or + |
| `ButtonMenu` | Usually the central “Home” or Xbox/PS “Logo” button |
| `ButtonRecord` | Recording |
| `ButtonEStop` | Emergency Stop (on some industrial controllers) |

## Usage examples

### Control a wheeled base with a Logitech G920 steering wheel controller

The following Python code is an example of controlling a wheeled base with a Logitech G920 steering wheel controller, configured as a `gamepad` input controller.

```python

```

### Drive a robot with four wheels and a skid steer platform

The following Go code is part of an example of using an input controller to drive a robot with four wheels & a skid steer platform.
The `motorCtl` callback function controls 5 motors: left front & back `FL` `BL`, right front & back `FL` `BL`, and a `winder` motor that raises and lowers a front-end like a bulldozer.
The `event.Control` logic is registered as a callback function to determine the case for setting the power of each motor from which button is pressed on the input controller.

```go

```
