-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add FIRST and LAST event aliases to SDL_event #13331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I wasn't sure on how to name the keyboard events, so I left out SDL_EVENT_KEYBOARD_FIRST and LAST. Should I name it that, and have it include everything under that section? |
This makes it easier for SDL users to offload handling of event types to different handlers, and have those handlers match on the specific event type; the event poller only has to check the ranges to know who to hand the event to.
FYI, this failed CI and needs to be fixed before merging. |
Wouldn't the presence of a LAST plug prevent new event types of the same category from being added due to ABI compatibility guarantees? e.g. if one were to add a new SDL_EVENT_MOUSE_RAW_MOTION event then the status quo would permit it since it doesn't change the enum value, whereas with this addition it will break ABI compat of the LAST enum member. |
This is API, not ABI, I believe. The app compiles against an integer value
of LAST that stays that way until it recompiles, and even if SDL put out
the new event, the app wouldn't know what to do with it, so there's no
point in worrying about that.
We already have some FIRST and LAST events, so what's done is done. It's
more convenient to have it apply to all categories.
…On Sat, Aug 30, 2025, 7:02 PM expikr ***@***.***> wrote:
*expikr* left a comment (libsdl-org/SDL#13331)
<#13331 (comment)>
Wouldn't the presence of a LAST plug prevent new event types of the same
category from being added due to ABI compatibility guarantees? e.g. if one
were to add a new SDL_EVENT_MOUSE_RAW_MOTION event then the status quo
would permit it since it doesn't change the enum value, whereas with this
addition it will break ABI compat of the LAST enum member.
—
Reply to this email directly, view it on GitHub
<#13331 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWHH7L6PVS34R6WSIM75H233QI3R3AVCNFSM6AAAAACA4WHC7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMZZGYYTKOBWGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This makes it easier for SDL users to offload handling of event types to different handlers, and have those handlers match on the specific event type; the event poller only has to check the ranges to know who to hand the event to.