SDL_MouseDeviceEvent(3type)
π SDL_MouseDeviceEvent β SDL3 DATATYPES, 3type π
okay so bestie, welcome to the SDL3 DATATYPES manual, section 3type, and today we're hyperfixating on SDL_MouseDeviceEvent β the mouse device event struct, aka the one that lives under event.mdevice.*. no cap. π¦
πΈ NAME πΈ
SDL_MouseDeviceEvent β the mouse device event structure, the one and only, the event.mdevice.* icon. periodt. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_events.h>
typedef struct SDL_MouseDeviceEvent
{
SDL_EventType type; /**< SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_MouseID which; /**< The mouse instance id */
} SDL_MouseDeviceEvent;
okay so let's break down this little struct, because she's giving very specific field energy:
typeβ anSDL_EventTypethat's eitherSDL_EVENT_MOUSE_ADDEDorSDL_EVENT_MOUSE_REMOVED. literally telling you if a mouse showed up or dipped out. πreservedβ it's aUint32calledreserved. bestie, it's reserved. no notes, we leave it alone. πtimestampβ aUint64, in nanoseconds, populated usingSDL_GetTicksNS(). so you know exactly when it happened, down to the nanosecond. obsessed. βwhichβ anSDL_MouseIDthat holds the mouse instance id. which mouse? that's the whole point. iykyk. π
π AVAILABILITY π
this struct has been available since SDL 3.2.0. so if you're on anything older, it's giving not yet, babes. upgrade era. πβ¨
and that's the whole page, bestie. this was the Simple Directmedia Layer manual, version SDL 3.4.18, for SDL_MouseDeviceEvent(3type). mwah π stay slaying those events. π«ΆπΈ
π¦ 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