Struct InputControlLayout.ControlItem | Input System | 1.0.2
docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputControlLayout.ControlItem

    Specification for the composition of a direct or indirect child control.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    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
    displayName

    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
    noisy

    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
    synthetic

    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
    RegisterLayout(Type, String, Nullable<InputDeviceMatcher>)

    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
    isModifyingExistingControl
    name

    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
    shortDisplayName

    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.

    See Also
    MergeLayout(InputControlLayout)
    In This Article
    • Properties
      • aliases
      • arraySize
      • bit
      • defaultState
      • displayName
      • format
      • isArray
      • isFirstDefinedInThisLayout
      • isModifyingExistingControl
      • isNoisy
      • isSynthetic
      • layout
      • maxValue
      • minValue
      • name
      • offset
      • parameters
      • processors
      • shortDisplayName
      • sizeInBits
      • usages
      • useStateFrom
      • variants
    • Methods
      • Merge(InputControlLayout.ControlItem)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023