SDL_MouseButtonFlags(3type)
π SDL_MouseButtonFlags
okay bestie, welcome to the <SDL3/SDL_mouse.h> cinematic universe, the SDL3 DATATYPES corner of it specifically β¨ this page is all about SDL_MouseButtonFlags, which is a bitmask of pressed mouse buttons, exactly as reported by SDL_GetMouseState, etc. π±οΈπ
πΈ NAME
SDL_MouseButtonFlags β a bitmask of pressed mouse buttons, as reported by SDL_GetMouseState, etc. no cap, that's literally the whole job π
β¨ SYNOPSIS
#include <SDL3/SDL_mouse.h>
typedef Uint32 SDL_MouseButtonFlags;
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_X1 4
#define SDL_BUTTON_X2 5
#define SDL_BUTTON_MASK(X) (1u << ((X)-1))
#define SDL_BUTTON_LMASK SDL_BUTTON_MASK(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON_MASK(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON_MASK(SDL_BUTTON_RIGHT)
#define SDL_BUTTON_X1MASK SDL_BUTTON_MASK(SDL_BUTTON_X1)
#define SDL_BUTTON_X2MASK SDL_BUTTON_MASK(SDL_BUTTON_X2)
so it's a Uint32 underneath, and there's a whole little family of #defines chilling with it β the button numbers and their matching masks, all copied above character for character because we do not freestyle code in this household π
βοΈβ¨
π¦ DESCRIPTION
here's the vibe check on which button is which π
- Button 1: Left mouse button
- Button 2: Middle mouse button
- Button 3: Right mouse button
- Button 4: Side mouse button 1
- Button 5: Side mouse button 2
that's it, that's the lineup, iconic behavior honestly π
π AVAILABILITY
this datatype is available since SDL 3.2.0. so if you're on something older, it's giving "not yet, babe" ππ«Ά
π SEE ALSO
go read those too, they're the ones actually handing you these flags π
mwah, that's the whole page β brought to you by Simple Directmedia Layer, version SDL 3.4.18, from the SDL_MouseButtonFlags(3type) files. stay masked, stay slay π
β¨π
π¦ 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