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 { readonly get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<InternedString> |
arraySize
Declaration
public int arraySize { readonly get; }
Property Value
Type | Description |
---|---|
Int32 |
bit
Declaration
public uint bit { readonly get; }
Property Value
Type | Description |
---|---|
UInt32 |
defaultState
Optional default value for the state memory associated with the control.
Declaration
public PrimitiveValue defaultState { readonly get; }
Property Value
Type | Description |
---|---|
PrimitiveValue |
displayName
Optional display name of the control.
Declaration
public string displayName { readonly 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 |
---|---|
Boolean | 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, Boolean) in which case controls that have this flag set will also get reset.
See Also
format
Declaration
public FourCC format { readonly get; }
Property Value
Type | Description |
---|---|
FourCC |
isArray
Declaration
public readonly 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
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 |
---|---|
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 { readonly 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".
maxValue
Declaration
public PrimitiveValue maxValue { readonly get; }
Property Value
Type | Description |
---|---|
PrimitiveValue |
minValue
Declaration
public PrimitiveValue minValue { readonly get; }
Property Value
Type | Description |
---|---|
PrimitiveValue |
name
Name of the control. Cannot be empty or null
.
Declaration
public InternedString name { readonly 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 { readonly get; }
Property Value
Type | Description |
---|---|
UInt32 |
parameters
Declaration
public ReadOnlyArray<NamedValue> parameters { readonly get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<NamedValue> |
processors
Declaration
public ReadOnlyArray<NameAndParameters> processors { readonly get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<NameAndParameters> |
shortDisplayName
Optional abbreviated display name of the control.
Declaration
public string shortDisplayName { readonly get; }
Property Value
Type | Description |
---|---|
String |
See Also
sizeInBits
Declaration
public uint sizeInBits { readonly get; }
Property Value
Type | Description |
---|---|
UInt32 |
usages
Declaration
public ReadOnlyArray<InternedString> usages { readonly get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<InternedString> |
useStateFrom
Declaration
public string useStateFrom { readonly get; }
Property Value
Type | Description |
---|---|
String |
variants
Declaration
public InternedString variants { readonly 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.