SDL_HINT_JOYSTICK_HIDAPI_SWITCH2(3)

๐Ÿ“ฆ
version 3.4.18 ยท 5 versions
, in fedora 43, fedora 44

โœจ SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 โœจ

okay bestie, so this is a page from the SDL3 function manual, and it's all about one lil hint variable with a big name: SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 ๐Ÿ’–

It's the switch that decides whether the HIDAPI driver for Nintendo Switch 2 controllers should be used. that's it. that's the whole vibe check. ๐ŸŽฎโœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_hints.h>

#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 "SDL_JOYSTICK_HIDAPI_SWITCH2"

like yes, the macro name and the string are literally identical, she's consistent, we love that for her ๐Ÿ’…


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

So this variable can be set to the following values, and there are exactly two of them, no more no less:

  • "0" โ€” HIDAPI driver is not used. nope. not happening. ๐Ÿ™ˆ
  • "1" โ€” HIDAPI driver is used. slay. ๐Ÿ‘‘

The default? It's the value of SDL_HINT_JOYSTICK_HIDAPI โ€” so if you never touched this one, she just copies whatever her big sibling hint says. inherited behavior, iconic honestly. ๐Ÿซถ

โš ๏ธ important bestie: this hint should be set before initializing joysticks and gamepads. set it after and, well, it's giving too late. ๐Ÿ˜ญ

๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

This hint has been available since SDL 3.4.0. so if you're on anything older, no she's not there, sorry. ๐Ÿ’€


and that's the whole page, fr fr ๐Ÿฆ‹

Simple Directmedia Layer brought you this one, sitting pretty at SDL 3.4.18 โ€” mwah, take care of your Switch 2 controllers, and remember: hints first, init after. periodt. ๐Ÿ’œ๐ŸŒธ

๐Ÿ“ฆ where this page comes from