Struct InputControlLayout.ControlItem
Specification for the composition of a direct or indirect child control.
Namespace: UnityEngine.InputSystem.Layouts
Syntax
public struct ControlItem
Properties
aliases
Declaration
public ReadOnlyArray<InternedString> aliases { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<InternedString> |
arraySize
Declaration
public int arraySize { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
bit
Declaration
public uint bit { get; }
Property Value
| Type | Description |
|---|---|
| UInt32 |
defaultState
Optional default value for the state memory associated with the control.
Declaration
public PrimitiveValue defaultState { get; }
Property Value
| Type | Description |
|---|---|
| PrimitiveValue |
displayName
Optional display name of the control.
Declaration
public string displayName { get; }
Property Value
| Type | Description |
|---|---|
| String |
See Also
format
Declaration
public FourCC format { get; }
Property Value
| Type | Description |
|---|---|
| FourCC |
isArray
Declaration
public bool isArray { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
isFirstDefinedInThisLayout
Whether the control is introduced by the layout.
Declaration
public bool isFirstDefinedInThisLayout { get; }
Property Value
| Type | Description |
|---|---|
| Boolean | If true, the control is first introduced by this layout. |
Remarks
The value of this property is automatically determined by the input system.
isModifyingExistingControl
Declaration
public bool isModifyingExistingControl { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
isNoisy
Get or set whether to mark the control as noisy.
Declaration
public bool isNoisy { get; }
Property Value
| Type | Description |
|---|---|
| Boolean | 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 |
|---|---|
| Boolean | 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 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 PrimitiveValue maxValue { get; }
Property Value
| Type | Description |
|---|---|
| PrimitiveValue |
minValue
Declaration
public PrimitiveValue minValue { get; }
Property Value
| Type | Description |
|---|---|
| PrimitiveValue |
name
Name of the control. Cannot be empty or null.
Declaration
public 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 uint offset { get; }
Property Value
| Type | Description |
|---|---|
| UInt32 |
parameters
Declaration
public ReadOnlyArray<NamedValue> parameters { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<NamedValue> |
processors
Declaration
public ReadOnlyArray<NameAndParameters> processors { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<NameAndParameters> |
shortDisplayName
Optional abbreviated display name of the control.
Declaration
public string shortDisplayName { get; }
Property Value
| Type | Description |
|---|---|
| String |
See Also
sizeInBits
Declaration
public uint sizeInBits { get; }
Property Value
| Type | Description |
|---|---|
| UInt32 |
usages
Declaration
public ReadOnlyArray<InternedString> usages { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyArray<InternedString> |
useStateFrom
Declaration
public string useStateFrom { get; }
Property Value
| Type | Description |
|---|---|
| String |
variants
Declaration
public InternedString variants { get; }
Property Value
| Type | Description |
|---|---|
| InternedString |
Methods
Merge(InputControlLayout.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.