.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "ALLEGRO_GET_EVENT_TYPE" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP ALLEGRO_GET_EVENT_TYPE - Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include #define ALLEGRO_GET_EVENT_TYPE(a, b, c, d) AL_ID(a, b, c, d) \f[R] .fi .SH DESCRIPTION .PP Make an event type identifier, which is a 32-bit integer. Usually, but not necessarily, this will be made from four 8-bit character codes, for example: .IP .nf \f[C] #define MY_EVENT_TYPE ALLEGRO_GET_EVENT_TYPE(\[aq]M\[aq],\[aq]I\[aq],\[aq]N\[aq],\[aq]E\[aq]) \f[R] .fi .PP IDs less than 1024 are reserved for Allegro or its addons. Don\[cq]t use anything lower than \f[V]ALLEGRO_GET_EVENT_TYPE(0, 0, 4, 0)\f[R]. .PP You should try to make your IDs unique so they don\[cq]t clash with any 3rd party code you may be using. Be creative. Numbering from 1024 is not creative. .PP If you need multiple identifiers, you could define them like this: .IP .nf \f[C] #define BASE_EVENT ALLEGRO_GET_EVENT_TYPE(\[aq]M\[aq],\[aq]I\[aq],\[aq]N\[aq],\[aq]E\[aq]) #define BARK_EVENT (BASE_EVENT + 0) #define MEOW_EVENT (BASE_EVENT + 1) #define SQUAWK_EVENT (BASE_EVENT + 2) /* Alternatively */ enum { BARK_EVENT = ALLEGRO_GET_EVENT_TYPE(\[aq]M\[aq],\[aq]I\[aq],\[aq]N\[aq],\[aq]E\[aq]), MEOW_EVENT, SQUAWK_EVENT }; \f[R] .fi .SH SEE ALSO .PP ALLEGRO_EVENT(3alleg5), ALLEGRO_USER_EVENT(3alleg5), ALLEGRO_EVENT_TYPE_IS_USER(3alleg5)