---
name: "SDL_hid_enumerate"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_hid_enumerate"
---

# SDL\_hid\_enumerate(3)

Enumerate the HID Devices.

## NAME

SDL\_hid\_enumerate - Enumerate the HID Devices.

## HEADER FILE

Defined in SDL3/SDL\_hidapi.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_hid\_device\_info \* SDL\_hid\_enumerate(unsigned short vendor\_id, unsigned short product\_id);**

## DESCRIPTION

This function returns a linked list of all the HID devices attached to the system which match vendor\_id and product\_id. If **vendor\_id** is set to 0 then any vendor matches. If **product\_id** is set to 0 then any product matches. If **vendor\_id** and **product\_id** are both set to 0, then all HID devices will be returned.

By default SDL will only enumerate controllers, to reduce risk of hanging or crashing on bad drivers, but

**SDL\_HINT\_HIDAPI\_ENUMERATE\_ONLY\_CONTROLLERS**

can be set to "0" to enumerate all HID devices.

## FUNCTION PARAMETERS

- *vendor\_id*

  the Vendor ID (VID) of the types of device to open, or 0 to match any vendor.

- *product\_id*

  the Product ID (PID) of the types of device to open, or 0 to match any product.

## RETURN VALUE

( **SDL\_hid\_device\_info**\
  \*) Returns a pointer to a linked list of type  **SDL\_hid\_device\_info** , containing information about the HID devices attached to the system, or NULL in the case of failure. Free this linked list by calling

**SDL\_hid\_free\_enumeration** ().

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_hid\_device\_change\_count**(3)](/SDL_hid_device_change_count/3.md)
