# GetDevicesWithCharacteristics(InputDeviceCharacteristics, List<InputDevice>)

> Gets the list of active XR input devices that match the specified InputDeviceCharacteristics.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.XR](/engine/6000.3/script-reference/unityengine/xr.md)
* **Assembly:** UnityEngine.XRModule

```csharp
public static void GetDevicesWithCharacteristics(InputDeviceCharacteristics desiredCharacteristics, List<InputDevice> inputDevices)
```

### Parameters

**** (\[InputDeviceCharacteristics]\(/engine/6000.3/script-reference/unityengine/xr/inputdevicecharacteristics)): A bitwise combination of the characteristics you are looking for.**** (\[List\<InputDevice>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): A List\\\<InputDevice\\> object to receive the available input devices.

### Remarks

This function finds any input devices available to the XR Subsystem that match the specified [InputDeviceCharacteristics](/engine/6000.3/script-reference/unityengine/xr/inputdevicecharacteristics.md) bitmask exactly and inserts them into the `inputDevices` list. The function does not include devices that only provide some of the desired characteristics or capabilities.

The inputDevices list is cleared before any new elements are added.

The characteristics are a bitmask, and so you can use the | operator in order to search for multiple characteristics at once.

### Examples

```csharp
using UnityEngine;
using UnityEngine.XR;
using System.Collections.Generic;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        InputDeviceCharacteristics leftTrackedControllerFilter = InputDeviceCharacteristics.Controller | InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Left, leftHandedControllers;

        List<InputDevice> foundControllers = new List<InputDevice>();
        InputDevices.GetDevicesWithCharacteristics(leftTrackedControllerFilter, foundControllers);
    }
}
```
