SDL_GetGamepadTouchpadFinger(3)

๐Ÿ’– SDL_GetGamepadTouchpadFinger(3) ๐Ÿ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one lives in SDL_GetGamepadTouchpadFinger(3) and it's literally the glow-up you need for reading lil fingies on a gamepad touchpad ๐Ÿซถ


โœจ NAME โœจ

SDL_GetGamepadTouchpadFinger โ€” get the current state of a finger on a touchpad on a gamepad. yes. a finger. on a touchpad. on a gamepad. we contain multitudes ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_gamepad.h>

bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure);

look at her. seven params. she's booked and busy โœจ


๐ŸŽ€ FUNCTION PARAMETERS ๐ŸŽ€

  • gamepad โ€” a gamepad. (the whole vibe, the main character, the device we're snooping on ๐ŸŽฎ)
  • touchpad โ€” a touchpad. (which one, bestie, some gamepads are giving options)
  • finger โ€” a finger. (which finger, we don't judge ๐Ÿ™ˆ)
  • down โ€” a pointer filled with true if the finger is down, false otherwise, may be NULL. so like... is it touching or not, fr fr
  • x โ€” a pointer filled with the x position, normalized 0 to 1, with the origin in the upper left, may be NULL. tiny numbers, huge meaning ๐Ÿ’–
  • y โ€” a pointer filled with the y position, normalized 0 to 1, with the origin in the upper left, may be NULL. same deal but the other direction ๐Ÿฆ‹
  • pressure โ€” a pointer filled with pressure value, may be NULL. how hard are we pressing, bestie ๐Ÿ˜ญ
not me noticing that down, x, y and pressure are all allowed to be NULL โ€” you can lowkey just ask for the one thing you want and ignore the rest, that's iconic of her ngl

โญ RETURN VALUE โญ

Returns true on success or false on failure; call SDL_GetError() for more information. so if she says false, go ask SDL_GetError() what's wrong, she always spills the tea ๐Ÿ“


๐Ÿงš THREAD SAFETY ๐Ÿงš

It is safe to call this function from any thread. every thread. all of them. periodt ๐Ÿ‘‘


๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

This function is available since SDL 3.2.0. if you're on something older than that... babe. upgrade. ๐Ÿ’€


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


Simple Directmedia Layer ยท SDL 3.4.18 ยท SDL_GetGamepadTouchpadFinger(3) โ€” and that's the whole page bestie, mwah, go read them fingies ๐Ÿ’…๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from