---
name: "SDL_hid_open"
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_open"
---

# SDL\_hid\_open(3)

Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.

## NAME

SDL\_hid\_open - Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.

## HEADER FILE

Defined in SDL3/SDL\_hidapi.h

## SYNOPSIS

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

**SDL\_hid\_device \* SDL\_hid\_open(unsigned short vendor\_id, unsigned short product\_id, const wchar\_t \*serial\_number);**

## DESCRIPTION

If **serial\_number** is NULL, the first device with the specified VID and PID is opened.

## FUNCTION PARAMETERS

- *vendor\_id*

  the Vendor ID (VID) of the device to open.

- *product\_id*

  the Product ID (PID) of the device to open.

- *serial\_number*

  the Serial Number of the device to open (Optionally NULL).

## RETURN VALUE

( **SDL\_hid\_device**\
  \*) Returns a pointer to a

**SDL\_hid\_device**\
  object on success or NULL on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
