SDL_WarpMouseGlobal(3)
β¨ SDL_WarpMouseGlobal β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where today's main character is SDL_WarpMouseGlobal π« β she moves your mouse cursor to a spot in global screen space, no cap.
πΈ NAME πΈ
SDL_WarpMouseGlobal β move the mouse to the given position in global screen space π±οΈβ¨
π SYNOPSIS π
#include <SDL3/SDL_mouse.h>
bool SDL_WarpMouseGlobal(float x, float y);
π DESCRIPTION π
so basically, this function generates a mouse motion event. that's the vibe. π¦
if it fails? ngl, that usually means the platform you're on just doesn't support it. it's giving "not my fault, the platform said no" π
π¨ real talk: this function will appear to succeed, but it will not actually move the mouse when you're using it over Microsoft Remote Desktop. it's a liar. a cute liar, but a liar. π
π«Ά FUNCTION PARAMETERS π«Ά
xβ the x coordinate. πyβ the y coordinate. π
β RETURN VALUE β
returns true on success or false on failure π₯² β and if it's a fail, call SDL_GetError() for more information, she'll tell you what went wrong. periodt.
π₯ THREAD SAFETY π₯
this function should only be called on the main thread. that's it, that's the rule. main thread only, bestie, don't try it anywhere else π
π AVAILABILITY π
this function is available since SDL 3.2.0 π
π SEE ALSO π
SDL_WarpMouseInWindow(3)β her sibling, also iconic, go read it π
and that's the whole page, bestie!! you ate this. go warp some mice (consensually, on the main thread) ππ
mwah π β brought to you by Simple Directmedia Layer, version SDL 3.4.18 π
π¦ 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