.\" Automatically generated by Pandoc 3.1.6.2 .\" .\" 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_USER_EVENT" "3" "" "Allegro reference manual" "" .hy .SH NAME .PP ALLEGRO_USER_EVENT - Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include typedef struct ALLEGRO_USER_EVENT ALLEGRO_USER_EVENT; \f[R] .fi .SH DESCRIPTION .PP An event structure that can be emitted by user event sources. These are the public fields: .IP \[bu] 2 ALLEGRO_EVENT_SOURCE *source; .IP \[bu] 2 intptr_t data1; .IP \[bu] 2 intptr_t data2; .IP \[bu] 2 intptr_t data3; .IP \[bu] 2 intptr_t data4; .PP Like all other event types this structure is a part of the ALLEGRO_EVENT union. To access the fields in an ALLEGRO_EVENT variable \f[V]ev\f[R], you would use: .IP \[bu] 2 ev.user.source .IP \[bu] 2 ev.user.data1 .IP \[bu] 2 ev.user.data2 .IP \[bu] 2 ev.user.data3 .IP \[bu] 2 ev.user.data4 .PP To create a new user event you would do this: .IP .nf \f[C] ALLEGRO_EVENT_SOURCE my_event_source; ALLEGRO_EVENT my_event; float some_var; al_init_user_event_source(&my_event_source); my_event.user.type = ALLEGRO_GET_EVENT_TYPE(\[aq]M\[aq],\[aq]I\[aq],\[aq]N\[aq],\[aq]E\[aq]); my_event.user.data1 = 1; my_event.user.data2 = &some_var; al_emit_user_event(&my_event_source, &my_event, NULL); \f[R] .fi .PP Event type identifiers for user events are assigned by the user. Please see the documentation for ALLEGRO_GET_EVENT_TYPE(3) for the rules you should follow when assigning identifiers. .SH SEE ALSO .PP al_emit_user_event(3), ALLEGRO_GET_EVENT_TYPE(3), al_init_user_event_source(3)