SDL_HINT_MOUSE_AUTO_CAPTURE(3)
β¨ SDL_HINT_MOUSE_AUTO_CAPTURE(3) β¨
part of the SDL3 FUNCTIONS fam, bestie π
πΈ NAME πΈ
SDL_HINT_MOUSE_AUTO_CAPTURE β it's the variable that decides whether your mouse gets captured while mouse buttons are pressed. that's the whole job. iconic behavior honestly.
π SYNOPSIS π
#include <SDL3/SDL_hints.h>
#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE"
π DESCRIPTION π
okay so this variable takes these values, no more no less:
"0"β the mouse is not captured while mouse buttons are pressed."1"β the mouse is captured while mouse buttons are pressed.
and here's the tea about the default: by default the mouse is captured while mouse buttons are pressed π«Ά which means if you drag that mouse outside the window, your application keeps receiving mouse events until the button is released. no ghosting, no dropped events, the app stays in the group chat. periodt.
This hint can be set anytime. yes bestie, literally whenever, no timing stress π
π AVAILABILITY π
this hint has been around since SDL 3.2.0. she's not new new, she's established π
β cute little sign-off β
this page came to you courtesy of Simple Directmedia Layer, running the SDL 3.4.18 era of things β so if you're on that version, you're golden, go capture that mouse (or don't, your call, you have the hint now) π¦β¨π
π¦ 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