Class HIDSupport
Adds support for generic HID devices to the input system.
Namespace: UnityEngine.InputSystem.HID
Syntax
public static class HIDSupport : object
Remarks
Even without this module, HIDs can be used on platforms where we support HID has a native backend (Windows and OSX, at the moment). However, each supported HID requires a layout specifically targeting it as a product.
What this module adds is the ability to turn any HID with usable controls into an InputDevice. It will make a best effort to figure out a suitable class for the device and will use the HID elements present in the HID report descriptor to populate the device.
If there is an existing product-specific layout for a HID, it will take precedence and HIDSupport will leave the device alone.
Properties
supportedHIDUsages
An array of HID usages the input is configured to support.
Declaration
public static ReadOnlyArray<HIDSupport.HIDPageUsage> supportedHIDUsages { get; set; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<HIDSupport.HIDPageUsage> |
Remarks
The input system will only create InputDevices for HIDs with usages listed in this array. Any other HID will be ignored. This saves the input system from spending resources on creating layouts and devices for HIDs which are not supported or not usable for game input.
By default, this includes only Joystick, Gamepad and MultiAxisController, but you can set this property to include any other HID usages.
Note that currently on macOS, the only HID usages which can be enabled are Joystick, Gamepad, MultiAxisController, TabletPCControls, and AssistiveControl.