SDL_WarpMouse(3)

πŸ’– SDL_WarpMouse β€” from the SDL API Reference (section 3, bestie) πŸ’–

okay so picture this: you're deep in your SDL era, and you need the mouse cursor to just be somewhere else. Not glide there. Not vibe there. Be there. That's literally this function. No cap. πŸ¦‹


✨ NAME ✨

SDL_WarpMouse β€” set the position of the mouse cursor. that's it. that's the whole job. she teleports, she doesn't walk. πŸ’…


🌸 SYNOPSIS 🌸

#include "SDL.h"

void SDL_WarpMouse(Uint16 x, Uint16 y);

like. two numbers. that's all she needs from you. πŸŽ€


πŸ’œ DESCRIPTION πŸ’œ

SDL_WarpMouse</purl> sets the position of the mouse cursor. and because nothing in SDL happens quietly, bestie, it generates a mouse motion event when it does. so if you've got an event loop watching for mouse movement, she will notice. main character energy fr fr. πŸ”₯

so like, don't be surprised when your motion handler fires after you warp. that's not a bug, that's just her being her. ✨


🫢 SEE ALSO 🫢

  • SDL_MouseMotionEvent β€” the event she's gonna spawn. go read up on it, iykyk. 🐭

and that's the whole page, bestie!! mwah πŸ’‹

this little gem comes to you from SDL (yes, the SDL API Reference), dated Tue 11 Sep 2001, 23:01 β€” vintage, iconic, still slaying. 🌈⭐

bye pookie, go warp responsibly πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from