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 β€” an SDL_EventType that's either SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED. literally telling you if a mouse showed up or dipped out. πŸ‘‘
  • reserved β€” it's a Uint32 called reserved. bestie, it's reserved. no notes, we leave it alone. πŸ™ˆ
  • timestamp β€” a Uint64, in nanoseconds, populated using SDL_GetTicksNS(). so you know exactly when it happened, down to the nanosecond. obsessed. ⭐
  • which β€” an SDL_MouseID that 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