ALLEGRO_EVENT_TYPE_IS_USER(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– ALLEGRO_EVENT_TYPE_IS_USER πŸ’–

okay bestie, this one's from the Allegro 5 API (manual page 3alleg5), and it's short, it's sweet, it's giving tiny-but-mighty. let's go 🫢


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

#define ALLEGRO_EVENT_TYPE_IS_USER(t)        ((t) >= 512)

🌸 DESCRIPTION 🌸

so this is a macro, right? and it literally just does a vibe check on your event type. you hand it an event type, and it evaluates to true if that event type is not a builtin event type.

not builtin = it's one of the ones described over in ALLEGRO_EVENT_TYPE(3alleg5). that's the whole deal. (t) >= 512 and boom, you know if it's a custom lil guy you made yourself or a factory-standard Allegro event. πŸ’…

ngl the threshold 512 is doing all the work here β€” user event types live at or above it, builtin ones live below. iconic. periodt. ✨

and that's the whole page, bestie, she's tiny but she ate πŸ“

sign-off szn πŸ’œ this was brought to you by the Allegro reference manual, sitting pretty at 3alleg5 β€” go forth and event-type-check responsibly, ily, bye πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from