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

    Struct InputDeviceMatcher

    Specification that can be matched against an InputDeviceDescription.

    Namespace: UnityEngine.InputSystem.Layouts
    Syntax
    public struct InputDeviceMatcher : IEquatable<InputDeviceMatcher>
    Remarks

    InputDeviceMatchers are used to match descriptions of input devices to specific control layouts.

    Each matcher is basically a set of key/value pairs where each value may either be a regular expression or a plain value object.

    Properties

    DeviceClassKey

    Declaration
    public static InternedString DeviceClassKey { get; }
    Property Value
    Type Description
    InternedString

    empty

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

    InterfaceKey

    Declaration
    public static InternedString InterfaceKey { get; }
    Property Value
    Type Description
    InternedString

    ManufacturerKey

    Declaration
    public static InternedString ManufacturerKey { get; }
    Property Value
    Type Description
    InternedString

    patterns

    Declaration
    public IEnumerable<KeyValuePair<string, object>> patterns { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>>

    ProductKey

    Declaration
    public static InternedString ProductKey { get; }
    Property Value
    Type Description
    InternedString

    VersionKey

    Declaration
    public static InternedString VersionKey { get; }
    Property Value
    Type Description
    InternedString

    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(InputDeviceMatcher)

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

    FromDeviceDescription(InputDeviceDescription)

    Declaration
    public static InputDeviceMatcher FromDeviceDescription(InputDeviceDescription deviceDescription)
    Parameters
    Type Name Description
    InputDeviceDescription deviceDescription
    Returns
    Type Description
    InputDeviceMatcher

    FromJson(String)

    Declaration
    public static InputDeviceMatcher FromJson(string json)
    Parameters
    Type Name Description
    System.String json
    Returns
    Type Description
    InputDeviceMatcher

    GetHashCode()

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

    MatchPercentage(InputDeviceDescription)

    Return the level of matching to the given deviceDescription.

    Declaration
    public float MatchPercentage(InputDeviceDescription deviceDescription)
    Parameters
    Type Name Description
    InputDeviceDescription deviceDescription
    Returns
    Type Description
    System.Single
    Remarks

    The algorithm computes a score of how well the matcher matches the given description. For every property that is present on t

    ToJson()

    Declaration
    public string ToJson()
    Returns
    Type Description
    System.String

    ToString()

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

    With(InternedString, Object, Boolean)

    Declaration
    public InputDeviceMatcher With(InternedString key, object value, bool supportRegex = true)
    Parameters
    Type Name Description
    InternedString key
    System.Object value
    System.Boolean supportRegex
    Returns
    Type Description
    InputDeviceMatcher

    WithCapability<TValue>(String, TValue)

    Declaration
    public InputDeviceMatcher WithCapability<TValue>(string path, TValue value)
    Parameters
    Type Name Description
    System.String path
    TValue value
    Returns
    Type Description
    InputDeviceMatcher
    Type Parameters
    Name Description
    TValue

    WithDeviceClass(String, Boolean)

    Declaration
    public InputDeviceMatcher WithDeviceClass(string pattern, bool supportRegex = true)
    Parameters
    Type Name Description
    System.String pattern
    System.Boolean supportRegex
    Returns
    Type Description
    InputDeviceMatcher

    WithInterface(String, Boolean)

    Declaration
    public InputDeviceMatcher WithInterface(string pattern, bool supportRegex = true)
    Parameters
    Type Name Description
    System.String pattern
    System.Boolean supportRegex
    Returns
    Type Description
    InputDeviceMatcher

    WithManufacturer(String, Boolean)

    Declaration
    public InputDeviceMatcher WithManufacturer(string pattern, bool supportRegex = true)
    Parameters
    Type Name Description
    System.String pattern
    System.Boolean supportRegex
    Returns
    Type Description
    InputDeviceMatcher

    WithProduct(String, Boolean)

    Declaration
    public InputDeviceMatcher WithProduct(string pattern, bool supportRegex = true)
    Parameters
    Type Name Description
    System.String pattern
    System.Boolean supportRegex
    Returns
    Type Description
    InputDeviceMatcher

    WithVersion(String, Boolean)

    Declaration
    public InputDeviceMatcher WithVersion(string pattern, bool supportRegex = true)
    Parameters
    Type Name Description
    System.String pattern
    System.Boolean supportRegex
    Returns
    Type Description
    InputDeviceMatcher

    Operators

    Equality(InputDeviceMatcher, InputDeviceMatcher)

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

    Inequality(InputDeviceMatcher, InputDeviceMatcher)

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