logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_hid_enumerate - Enumerate the HID Devices.

Availability

       This function is available since SDL 3.2.0.

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.

Name

       SDL_hid_enumerate - Enumerate the HID Devices.

Return Value

       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().

See Also

SDL_hid_device_change_count(3)

Simple Directmedia Layer                           SDL 3.2.20                               SDL_hid_enumerate(3)

Synopsis

#include<SDL3/SDL_hidapi.h>SDL_hid_device_info*SDL_hid_enumerate(unsignedshortvendor_id,unsignedshortproduct_id);

See Also