Struct InputControlLayout.ControlItem
Specification for the composition of a direct or indirect child control.
Namespace: UnityEngine.InputSystem.Layouts
Assembly: Unity.InputSystem.dll
Syntax
public struct InputControlLayout.ControlItem
Properties
aliases
Declaration
public readonly ReadOnlyArray<InternedString> aliases { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<InternedString> |
arraySize
Declaration
public readonly int arraySize { get; }
Property Value
| Type | Description |
|---|---|
| int |
bit
Declaration
public readonly uint bit { get; }
Property Value
| Type | Description |
|---|---|
| uint |
defaultState
Optional default value for the state memory associated with the control.
Declaration
public readonly PrimitiveValue defaultState { get; }
Property Value
| Type | Description |
|---|---|
| PrimitiveValue |
displayName
Optional display name of the control.
Declaration
public readonly string displayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
See Also
dontReset
Get or set whether the control should be excluded when performing a device reset.
Declaration
public bool dontReset { get; }
Property Value
| Type | Description |
|---|---|
| bool | If true, the control will not get reset in a device reset. Off by default. |
Remarks
Some controls like, for example, mouse positions do not generally make sense to reset when a device is reset. By setting this flag on, the control's state will be excluded in resets.
Note that a full reset can still be forced through ResetDevice(InputDevice, bool) in which case controls that have this flag set will also get reset.
See Also
format
Declaration
public readonly FourCC format { get; }
Property Value
| Type | Description |
|---|---|
| FourCC |
isArray
Declaration
public bool isArray { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isFirstDefinedInThisLayout
Whether the control is introduced by the layout.
Declaration
public bool isFirstDefinedInThisLayout { get; }
Property Value
| Type | Description |
|---|---|
| bool | If true, the control is first introduced by this layout. |
Remarks
The value of this property is automatically determined by the input system.
isModifyingExistingControl
If true, the item will not add a control but rather a modify a control
inside the hierarchy added by layout. This allows, for example, to modify
just the X axis control of the left stick directly from within a gamepad
layout instead of having to have a custom stick layout for the left stick
than in turn would have to make use of a custom axis layout for the X axis.
Instead, you can just have a control layout with the name "leftStick/x".
Declaration
public bool isModifyingExistingControl { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isNoisy
Get or set whether to mark the control as noisy.
Declaration
public bool isNoisy { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether to mark the control as noisy. |
Remarks
Noisy controls may generate varying input even without "proper" user interaction. For example, a sensor may generate slightly different input values over time even if in fact the very thing (such as the device orientation) that is being measured is not changing.
See Also
isSynthetic
Get or set whether to mark the control as "synthetic".
Declaration
public bool isSynthetic { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether to mark the control as synthetic. |
Remarks
Synthetic controls are artificial controls that provide input but do not correspond to actual controls on the hardware. An example is anyKey which is an artificial button that triggers if any key on the keyboard is pressed.
See Also
layout
Name of the layout to use for the control.
Declaration
public readonly InternedString layout { get; }
Property Value
| Type | Description |
|---|---|
| InternedString | Name of layout to use. |
Remarks
Must be the name of a control layout, not device layout.
An example would be "Stick".
See Also
maxValue
Declaration
public readonly PrimitiveValue maxValue { get; }
Property Value
| Type | Description |
|---|---|
| PrimitiveValue |
minValue
Declaration
public readonly PrimitiveValue minValue { get; }
Property Value
| Type | Description |
|---|---|
| PrimitiveValue |
name
Name of the control. Cannot be empty or null.
Declaration
public readonly InternedString name { get; }
Property Value
| Type | Description |
|---|---|
| InternedString | Name of the control. |
Remarks
This may also be a path of the form "parentName/childName...".
This can be used to reach inside another layout and modify properties of
a control inside of it. An example for this is adding a "leftStick" control
using the Stick layout and then adding two control layouts that refer to
"leftStick/x" and "leftStick/y" respectively to modify the state format used
by the stick.
This field is required.
See Also
offset
Declaration
public readonly uint offset { get; }
Property Value
| Type | Description |
|---|---|
| uint |
parameters
Declaration
public readonly ReadOnlyArray<NamedValue> parameters { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<NamedValue> |
processors
Declaration
public readonly ReadOnlyArray<NameAndParameters> processors { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<NameAndParameters> |
shortDisplayName
Optional abbreviated display name of the control.
Declaration
public readonly string shortDisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
See Also
sizeInBits
Declaration
public readonly uint sizeInBits { get; }
Property Value
| Type | Description |
|---|---|
| uint |
usages
Declaration
public readonly ReadOnlyArray<InternedString> usages { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<InternedString> |
useStateFrom
Declaration
public readonly string useStateFrom { get; }
Property Value
| Type | Description |
|---|---|
| string |
variants
Declaration
public readonly InternedString variants { get; }
Property Value
| Type | Description |
|---|---|
| InternedString |
Methods
Merge(ControlItem)
For any property not set on this control layout, take the setting from other.
Declaration
public InputControlLayout.ControlItem Merge(InputControlLayout.ControlItem other)
Parameters
| Type | Name | Description |
|---|---|---|
| InputControlLayout.ControlItem | other | Control layout providing settings. |
Returns
| Type | Description |
|---|---|
| InputControlLayout.ControlItem |
Remarks
name will not be touched.