Struct InputBinding | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputBinding

    A mapping of control input to an action.

    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: UnityEngine.Experimental.Input
    Syntax
    public struct InputBinding : IEquatable<InputBinding>
    Remarks

    A single binding can match arbitrary many controls through its path and then map their input to a single action.

    A binding can also be used as a override specification. In that scenario, path, action, and groups become search criteria that can be used to find existing bindings, and overridePath becomes the path to override existing binding paths with.

    Finally, a binding can be used as a form of specifying a mask that matching bindings must comply to. For example, a binding that has only groups set to "Gamepad" and all other fields set to default can be used to mask for bindings in the "Gamepad" group.

    Fields

    kSeparator

    Declaration
    public const char kSeparator = ';'
    Field Value
    Type Description
    System.Char

    kSeparatorString

    Declaration
    public const string kSeparatorString = ";"
    Field Value
    Type Description
    System.String

    Properties

    action

    Name of the action triggered by the binding.

    Declaration
    public string action { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    This is null if the binding does not trigger an action.

    For InputBindings that are used as filters, this can be a "mapName/actionName" combination or "mapName/*" to match all actions in the given map.

    chainWithPrevious

    Declaration
    public bool chainWithPrevious { get; set; }
    Property Value
    Type Description
    System.Boolean

    groups

    Declaration
    public string groups { get; set; }
    Property Value
    Type Description
    System.String

    interactions

    Optional list of interactions and their parameters.

    Declaration
    public string interactions { get; set; }
    Property Value
    Type Description
    System.String
    Examples
    "tap,slowTap(duration=1.2)"

    isComposite

    Declaration
    public bool isComposite { get; set; }
    Property Value
    Type Description
    System.Boolean

    isPartOfComposite

    Declaration
    public bool isPartOfComposite { get; set; }
    Property Value
    Type Description
    System.Boolean

    name

    Optional name for the binding.

    Declaration
    public string name { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    For bindings that isPartOfComposite, this is the name of the field on the binding composite object that should be initialized with the control target of the binding.

    overrideInteractions

    Declaration
    public string overrideInteractions { get; set; }
    Property Value
    Type Description
    System.String

    overridePath

    If the binding is overridden, this is the overriding path. Otherwise it is null.

    Declaration
    public string overridePath { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    Not serialized as overrides are considered temporary, runtime-only state.

    overrideProcessors

    Declaration
    public string overrideProcessors { get; set; }
    Property Value
    Type Description
    System.String

    path

    Control path being bound to.

    Declaration
    public string path { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    If the binding is a composite (isComposite), the path is the composite string instead.

    Examples
    "/*/{PrimaryAction}"

    processors

    Optional list of processors to apply to control values.

    Declaration
    public string processors { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    This list has the same format as .

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    Equals(InputBinding)

    Declaration
    public bool Equals(InputBinding other)
    Parameters
    Type Name Description
    InputBinding other
    Returns
    Type Description
    System.Boolean

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()

    Operators

    Equality(InputBinding, InputBinding)

    Declaration
    public static bool operator ==(InputBinding left, InputBinding right)
    Parameters
    Type Name Description
    InputBinding left
    InputBinding right
    Returns
    Type Description
    System.Boolean

    Inequality(InputBinding, InputBinding)

    Declaration
    public static bool operator !=(InputBinding left, InputBinding right)
    Parameters
    Type Name Description
    InputBinding left
    InputBinding right
    Returns
    Type Description
    System.Boolean
    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