SDL_SetModState(3)
π SDL_SetModState π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, we're talking about SDL_SetModState today and honestly? it's giving main character energy. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
SDL_SetModState β set the current key modifier state for the keyboard. that's it, that's the job, no cap π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_keyboard.h>
void SDL_SetModState(SDL_Keymod modstate);
π¦ DESCRIPTION π¦
okay so. SDL_SetModState() is literally the inverse of SDL_GetModState(), they're giving opposite sides of the same coin π
what it does is let you impose modifier key states on your application. like, you just pass whatever modifier states you want into modstate and SDL is like "say less, got it." and this value? it may be a bitwise, OR'd combination of SDL_Keymod values. so you can stack them up like accessories, periodt β¨
β οΈ but listen, important: this does not change the keyboard state. it only changes the key modifier flags that SDL reports. so don't come for me later being like "why is my actual keyboard not doing the thing" β that's not what this function is for, bestie π
π FUNCTION PARAMETERS π
modstateβ the desiredSDL_Keymodfor the keyboard. whatever you want it to be, you just hand it over, iconic π
π THREAD SAFETY π
it is safe to call this function from any thread. any. thread. go off, multithreaded queen π
β AVAILABILITY β
this function is available since SDL 3.2.0 β so if you're on something older, sorry babe, upgrade time π
π SEE ALSO π
SDL_GetModState(3)β the other half of this duo, the reading to this writing, the yin to this yang, go check it out fr fr π¦
and that's the whole page!! go forth and set those modifier states, you absolute legend π
this has been your girl from Simple Directmedia Layer, bringing you SDL 3.4.18 β mwah, catch you in the next man page πβ¨
π¦ 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