void OnEnable()
{
InputDevices.deviceConnected += DeviceConnected;
List<InputDevice> devices = new List<InputDevice>();
InputDevices.GetDevices(devices);
foreach(var device in devices)
DeviceConnected(device);
}
void OnDisable()
{
InputDevices.deviceConnected -= DeviceConnected;
}
void DeviceConnected(InputDevice device)
{
// The Left Hand
if ((device.characteristics & InputDeviceCharacteristics.Left) != 0)
{
//Use device.name here to identify the current Left Handed Device
}
// The Right hand
else if ((device.characteristics & InputDeviceCharacteristics.Right) != 0)
{
//Use device.Name here to identify the current Right Handed Device
}
}
Got this from: OpenXR -- Is it no longer possible to get descriptive device names?