docs.unity3d.com
    Show / Hide Table of Contents

    Class HID

    A generic HID input device.

    Inheritance
    Object
    InputControl
    InputDevice
    HID
    Inherited Members
    InputDevice.InvalidDeviceId
    InputDevice.description
    InputDevice.enabled
    InputDevice.canRunInBackground
    InputDevice.added
    InputDevice.remote
    InputDevice.native
    InputDevice.updateBeforeRender
    InputDevice.deviceId
    InputDevice.lastUpdateTime
    InputDevice.wasUpdatedThisFrame
    InputDevice.allControls
    InputDevice.valueType
    InputDevice.valueSizeInBytes
    InputDevice.all
    InputDevice.ReadValueFromBufferAsObject(Void*, Int32)
    InputDevice.ReadValueFromStateAsObject(Void*)
    InputDevice.ReadValueFromStateIntoBuffer(Void*, Void*, Int32)
    InputDevice.CompareValue(Void*, Void*)
    InputDevice.MakeCurrent()
    InputDevice.OnAdded()
    InputDevice.OnRemoved()
    InputDevice.OnConfigurationChanged()
    InputDevice.ExecuteCommand<TCommand>(TCommand)
    InputDevice.ExecuteCommand(InputDeviceCommand*)
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.Item[String]
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(Void*)
    InputControl.WriteValueFromBufferIntoState(Void*, Int32, Void*)
    InputControl.WriteValueFromObjectIntoState(Object, Void*)
    InputControl.TryGetChildControl(String)
    InputControl.TryGetChildControl<TControl>(String)
    InputControl.GetChildControl(String)
    InputControl.GetChildControl<TControl>(String)
    InputControl.FinishSetup()
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    Namespace: UnityEngine.InputSystem.HID
    Syntax
    public class HID : InputDevice
    Remarks

    This class represents a best effort to mirror the control setup of a HID discovered in the system. It is used only as a fallback where we cannot match the device to a specific product we know of. Wherever possible we construct more specific device representations such as Gamepad.

    Properties

    hidDescriptor

    The HID device descriptor as received from the system.

    Declaration
    public HID.HIDDeviceDescriptor hidDescriptor { get; }
    Property Value
    Type Description
    HID.HIDDeviceDescriptor

    QueryHIDParsedReportDescriptorDeviceCommandType

    Declaration
    public static FourCC QueryHIDParsedReportDescriptorDeviceCommandType { get; }
    Property Value
    Type Description
    FourCC

    QueryHIDReportDescriptorDeviceCommandType

    Command code for querying the HID report descriptor from a device.

    Declaration
    public static FourCC QueryHIDReportDescriptorDeviceCommandType { get; }
    Property Value
    Type Description
    FourCC
    See Also
    ExecuteCommand<TCommand>(TCommand)

    QueryHIDReportDescriptorSizeDeviceCommandType

    Command code for querying the HID report descriptor size in bytes from a device.

    Declaration
    public static FourCC QueryHIDReportDescriptorSizeDeviceCommandType { get; }
    Property Value
    Type Description
    FourCC
    See Also
    ExecuteCommand<TCommand>(TCommand)

    Methods

    UsagePageToString(HID.UsagePage)

    Declaration
    public static string UsagePageToString(HID.UsagePage usagePage)
    Parameters
    Type Name Description
    HID.UsagePage usagePage
    Returns
    Type Description
    String

    UsageToString(HID.UsagePage, Int32)

    Declaration
    public static string UsageToString(HID.UsagePage usagePage, int usage)
    Parameters
    Type Name Description
    HID.UsagePage usagePage
    Int32 usage
    Returns
    Type Description
    String

    Extension Methods

    InputControlExtensions.FindInParentChain<TControl>(InputControl)
    InputControlExtensions.IsPressed(InputControl, Single)
    InputControlExtensions.IsActuated(InputControl, Single)
    InputControlExtensions.ReadValueAsObject(InputControl)
    InputControlExtensions.ReadValueIntoBuffer(InputControl, Void*, Int32)
    InputControlExtensions.ReadDefaultValueAsObject(InputControl)
    InputControlExtensions.ReadValueFromEventAsObject(InputControl, InputEventPtr)
    InputControlExtensions.WriteValueFromObjectIntoEvent(InputControl, InputEventPtr, Object)
    InputControlExtensions.WriteValueIntoState(InputControl, Void*)
    InputControlExtensions.WriteValueIntoState<TValue>(InputControl, TValue, Void*)
    InputControlExtensions.WriteValueIntoEvent<TValue>(InputControl, TValue, InputEventPtr)
    InputControlExtensions.CopyState(InputDevice, Void*, Int32)
    InputControlExtensions.CopyState<TState>(InputDevice, out TState)
    InputControlExtensions.CheckStateIsAtDefault(InputControl)
    InputControlExtensions.CheckStateIsAtDefault(InputControl, Void*, Void*)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl, Void*)
    InputControlExtensions.CompareStateIgnoringNoise(InputControl, Void*)
    InputControlExtensions.CompareState(InputControl, Void*, Void*, Void*)
    InputControlExtensions.CompareState(InputControl, Void*, Void*)
    InputControlExtensions.HasValueChangeInState(InputControl, Void*)
    InputControlExtensions.HasValueChangeInEvent(InputControl, InputEventPtr)
    InputControlExtensions.GetStatePtrFromStateEvent(InputControl, InputEventPtr)
    InputControlExtensions.ResetToDefaultStateInEvent(InputControl, InputEventPtr)
    InputControlExtensions.FindControlsRecursive<TControl>(InputControl, IList<TControl>, Func<TControl, Boolean>)
    In This Article
    • Properties
      • hidDescriptor
      • QueryHIDParsedReportDescriptorDeviceCommandType
      • QueryHIDReportDescriptorDeviceCommandType
      • QueryHIDReportDescriptorSizeDeviceCommandType
    • Methods
      • UsagePageToString(HID.UsagePage)
      • UsageToString(HID.UsagePage, Int32)
    • Extension Methods
    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