SDL_RumbleJoystickTriggers(3)
π SDL_RumbleJoystickTriggers β SDL3 FUNCTIONS β¨
okay bestie, welcome to the manual page for SDL_RumbleJoystickTriggers, straight outta the SDL3 FUNCTIONS lineup π
πΈ NAME πΈ
SDL_RumbleJoystickTriggers β start a rumble effect in the joystick's triggers, no cap π₯
β¨ SYNOPSIS β¨
#include <SDL3/SDL_joystick.h>
bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
π¦ DESCRIPTION π¦
okay so here's the tea β β every single call to this function cancels any previous trigger rumble effect, like it's not even being subtle about it. and if you call it with 0 intensity, it just stops any rumbling entirely. periodt. π
ββοΈ
ngl, the important thing to clock here: this is rumbling of the _triggers_ and not the game controller as a whole. it's giving "very specific body part got the zoomies" energy. this is currently only supported on Xbox One controllers π β so if you want the (more common) whole-controller rumble, use SDL_RumbleJoystick() instead. iykyk π
also, this function requires you to process SDL events or call SDL_UpdateJoysticks() to update rumble state. like, it's not gonna just happen on its own, bestie, you gotta do the work π«Ά
π FUNCTION PARAMETERS π
joystickβ the joystick to vibrate. shake it, make it wiggle πleft_rumbleβ the intensity of the left trigger rumble motor, from0to0xFFFF. so like, from "barely a whisper" to "full main character" π₯right_rumbleβ the intensity of the right trigger rumble motor, from0to0xFFFF. same vibe, other side πduration_msβ the duration of the rumble effect, in milliseconds. how long the whole moment lasts β±οΈ
β RETURN VALUE β
Returns true on success or false on failure. and if it fails?? call SDL_GetError() for more information β she'll tell you what went wrong π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. so go off, thread queen πβ¨
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older... nope, not today π
πΈ SEE ALSO πΈ
heads up bestie: this one's trigger-only and Xbox One-controller-only, so don't come for me when your whole controller isn't buzzing π«
and that's a wrap, mwah π this page came from Simple Directmedia Layer, version SDL 3.4.18 β slay, bye, love u, drink water ππ¦β¨
π¦ 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