SDL_hid_get_indexed_string(3)
π SDL_hid_get_indexed_string π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_hid_get_indexed_string β yes she's a mouthful, yes she ate. β¨
πΈ NAME πΈ
SDL_hid_get_indexed_string β get a string from a HID device, based on its string index. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_hidapi.h>
int SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
look at her signature. so clean. so intentional. π
π FUNCTION PARAMETERS π
devβ a device handle returned fromSDL_hid_open(). yes, you gotta have opened the device first, no shortcuts, we don't do that here. πstring_indexβ the index of the string you want to get. literally the number that points at which string, iykyk.stringβ a wide string buffer to put the data into. wide. as inwchar_twide. bring your own buffer, bestie, she's not allocating one for you. π«Άmaxlenβ the length of the buffer, counted in multiples ofwchar_t. so it's not bytes, it's how manywchar_ts fit. important. do not get this wrong. π
π RETURN VALUE π
Returns 0 on success, or a negative error code on failure. and if it fails you must call SDL_GetError() for more information β she's not gonna spill the tea on her own, you gotta ask. π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older, that's a vibe check you're failing, bestie. β
and that's the whole page!! go forth and get those indexed HID strings, you absolute icon. π§π
β with love from the Simple Directmedia Layer girlies, SDL 3.4.18, SDL_hid_get_indexed_string(3). periodt. πβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms