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, from 0 to 0xFFFF. so like, from "barely a whisper" to "full main character" πŸ”₯
  • right_rumble β€” the intensity of the right trigger rumble motor, from 0 to 0xFFFF. 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