Skip to main content

Struct SerializableInputDeviceMatcher

A custom serializable version of an input device matcher, used to configure and match specific input hardware devices. This allows the matcher to be editable in Unity's Project Settings.

[Serializable]
public struct SerializableInputDeviceMatcher

Properties​

Interface​

Gets the device interface string used by the input system (e.g., "HID", "USB").

public readonly string Interface { get; }

Property Value​

string

IsEmpty​

Determines whether the matcher is empty, i.e., has no identifying fields set.

public bool IsEmpty { get; }

Property Value​

bool

Manufacturer​

Gets the manufacturer name reported by the device.

public readonly string Manufacturer { get; }

Property Value​

string

PID​

Gets the product ID (PID) used to identify the device.

public readonly int PID { get; }

Property Value​

int

Product​

Gets the product name reported by the device.

public readonly string Product { get; }

Property Value​

string

VID​

Gets the vendor ID (VID) used to identify the device manufacturer.

public readonly int VID { get; }

Property Value​

int

Operators​

implicit operator InputDeviceMatcher(SerializableInputDeviceMatcher)​

Implicitly converts a SerializableInputDeviceMatcher into a Unity InputDeviceMatcher.

public static implicit operator InputDeviceMatcher(SerializableInputDeviceMatcher matcher)

Parameters​

NameTypeDescription
matcherSerializableInputDeviceMatcherThe SerializableInputDeviceMatcher instance containing device matching criteria.

Returns​

InputDeviceMatcher — An InputDeviceMatcher configured with the interface, product name, manufacturer, and optional vendor/product IDs from the provided serializable matcher.

Remarks​

This conversion allows SerializableInputDeviceMatcher to be used directly in contexts where an InputDeviceMatcher is required, improving readability and convenience.

  • Properties
    • Interface
    • IsEmpty
    • Manufacturer
    • PID
    • Product
    • VID
  • Operators
    • implicit operator InputDeviceMatcher(SerializableInputDeviceMatcher)