Control types reference
The Input System provides the following types of controls. These are available to select in the drop-down menu when you configure the control type of an action.
| Control Type | Value Type | Description | Example |
|---|---|---|---|
AxisControl |
float |
A 1D floating-point axis. | Gamepad.leftStick.x |
ButtonControl |
float |
A button expressed as a floating-point value. Whether the button can have a value other than 0 or 1 depends on the underlying representation. For example, gamepad trigger buttons can have values other than 0 and 1, but gamepad face buttons generally can't. | Mouse.leftButton |
KeyControl |
N/A | A specialized button that represents a key on a Keyboard. Keys have an associated keyCode and, unlike other types of Controls, change their display name in accordance to the currently active system-wide keyboard layout. Refer to the Keyboard documentation for details. |
Keyboard.aKey |
Vector2Control |
Vector2 |
A 2D floating-point vector. | Pointer.position |
Vector3Control |
Vector3 |
A 3D floating-point vector. | Accelerometer.acceleration |
QuaternionControl |
Quaternion |
A 3D rotation. | AttitudeSensor.attitude |
IntegerControl |
int |
An integer value. | Touchscreen.primaryTouch.touchId |
StickControl |
Vector2 |
A 2D stick control like the thumbsticks on gamepads or the stick control of a joystick. | Gamepad.rightStick |
DpadControl |
Vector2 |
A 4-way button control like the D-pad on gamepads or hatswitches on joysticks. | Gamepad.dpad |
TouchControl |
TouchState |
A control that represents all the properties of a touch on a touch screen. | Touchscreen.primaryTouch |
You can browse the set of all registered control layouts in the input debugger.
All controls are based on the InputControl base class. Most concrete implementations are based on InputControl<TValue>.