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

    Struct InputDeviceDescription

    Metadata for an input device.

    Namespace: UnityEngine.InputSystem.Layouts
    Syntax
    [Serializable]
    public struct InputDeviceDescription : IEquatable<InputDeviceDescription>
    Remarks

    Device descriptions are used to determine which layout to create an actual InputDevice instance from that matches the device.

    Properties

    capabilities

    An optional JSON string listing device-specific capabilities.

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

    The primary use of this field is to allow custom layout factories to create layouts on the fly from in-depth device descriptions delivered by external APIs.

    In the case of HID, for example, this field contains a JSON representation of the HID descriptor as reported by the device driver. This descriptor contains information about all I/O elements on the device which can be used to determine the control setup and data format used by the device.

    deviceClass

    What the interface thinks the device classifies as.

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

    If there is no layout specifically matching a device description, the device class is used as as fallback. If, for example, this field is set to "Gamepad", the "Gamepad" layout is used as a fallback.

    empty

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

    interfaceName

    How we talk to the device; usually name of the underlying backend that feeds state for the device.

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

    Examples: "HID", "XInput"

    manufacturer

    Name of the vendor that produced the device.

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

    product

    Name of the product assigned by the vendor to the device.

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

    serial

    If available, serial number for the device.

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

    version

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

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

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

    FromJson(String)

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

    GetHashCode()

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

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

    Operators

    Equality(InputDeviceDescription, InputDeviceDescription)

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

    Inequality(InputDeviceDescription, InputDeviceDescription)

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