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 withtrueif the finger is down,falseotherwise, may beNULL. so like... is it touching or not, fr frxโ a pointer filled with the x position, normalized 0 to 1, with the origin in the upper left, may beNULL. tiny numbers, huge meaning ๐yโ a pointer filled with the y position, normalized 0 to 1, with the origin in the upper left, may beNULL. same deal but the other direction ๐ฆpressureโ a pointer filled with pressure value, may beNULL. how hard are we pressing, bestie ๐ญ
not me noticing thatdown,x,yandpressureare all allowed to beNULLโ 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 ๐
SDL_GetNumGamepadTouchpadFingers(3)โ go count how many fingers this touchpad can even track before you start indexing into them, iykyk
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
- 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