SDL_WM_GrabInput(3)

πŸ’– SDL_WM_GrabInput πŸ’–

okay bestie, welcome to the SDL API Reference β€” yes it's the manual page, no it's not boring, sit down, we're doing this ✨


🌸 NAME 🌸

SDL_WM_GrabInput β€” grabs mouse and keyboard input. like, it takes them. grabs them. literally the name, she's not subtle πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include "SDL.h"

SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);

that's it. one function, one argument, one return. lowkey elegant tbh πŸ¦‹


✨ DESCRIPTION ✨

so. grabbing β€” let's unpack the vibe. When input is grabbed, the mouse is confined to the application window (she cannot leave, she is locked in 🫢), and nearly all keyboard input is passed directly to the application instead of being interpreted by a window manager, if any. no middleman, no manager meddling, just you and the app. it's giving direct communication πŸŽ€

When mode is SDL_GRAB_QUERY, the grab mode is not changed, but the current grab mode is returned. so it's a lil peek, a vibe check, not a change. iykyk πŸ‘‘

and here's the enum, character for character, no cap:

typedef enum {
  SDL_GRAB_QUERY,
  SDL_GRAB_OFF,
  SDL_GRAB_ON
} SDL_GrabMode;

three modes, three moods, all iconic ✨


πŸ’œ RETURN VALUE πŸ’œ

The current/new SDL_GrabMode. she gives you back a mode. that's the whole thing. periodt πŸ’…


🌈 reminder: SDL_GRAB_QUERY = look, don't touch. use it wisely bestie 🧚

kisses, this page was brought to you by SDL, dated Tue 11 Sep 2001, 23:01 β€” yes the SDL API Reference, she's vintage, she's legendary, and she ate πŸ‘‘πŸ’–

πŸ“¦ where this page comes from