Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > bbd6c195accb6dc3ffbe1b07ef155953 > files > 120

allegro5-devel-5.0.3-1.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Event system and events</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="generator" content="pandoc" />
  <link rel="stylesheet" href="pandoc.css" type="text/css" />
  <script type="text/javascript" src="autosuggest.js"></script>
  <script type="text/javascript" src="search_index.js"></script>
</head>
<body>
<div class="sidebar">

<div><ul
><li
  ><a href="index.html"
    ><strong
      >Contents</strong
      ></a
    ></li
  ><li
  ><a href="config.html"
    >Configuration files</a
    ></li
  ><li
  ><a href="display.html"
    >Display</a
    ></li
  ><li
  ><a href="events.html"
    >Events</a
    ></li
  ><li
  ><a href="file.html"
    >File I/O</a
    ></li
  ><li
  ><a href="fshook.html"
    >Filesystem</a
    ></li
  ><li
  ><a href="fixed.html"
    >Fixed point math</a
    ></li
  ><li
  ><a href="graphics.html"
    >Graphics</a
    ></li
  ><li
  ><a href="joystick.html"
    >Joystick</a
    ></li
  ><li
  ><a href="keyboard.html"
    >Keyboard</a
    ></li
  ><li
  ><a href="memory.html"
    >Memory</a
    ></li
  ><li
  ><a href="mouse.html"
    >Mouse</a
    ></li
  ><li
  ><a href="path.html"
    >Path</a
    ></li
  ><li
  ><a href="state.html"
    >State</a
    ></li
  ><li
  ><a href="system.html"
    >System</a
    ></li
  ><li
  ><a href="threads.html"
    >Threads</a
    ></li
  ><li
  ><a href="time.html"
    >Time</a
    ></li
  ><li
  ><a href="timer.html"
    >Timer</a
    ></li
  ><li
  ><a href="transformations.html"
    >Transformations</a
    ></li
  ><li
  ><a href="utf8.html"
    >UTF-8</a
    ></li
  ><li
  ><a href="misc.html"
    >Miscellaneous</a
    ></li
  ><li
  ><a href="platform.html"
    >Platform-specific</a
    ></li
  ><li
  ><a href="direct3d.html"
    >Direct3D</a
    ></li
  ><li
  ><a href="opengl.html"
    >OpenGL</a
    ></div>
</li
  ></ul
><div><ul
><li
  ><a href="index.html#addons"
    ><strong
      >Addons</strong
      ></a
    ></li
  ><li
  ><a href="audio.html"
    >Audio addon</a
    ></li
  ><li
  ><a href="acodec.html"
    >Audio codecs</a
    ></li
  ><li
  ><a href="color.html"
    >Color addon</a
    ></li
  ><li
  ><a href="font.html"
    >Font addons</a
    ></li
  ><li
  ><a href="image.html"
    >Image I/O addon</a
    ></li
  ><li
  ><a href="memfile.html"
    >Memfile addon</a
    ></li
  ><li
  ><a href="native_dialog.html"
    >Native dialogs addon</a
    ></li
  ><li
  ><a href="physfs.html"
    >PhysicsFS addon</a
    ></li
  ><li
  ><a href="primitives.html"
    >Primitives addon</a
    ></div>
</li
  ></ul
><div class="searchbox">
<script type="text/javascript">
function on_search(index, control) {
    for (i = 0; i < search_index.length; i++) {
        if (search_index[i] == control.keywords[index]) {
            break;
        }
    }
    location.href = search_urls[i];
}
</script>Search<br /> <input type="text" name="q" id="q" size="15" autocomplete="off" /><br /><script type="text/javascript"> new autosuggest("q", search_index, null, on_search); </script>
</div>

</div>

<div class="content">


<h1 class="title">Event system and events</h1>
<div id="TOC"
><ul
  ><li
    ><a href="#allegro_event"
      >ALLEGRO_EVENT</a
      ><ul
      ><li
	><a href="#allegro_event_joystick_axis"
	  >ALLEGRO_EVENT_JOYSTICK_AXIS</a
	  ></li
	><li
	><a href="#allegro_event_joystick_button_down"
	  >ALLEGRO_EVENT_JOYSTICK_BUTTON_DOWN</a
	  ></li
	><li
	><a href="#allegro_event_joystick_button_up"
	  >ALLEGRO_EVENT_JOYSTICK_BUTTON_UP</a
	  ></li
	><li
	><a href="#allegro_event_joystick_configuration"
	  >ALLEGRO_EVENT_JOYSTICK_CONFIGURATION</a
	  ></li
	><li
	><a href="#allegro_event_key_down"
	  >ALLEGRO_EVENT_KEY_DOWN</a
	  ></li
	><li
	><a href="#allegro_event_key_up"
	  >ALLEGRO_EVENT_KEY_UP</a
	  ></li
	><li
	><a href="#allegro_event_key_char"
	  >ALLEGRO_EVENT_KEY_CHAR</a
	  ></li
	><li
	><a href="#allegro_event_mouse_axes"
	  >ALLEGRO_EVENT_MOUSE_AXES</a
	  ></li
	><li
	><a href="#allegro_event_mouse_button_down"
	  >ALLEGRO_EVENT_MOUSE_BUTTON_DOWN</a
	  ></li
	><li
	><a href="#allegro_event_mouse_button_up"
	  >ALLEGRO_EVENT_MOUSE_BUTTON_UP</a
	  ></li
	><li
	><a href="#allegro_event_mouse_warped"
	  >ALLEGRO_EVENT_MOUSE_WARPED</a
	  ></li
	><li
	><a href="#allegro_event_mouse_enter_display"
	  >ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY</a
	  ></li
	><li
	><a href="#allegro_event_mouse_leave_display"
	  >ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY</a
	  ></li
	><li
	><a href="#allegro_event_timer"
	  >ALLEGRO_EVENT_TIMER</a
	  ></li
	><li
	><a href="#allegro_event_display_expose"
	  >ALLEGRO_EVENT_DISPLAY_EXPOSE</a
	  ></li
	><li
	><a href="#allegro_event_display_resize"
	  >ALLEGRO_EVENT_DISPLAY_RESIZE</a
	  ></li
	><li
	><a href="#allegro_event_display_close"
	  >ALLEGRO_EVENT_DISPLAY_CLOSE</a
	  ></li
	><li
	><a href="#allegro_event_display_lost"
	  >ALLEGRO_EVENT_DISPLAY_LOST</a
	  ></li
	><li
	><a href="#allegro_event_display_found"
	  >ALLEGRO_EVENT_DISPLAY_FOUND</a
	  ></li
	><li
	><a href="#allegro_event_display_switch_out"
	  >ALLEGRO_EVENT_DISPLAY_SWITCH_OUT</a
	  ></li
	><li
	><a href="#allegro_event_display_switch_in"
	  >ALLEGRO_EVENT_DISPLAY_SWITCH_IN</a
	  ></li
	><li
	><a href="#allegro_event_display_orientation"
	  >ALLEGRO_EVENT_DISPLAY_ORIENTATION</a
	  ></li
	></ul
      ></li
    ><li
    ><a href="#allegro_user_event"
      >ALLEGRO_USER_EVENT</a
      ></li
    ><li
    ><a href="#allegro_event_queue"
      >ALLEGRO_EVENT_QUEUE</a
      ></li
    ><li
    ><a href="#allegro_event_source"
      >ALLEGRO_EVENT_SOURCE</a
      ></li
    ><li
    ><a href="#allegro_event_type"
      >ALLEGRO_EVENT_TYPE</a
      ></li
    ><li
    ><a href="#allegro_get_event_type"
      >ALLEGRO_GET_EVENT_TYPE</a
      ></li
    ><li
    ><a href="#allegro_event_type_is_user"
      >ALLEGRO_EVENT_TYPE_IS_USER</a
      ></li
    ><li
    ><a href="#al_create_event_queue"
      >al_create_event_queue</a
      ></li
    ><li
    ><a href="#al_destroy_event_queue"
      >al_destroy_event_queue</a
      ></li
    ><li
    ><a href="#al_register_event_source"
      >al_register_event_source</a
      ></li
    ><li
    ><a href="#al_unregister_event_source"
      >al_unregister_event_source</a
      ></li
    ><li
    ><a href="#al_is_event_queue_empty"
      >al_is_event_queue_empty</a
      ></li
    ><li
    ><a href="#al_get_next_event"
      >al_get_next_event</a
      ></li
    ><li
    ><a href="#al_peek_next_event"
      >al_peek_next_event</a
      ></li
    ><li
    ><a href="#al_drop_next_event"
      >al_drop_next_event</a
      ></li
    ><li
    ><a href="#al_flush_event_queue"
      >al_flush_event_queue</a
      ></li
    ><li
    ><a href="#al_wait_for_event"
      >al_wait_for_event</a
      ></li
    ><li
    ><a href="#al_wait_for_event_timed"
      >al_wait_for_event_timed</a
      ></li
    ><li
    ><a href="#al_wait_for_event_until"
      >al_wait_for_event_until</a
      ></li
    ><li
    ><a href="#al_init_user_event_source"
      >al_init_user_event_source</a
      ></li
    ><li
    ><a href="#al_destroy_user_event_source"
      >al_destroy_user_event_source</a
      ></li
    ><li
    ><a href="#al_emit_user_event"
      >al_emit_user_event</a
      ></li
    ><li
    ><a href="#al_unref_user_event"
      >al_unref_user_event</a
      ></li
    ><li
    ><a href="#al_get_event_source_data"
      >al_get_event_source_data</a
      ></li
    ><li
    ><a href="#al_set_event_source_data"
      >al_set_event_source_data</a
      ></li
    ></ul
  ></div
>
<p
>These functions are declared in the main Allegro header file:</p
><pre
><code
  >#include &lt;allegro5/allegro.h&gt;
</code
  ></pre
><h1 id="allegro_event"
><a href="#TOC"
  >ALLEGRO_EVENT</a
  ></h1
><pre
><code
  >typedef union ALLEGRO_EVENT ALLEGRO_EVENT;
</code
  ></pre
><p
>An ALLEGRO_EVENT is a union of all builtin event structures, i.e. it is an object large enough to hold the data of any event type. All events have the following fields in common:</p
><dl
><dt
  >type (ALLEGRO_EVENT_TYPE)</dt
  ><dd
  ><p
    >Indicates the type of event.</p
    ></dd
  ><dt
  >any.source (ALLEGRO_EVENT_SOURCE *)</dt
  ><dd
  ><p
    >The event source which generated the event.</p
    ></dd
  ><dt
  >any.timestamp (double)</dt
  ><dd
  ><p
    >When the event was generated.</p
    ></dd
  ></dl
><p
>By examining the <code
  >type</code
  > field you can then access type-specific fields. The <code
  >any.source</code
  > field tells you which event source generated that particular event. The <code
  >any.timestamp</code
  > field tells you when the event was generated. The time is referenced to the same starting point as <a href="time.html#al_get_time"
  >al_get_time</a
  >.</p
><p
>Each event is of one of the following types, with the usable fields given.</p
><h2 id="allegro_event_joystick_axis"
><a href="#TOC"
  >ALLEGRO_EVENT_JOYSTICK_AXIS</a
  ></h2
><p
>A joystick axis value changed.</p
><dl
><dt
  >joystick.id (ALLEGRO_JOYSTICK *)</dt
  ><dd
  ><p
    >The joystick which generated the event. This is not the same as the event source <code
      >joystick.source</code
      >.</p
    ></dd
  ><dt
  >joystick.stick (int)</dt
  ><dd
  ><p
    >The stick number, counting from zero. Axes on a joystick are grouped into &quot;sticks&quot;.</p
    ></dd
  ><dt
  >joystick.axis (int)</dt
  ><dd
  ><p
    >The axis number on the stick, counting from zero.</p
    ></dd
  ><dt
  >joystick.pos (float)</dt
  ><dd
  ><p
    >The axis position, from -1.0 to +1.0.</p
    ></dd
  ></dl
><h2 id="allegro_event_joystick_button_down"
><a href="#TOC"
  >ALLEGRO_EVENT_JOYSTICK_BUTTON_DOWN</a
  ></h2
><p
>A joystick button was pressed.</p
><dl
><dt
  >joystick.id (ALLEGRO_JOYSTICK *)</dt
  ><dd
  ><p
    >The joystick which generated the event.</p
    ></dd
  ><dt
  >joystick.button (int)</dt
  ><dd
  ><p
    >The button which was pressed, counting from zero.</p
    ></dd
  ></dl
><h2 id="allegro_event_joystick_button_up"
><a href="#TOC"
  >ALLEGRO_EVENT_JOYSTICK_BUTTON_UP</a
  ></h2
><p
>A joystick button was released.</p
><dl
><dt
  >joystick.id (ALLEGRO_JOYSTICK *)</dt
  ><dd
  ><p
    >The joystick which generated the event.</p
    ></dd
  ><dt
  >joystick.button (int)</dt
  ><dd
  ><p
    >The button which was released, counting from zero.</p
    ></dd
  ></dl
><h2 id="allegro_event_joystick_configuration"
><a href="#TOC"
  >ALLEGRO_EVENT_JOYSTICK_CONFIGURATION</a
  ></h2
><p
>A joystick was plugged in or unplugged. See <a href="joystick.html#al_reconfigure_joysticks"
  >al_reconfigure_joysticks</a
  > for details.</p
><h2 id="allegro_event_key_down"
><a href="#TOC"
  >ALLEGRO_EVENT_KEY_DOWN</a
  ></h2
><p
>A keyboard key was pressed.</p
><dl
><dt
  >keyboard.keycode (int)</dt
  ><dd
  ><p
    >The code corresponding to the physical key which was pressed. See the &quot;Key codes&quot; section for the list of ALLEGRO_KEY_* constants.</p
    ></dd
  ><dt
  >keyboard.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had keyboard focus when the event occurred.</p
    ></dd
  ></dl
><blockquote
><p
  ><em
    >Note:</em
    > this event is about the physical keys being press on the keyboard. Look for ALLEGRO_EVENT_KEY_CHAR events for character input.</p
  ></blockquote
><h2 id="allegro_event_key_up"
><a href="#TOC"
  >ALLEGRO_EVENT_KEY_UP</a
  ></h2
><p
>A keyboard key was released.</p
><dl
><dt
  >keyboard.keycode (int)</dt
  ><dd
  ><p
    >The code corresponding to the physical key which was released. See the &quot;Key codes&quot; section for the list of ALLEGRO_KEY_* constants.</p
    ></dd
  ><dt
  >keyboard.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had keyboard focus when the event occurred.</p
    ></dd
  ></dl
><h2 id="allegro_event_key_char"
><a href="#TOC"
  >ALLEGRO_EVENT_KEY_CHAR</a
  ></h2
><p
>A character was typed on the keyboard, or a character was auto-repeated.</p
><dl
><dt
  >keyboard.keycode (int)</dt
  ><dd
  ><p
    >The code corresponding to the physical key which was last pressed. See the &quot;Key codes&quot; section for the list of ALLEGRO_KEY_* constants.</p
    ></dd
  ><dt
  >keyboard.unichar (int)</dt
  ><dd
  ><p
    >A Unicode code point (character). This <em
      >may</em
      > be zero or negative if the event was generated for a non-visible &quot;character&quot;, such as an arrow or Function key. In that case you can act upon the <code
      >keycode</code
      > field.</p
    ><p
    >Some special keys will set the <code
      >unichar</code
      > field to their standard ASCII values: Tab=9, Return=13, Escape=27. In addition if you press the Control key together with A to Z the <code
      >unichar</code
      > field will have the values 1 to 26. For example Ctrl-A will set <code
      >unichar</code
      > to 1 and Ctrl-H will set it to 8.</p
    ><p
    >As of Allegro 5.0.2 there are some inconsistencies in the treatment of Backspace (8 or 127) and Delete (127 or 0) keys on different platforms. These can be worked around by checking the <code
      >keycode</code
      > field.</p
    ></dd
  ><dt
  >keyboard.modifiers (unsigned)</dt
  ><dd
  ><p
    >This is a bitfield of the modifier keys which were pressed when the event occurred. See &quot;Keyboard modifier flags&quot; for the constants.</p
    ></dd
  ><dt
  >keyboard.repeat (bool)</dt
  ><dd
  ><p
    >Indicates if this is a repeated character.</p
    ></dd
  ><dt
  >keyboard.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had keyboard focus when the event occurred.</p
    ></dd
  ></dl
><blockquote
><p
  ><em
    >Note</em
    >: in many input methods, characters are <em
    >not</em
    > entered one-for-one with physical key presses. Multiple key presses can combine to generate a single character, e.g. apostrophe + e may produce 'é'. Fewer key presses can also generate more characters, e.g. macro sequences expanding to common phrases.</p
  ></blockquote
><h2 id="allegro_event_mouse_axes"
><a href="#TOC"
  >ALLEGRO_EVENT_MOUSE_AXES</a
  ></h2
><p
>One or more mouse axis values changed.</p
><dl
><dt
  >mouse.x (int)</dt
  ><dd
  ><p
    >x-coordinate</p
    ></dd
  ><dt
  >mouse.y (int)</dt
  ><dd
  ><p
    >y-coordinate</p
    ></dd
  ><dt
  >mouse.z (int)</dt
  ><dd
  ><p
    >z-coordinate. This usually means the vertical axis of a mouse wheel, where up is positive and down is negative.</p
    ></dd
  ><dt
  >mouse.w (int)</dt
  ><dd
  ><p
    >w-coordinate. This usually means the horizontal axis of a mouse wheel.</p
    ></dd
  ><dt
  >mouse.dx (int)</dt
  ><dd
  ><p
    >Change in the x-coordinate value since the previous ALLEGRO_EVENT_MOUSE_AXES event.</p
    ></dd
  ><dt
  >mouse.dy (int)</dt
  ><dd
  ><p
    >Change in the y-coordinate value since the previous ALLEGRO_EVENT_MOUSE_AXES event.</p
    ></dd
  ><dt
  >mouse.dz (int)</dt
  ><dd
  ><p
    >Change in the z-coordinate value since the previous ALLEGRO_EVENT_MOUSE_AXES event.</p
    ></dd
  ><dt
  >mouse.dw (int)</dt
  ><dd
  ><p
    >Change in the w-coordinate value since the previous ALLEGRO_EVENT_MOUSE_AXES event.</p
    ></dd
  ><dt
  >mouse.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had mouse focus.</p
    ></dd
  ></dl
><blockquote
><p
  ><em
    >Note:</em
    > Calling <a href="mouse.html#al_set_mouse_xy"
    >al_set_mouse_xy</a
    > also will result in a change of axis values, but such a change is reported with ALLEGRO_EVENT_MOUSE_WARPED events instead.</p
  ></blockquote
><blockquote
><p
  ><em
    >Note:</em
    > currently mouse.display may be NULL if an event is generated in response to <a href="mouse.html#al_set_mouse_axis"
    >al_set_mouse_axis</a
    >.</p
  ></blockquote
><h2 id="allegro_event_mouse_button_down"
><a href="#TOC"
  >ALLEGRO_EVENT_MOUSE_BUTTON_DOWN</a
  ></h2
><p
>A mouse button was pressed.</p
><dl
><dt
  >mouse.x (int)</dt
  ><dd
  ><p
    >x-coordinate</p
    ></dd
  ><dt
  >mouse.y (int)</dt
  ><dd
  ><p
    >y-coordinate</p
    ></dd
  ><dt
  >mouse.z (int)</dt
  ><dd
  ><p
    >z-coordinate</p
    ></dd
  ><dt
  >mouse.w (int)</dt
  ><dd
  ><p
    >w-coordinate</p
    ></dd
  ><dt
  >mouse.button (unsigned)</dt
  ><dd
  ><p
    >The mouse button which was pressed, numbering from 1.</p
    ></dd
  ><dt
  >mouse.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had mouse focus.</p
    ></dd
  ></dl
><h2 id="allegro_event_mouse_button_up"
><a href="#TOC"
  >ALLEGRO_EVENT_MOUSE_BUTTON_UP</a
  ></h2
><p
>A mouse button was released.</p
><dl
><dt
  >mouse.x (int)</dt
  ><dd
  ><p
    >x-coordinate</p
    ></dd
  ><dt
  >mouse.y (int)</dt
  ><dd
  ><p
    >y-coordinate</p
    ></dd
  ><dt
  >mouse.z (int)</dt
  ><dd
  ><p
    >z-coordinate</p
    ></dd
  ><dt
  >mouse.w (int)</dt
  ><dd
  ><p
    >w-coordinate</p
    ></dd
  ><dt
  >mouse.button (unsigned)</dt
  ><dd
  ><p
    >The mouse button which was released, numbering from 1.</p
    ></dd
  ><dt
  >mouse.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had mouse focus.</p
    ></dd
  ></dl
><h2 id="allegro_event_mouse_warped"
><a href="#TOC"
  >ALLEGRO_EVENT_MOUSE_WARPED</a
  ></h2
><p
><a href="mouse.html#al_set_mouse_xy"
  >al_set_mouse_xy</a
  > was called to move the mouse. This event is identical to ALLEGRO_EVENT_MOUSE_AXES otherwise.</p
><h2 id="allegro_event_mouse_enter_display"
><a href="#TOC"
  >ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY</a
  ></h2
><p
>The mouse cursor entered a window opened by the program.</p
><dl
><dt
  >mouse.x (int)</dt
  ><dd
  ><p
    >x-coordinate</p
    ></dd
  ><dt
  >mouse.y (int)</dt
  ><dd
  ><p
    >y-coordinate</p
    ></dd
  ><dt
  >mouse.z (int)</dt
  ><dd
  ><p
    >z-coordinate</p
    ></dd
  ><dt
  >mouse.w (int)</dt
  ><dd
  ><p
    >w-coordinate</p
    ></dd
  ><dt
  >mouse.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had mouse focus.</p
    ></dd
  ></dl
><h2 id="allegro_event_mouse_leave_display"
><a href="#TOC"
  >ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY</a
  ></h2
><p
>The mouse cursor leave the boundaries of a window opened by the program.</p
><dl
><dt
  >mouse.x (int)</dt
  ><dd
  ><p
    >x-coordinate</p
    ></dd
  ><dt
  >mouse.y (int)</dt
  ><dd
  ><p
    >y-coordinate</p
    ></dd
  ><dt
  >mouse.z (int)</dt
  ><dd
  ><p
    >z-coordinate</p
    ></dd
  ><dt
  >mouse.w (int)</dt
  ><dd
  ><p
    >w-coordinate</p
    ></dd
  ><dt
  >mouse.display (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which had mouse focus.</p
    ></dd
  ></dl
><h2 id="allegro_event_timer"
><a href="#TOC"
  >ALLEGRO_EVENT_TIMER</a
  ></h2
><p
>A timer counter incremented.</p
><dl
><dt
  >timer.source (ALLEGRO_TIMER *)</dt
  ><dd
  ><p
    >The timer which generated the event.</p
    ></dd
  ><dt
  >timer.count (int64_t)</dt
  ><dd
  ><p
    >The timer count value.</p
    ></dd
  ></dl
><h2 id="allegro_event_display_expose"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_EXPOSE</a
  ></h2
><p
>The display (or a portion thereof) has become visible.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which was exposed.</p
    ></dd
  ><dt
  >display.x (int)</dt
  ><dd
  > </dd
  ><dt
  >display.y (int)</dt
  ><dd
  > </dd
  ><dd
  ><p
    >The top-left corner of the display which was exposed.</p
    ></dd
  ><dt
  >display.width (int)</dt
  ><dd
  > </dd
  ><dt
  >display.height (int)</dt
  ><dd
  ><p
    >The width and height of the rectangle which was exposed.</p
    ></dd
  ></dl
><blockquote
><p
  ><em
    >Note:</em
    > The display needs to be created with ALLEGRO_GENERATE_EXPOSE_EVENTS flag for these events to be generated.</p
  ></blockquote
><h2 id="allegro_event_display_resize"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_RESIZE</a
  ></h2
><p
>The window has been resized.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which was resized.</p
    ></dd
  ><dt
  >display.x (int)</dt
  ><dd
  > </dd
  ><dt
  >display.y (int)</dt
  ><dd
  ><p
    >The position of the top-level corner of the display.</p
    ></dd
  ><dt
  >display.width (int)</dt
  ><dd
  ><p
    >The new width of the display.</p
    ></dd
  ><dt
  >display.height (int)</dt
  ><dd
  ><p
    >The new height of the display.</p
    ></dd
  ></dl
><p
>Note that further resize events may be generated by the time you process the event, so these fields may hold outdated information.</p
><h2 id="allegro_event_display_close"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_CLOSE</a
  ></h2
><p
>The close button of the window has been pressed.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  >The display which was closed.</dd
  ></dl
><h2 id="allegro_event_display_lost"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_LOST</a
  ></h2
><p
>When using Direct3D, displays can enter a &quot;lost&quot; state. In that state, drawing calls are ignored, and upon entering the state, bitmap's pixel data can become undefined. Allegro does its best to preserve the correct contents of bitmaps (see ALLEGRO_NO_PRESERVE_TEXTURE) and restore them when the device is &quot;found&quot; (see ALLEGRO_EVENT_DISPLAY_FOUND). However, this is not 100% fool proof.</p
><p
>To ensure that all bitmap contents are restored accurately, one must take additional steps. The best procedure to follow if bitmap constancy is important to you is as follows: first, always have the ALLEGRO_NO_PRESERVE_TEXTURE flag set to true when creating bitmaps, as it incurs pointless overhead when using this method. Second, create a mechanism in your game for easily reloading all of your bitmaps -- for example, wrap them in a class or data structure and have a &quot;bitmap manager&quot; that can reload them back to the desired state. Then, when you receive an ALLEGRO_EVENT_DISPLAY_FOUND event, tell the bitmap manager (or whatever your mechanism is) to restore your bitmaps.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  >The display which was lost.</dd
  ></dl
><h2 id="allegro_event_display_found"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_FOUND</a
  ></h2
><p
>Generated when a lost device is restored to operating state. See ALLEGRO_EVENT_DISPLAY_LOST.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  >The display which was found.</dd
  ></dl
><h2 id="allegro_event_display_switch_out"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_SWITCH_OUT</a
  ></h2
><p
>The window is no longer active, that is the user might have clicked into another window or &quot;tabbed&quot; away.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  >The display which was switched out of.</dd
  ></dl
><h2 id="allegro_event_display_switch_in"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_SWITCH_IN</a
  ></h2
><p
>The window is the active one again.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  >The display which was switched into.</dd
  ></dl
><h2 id="allegro_event_display_orientation"
><a href="#TOC"
  >ALLEGRO_EVENT_DISPLAY_ORIENTATION</a
  ></h2
><p
>Generated when the rotation or orientation of a display changes.</p
><dl
><dt
  >display.source (ALLEGRO_DISPLAY *)</dt
  ><dd
  ><p
    >The display which generated the event.</p
    ></dd
  ><dt
  >event.display.orientation</dt
  ><dd
  ><p
    >Contains one of the following values:</p
    ><ul
    ><li
      >ALLEGRO_DISPLAY_ORIENTATION_0_DEGREES</li
      ><li
      >ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES</li
      ><li
      >ALLEGRO_DISPLAY_ORIENTATION_180_DEGREES</li
      ><li
      >ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES</li
      ><li
      >ALLEGRO_DISPLAY_ORIENTATION_FACE_UP</li
      ><li
      >ALLEGRO_DISPLAY_ORIENTATION_FACE_DOWN</li
      ></ul
    ></dd
  ></dl
><p
>See also: <a href="events.html#allegro_event_source"
  >ALLEGRO_EVENT_SOURCE</a
  >, <a href="events.html#allegro_event_type"
  >ALLEGRO_EVENT_TYPE</a
  >, <a href="events.html#allegro_user_event"
  >ALLEGRO_USER_EVENT</a
  ></p
><h1 id="allegro_user_event"
><a href="#TOC"
  >ALLEGRO_USER_EVENT</a
  ></h1
><pre
><code
  >typedef struct ALLEGRO_USER_EVENT ALLEGRO_USER_EVENT;
</code
  ></pre
><p
>An event structure that can be emitted by user event sources. These are the public fields:</p
><ul
><li
  >ALLEGRO_EVENT_SOURCE *source;</li
  ><li
  >intptr_t data1;</li
  ><li
  >intptr_t data2;</li
  ><li
  >intptr_t data3;</li
  ><li
  >intptr_t data4;</li
  ></ul
><p
>See also: <a href="events.html#al_emit_user_event"
  >al_emit_user_event</a
  ></p
><h1 id="allegro_event_queue"
><a href="#TOC"
  >ALLEGRO_EVENT_QUEUE</a
  ></h1
><pre
><code
  >typedef struct ALLEGRO_EVENT_QUEUE ALLEGRO_EVENT_QUEUE;
</code
  ></pre
><p
>An event queue holds events that have been generated by event sources that are registered with the queue. Events are stored in the order they are generated. Access is in a strictly FIFO (first-in-first-out) order.</p
><p
>See also: <a href="events.html#al_create_event_queue"
  >al_create_event_queue</a
  >, <a href="events.html#al_destroy_event_queue"
  >al_destroy_event_queue</a
  ></p
><h1 id="allegro_event_source"
><a href="#TOC"
  >ALLEGRO_EVENT_SOURCE</a
  ></h1
><pre
><code
  >typedef struct ALLEGRO_EVENT_SOURCE ALLEGRO_EVENT_SOURCE;
</code
  ></pre
><p
>An event source is any object which can generate events. For example, an ALLEGRO_DISPLAY can generate events, and you can get the ALLEGRO_EVENT_SOURCE pointer from an ALLEGRO_DISPLAY with <a href="display.html#al_get_display_event_source"
  >al_get_display_event_source</a
  >.</p
><p
>You may create your own &quot;user&quot; event sources that emit custom events.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#al_init_user_event_source"
  >al_init_user_event_source</a
  >, <a href="events.html#al_emit_user_event"
  >al_emit_user_event</a
  ></p
><h1 id="allegro_event_type"
><a href="#TOC"
  >ALLEGRO_EVENT_TYPE</a
  ></h1
><pre
><code
  >typedef unsigned int ALLEGRO_EVENT_TYPE;
</code
  ></pre
><p
>An integer used to distinguish between different types of events.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#allegro_get_event_type"
  >ALLEGRO_GET_EVENT_TYPE</a
  >, <a href="events.html#allegro_event_type_is_user"
  >ALLEGRO_EVENT_TYPE_IS_USER</a
  ></p
><h1 id="allegro_get_event_type"
><a href="#TOC"
  >ALLEGRO_GET_EVENT_TYPE</a
  ></h1
><pre
><code
  >#define ALLEGRO_GET_EVENT_TYPE(a, b, c, d)   AL_ID(a, b, c, d)
</code
  ></pre
><p
>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:</p
><pre
><code
  >#define MY_EVENT_TYPE   ALLEGRO_GET_EVENT_TYPE('M','I','N','E')
</code
  ></pre
><p
>IDs less than 1024 are reserved for Allegro or its addons. Don't use anything lower than <code
  >ALLEGRO_GET_EVENT_TYPE(0, 0, 4, 0)</code
  >.</p
><p
>You should try to make your IDs unique so they don't clash with any 3rd party code you may be using. Be creative. Numbering from 1024 is not creative.</p
><p
>If you need multiple identifiers, you could define them like this:</p
><pre
><code
  >#define BASE_EVENT   ALLEGRO_GET_EVENT_TYPE('M','I','N','E')
#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('M','I','N','E'),
   MEOW_EVENT,
   SQUAWK_EVENT
};
</code
  ></pre
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#allegro_event_type_is_user"
  >ALLEGRO_EVENT_TYPE_IS_USER</a
  ></p
><h1 id="allegro_event_type_is_user"
><a href="#TOC"
  >ALLEGRO_EVENT_TYPE_IS_USER</a
  ></h1
><pre
><code
  >#define ALLEGRO_EVENT_TYPE_IS_USER(t)        ((t) &gt;= 512)
</code
  ></pre
><p
>A macro which evaluates to true if the event type is not a builtin event type, i.e. one of those described in <a href="events.html#allegro_event_type"
  >ALLEGRO_EVENT_TYPE</a
  >.</p
><h1 id="al_create_event_queue"
><a href="#TOC"
  >al_create_event_queue</a
  ></h1
><pre
><code
  >ALLEGRO_EVENT_QUEUE *al_create_event_queue(void)
</code
  ></pre
><p
>Create a new, empty event queue, returning a pointer to object if successful. Returns NULL on error.</p
><p
>See also: <a href="events.html#al_register_event_source"
  >al_register_event_source</a
  >, <a href="events.html#al_destroy_event_queue"
  >al_destroy_event_queue</a
  >, <a href="events.html#allegro_event_queue"
  >ALLEGRO_EVENT_QUEUE</a
  ></p
><h1 id="al_destroy_event_queue"
><a href="#TOC"
  >al_destroy_event_queue</a
  ></h1
><pre
><code
  >void al_destroy_event_queue(ALLEGRO_EVENT_QUEUE *queue)
</code
  ></pre
><p
>Destroy the event queue specified. All event sources currently registered with the queue will be automatically unregistered before the queue is destroyed.</p
><p
>See also: <a href="events.html#al_create_event_queue"
  >al_create_event_queue</a
  >, <a href="events.html#allegro_event_queue"
  >ALLEGRO_EVENT_QUEUE</a
  ></p
><h1 id="al_register_event_source"
><a href="#TOC"
  >al_register_event_source</a
  ></h1
><pre
><code
  >void al_register_event_source(ALLEGRO_EVENT_QUEUE *queue,
   ALLEGRO_EVENT_SOURCE *source)
</code
  ></pre
><p
>Register the event source with the event queue specified. An event source may be registered with any number of event queues simultaneously, or none. Trying to register an event source with the same event queue more than once does nothing.</p
><p
>See also: <a href="events.html#al_unregister_event_source"
  >al_unregister_event_source</a
  >, <a href="events.html#allegro_event_source"
  >ALLEGRO_EVENT_SOURCE</a
  ></p
><h1 id="al_unregister_event_source"
><a href="#TOC"
  >al_unregister_event_source</a
  ></h1
><pre
><code
  >void al_unregister_event_source(ALLEGRO_EVENT_QUEUE *queue,
   ALLEGRO_EVENT_SOURCE *source)
</code
  ></pre
><p
>Unregister an event source with an event queue. If the event source is not actually registered with the event queue, nothing happens.</p
><p
>If the queue had any events in it which originated from the event source, they will no longer be in the queue after this call.</p
><p
>See also: <a href="events.html#al_register_event_source"
  >al_register_event_source</a
  ></p
><h1 id="al_is_event_queue_empty"
><a href="#TOC"
  >al_is_event_queue_empty</a
  ></h1
><pre
><code
  >bool al_is_event_queue_empty(ALLEGRO_EVENT_QUEUE *queue)
</code
  ></pre
><p
>Return true if the event queue specified is currently empty.</p
><p
>See also: <a href="events.html#al_get_next_event"
  >al_get_next_event</a
  >, <a href="events.html#al_peek_next_event"
  >al_peek_next_event</a
  ></p
><h1 id="al_get_next_event"
><a href="#TOC"
  >al_get_next_event</a
  ></h1
><pre
><code
  >bool al_get_next_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)
</code
  ></pre
><p
>Take the next event out of the event queue specified, and copy the contents into <code
  >ret_event</code
  >, returning true. The original event will be removed from the queue. If the event queue is empty, return false and the contents of <code
  >ret_event</code
  > are unspecified.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#al_peek_next_event"
  >al_peek_next_event</a
  >, <a href="events.html#al_wait_for_event"
  >al_wait_for_event</a
  ></p
><h1 id="al_peek_next_event"
><a href="#TOC"
  >al_peek_next_event</a
  ></h1
><pre
><code
  >bool al_peek_next_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)
</code
  ></pre
><p
>Copy the contents of the next event in the event queue specified into <code
  >ret_event</code
  > and return true. The original event packet will remain at the head of the queue. If the event queue is actually empty, this function returns false and the contents of <code
  >ret_event</code
  > are unspecified.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#al_get_next_event"
  >al_get_next_event</a
  >, <a href="events.html#al_drop_next_event"
  >al_drop_next_event</a
  ></p
><h1 id="al_drop_next_event"
><a href="#TOC"
  >al_drop_next_event</a
  ></h1
><pre
><code
  >bool al_drop_next_event(ALLEGRO_EVENT_QUEUE *queue)
</code
  ></pre
><p
>Drop (remove) the next event from the queue. If the queue is empty, nothing happens. Returns true if an event was dropped.</p
><p
>See also: <a href="events.html#al_flush_event_queue"
  >al_flush_event_queue</a
  >, <a href="events.html#al_is_event_queue_empty"
  >al_is_event_queue_empty</a
  ></p
><h1 id="al_flush_event_queue"
><a href="#TOC"
  >al_flush_event_queue</a
  ></h1
><pre
><code
  >void al_flush_event_queue(ALLEGRO_EVENT_QUEUE *queue)
</code
  ></pre
><p
>Drops all events, if any, from the queue.</p
><p
>See also: <a href="events.html#al_drop_next_event"
  >al_drop_next_event</a
  >, <a href="events.html#al_is_event_queue_empty"
  >al_is_event_queue_empty</a
  ></p
><h1 id="al_wait_for_event"
><a href="#TOC"
  >al_wait_for_event</a
  ></h1
><pre
><code
  >void al_wait_for_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)
</code
  ></pre
><p
>Wait until the event queue specified is non-empty. If <code
  >ret_event</code
  > is not NULL, the first event in the queue will be copied into <code
  >ret_event</code
  > and removed from the queue. If <code
  >ret_event</code
  > is NULL the first event is left at the head of the queue.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#al_wait_for_event_timed"
  >al_wait_for_event_timed</a
  >, <a href="events.html#al_wait_for_event_until"
  >al_wait_for_event_until</a
  >, <a href="events.html#al_get_next_event"
  >al_get_next_event</a
  ></p
><h1 id="al_wait_for_event_timed"
><a href="#TOC"
  >al_wait_for_event_timed</a
  ></h1
><pre
><code
  >bool al_wait_for_event_timed(ALLEGRO_EVENT_QUEUE *queue,
   ALLEGRO_EVENT *ret_event, float secs)
</code
  ></pre
><p
>Wait until the event queue specified is non-empty. If <code
  >ret_event</code
  > is not NULL, the first event in the queue will be copied into <code
  >ret_event</code
  > and removed from the queue. If <code
  >ret_event</code
  > is NULL the first event is left at the head of the queue.</p
><p
><code
  >timeout_msecs</code
  > determines approximately how many seconds to wait. If the call times out, false is returned. Otherwise true is returned.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="events.html#al_wait_for_event"
  >al_wait_for_event</a
  >, <a href="events.html#al_wait_for_event_until"
  >al_wait_for_event_until</a
  ></p
><h1 id="al_wait_for_event_until"
><a href="#TOC"
  >al_wait_for_event_until</a
  ></h1
><pre
><code
  >bool al_wait_for_event_until(ALLEGRO_EVENT_QUEUE *queue,
   ALLEGRO_EVENT *ret_event, ALLEGRO_TIMEOUT *timeout)
</code
  ></pre
><p
>Wait until the event queue specified is non-empty. If <code
  >ret_event</code
  > is not NULL, the first event in the queue will be copied into <code
  >ret_event</code
  > and removed from the queue. If <code
  >ret_event</code
  > is NULL the first event is left at the head of the queue.</p
><p
><code
  >timeout</code
  > determines how long to wait. If the call times out, false is returned. Otherwise true is returned.</p
><p
>See also: <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  >, <a href="time.html#allegro_timeout"
  >ALLEGRO_TIMEOUT</a
  >, <a href="time.html#al_init_timeout"
  >al_init_timeout</a
  >, <a href="events.html#al_wait_for_event"
  >al_wait_for_event</a
  >, <a href="events.html#al_wait_for_event_timed"
  >al_wait_for_event_timed</a
  ></p
><h1 id="al_init_user_event_source"
><a href="#TOC"
  >al_init_user_event_source</a
  ></h1
><pre
><code
  >void al_init_user_event_source(ALLEGRO_EVENT_SOURCE *src)
</code
  ></pre
><p
>Initialise an event source for emitting user events. The space for the event source must already have been allocated.</p
><p
>One possible way of creating custom event sources is to derive other structures with ALLEGRO_EVENT_SOURCE at the head, e.g.</p
><pre
><code
  >typedef struct THING THING;

struct THING {
    ALLEGRO_EVENT_SOURCE event_source;
    int field1;
    int field2;
    /* etc. */
};

THING *create_thing(void)
{
    THING *thing = malloc(sizeof(THING));

    if (thing) {
        al_init_user_event_source(&amp;thing-&gt;event_source);
        thing-&gt;field1 = 0;
        thing-&gt;field2 = 0;
    }

    return thing;
}
</code
  ></pre
><p
>The advantage here is that the THING pointer will be the same as the ALLEGRO_EVENT_SOURCE pointer. Events emitted by the event source will have the event source pointer as the <code
  >source</code
  > field, from which you can get a pointer to a THING by a simple cast (after ensuring checking the event is of the correct type).</p
><p
>However, it is only one technique and you are not obliged to use it.</p
><p
>The user event source will never be destroyed automatically. You must destroy it manually with <a href="events.html#al_destroy_user_event_source"
  >al_destroy_user_event_source</a
  >.</p
><p
>See also: <a href="events.html#allegro_event_source"
  >ALLEGRO_EVENT_SOURCE</a
  >, <a href="events.html#al_emit_user_event"
  >al_emit_user_event</a
  >, <a href="events.html#al_destroy_user_event_source"
  >al_destroy_user_event_source</a
  ></p
><h1 id="al_destroy_user_event_source"
><a href="#TOC"
  >al_destroy_user_event_source</a
  ></h1
><pre
><code
  >void al_destroy_user_event_source(ALLEGRO_EVENT_SOURCE *src)
</code
  ></pre
><p
>Destroy an event source initialised with <a href="events.html#al_init_user_event_source"
  >al_init_user_event_source</a
  >.</p
><p
>This does not free the memory, as that was user allocated to begin with.</p
><p
>See also: <a href="events.html#allegro_event_source"
  >ALLEGRO_EVENT_SOURCE</a
  ></p
><h1 id="al_emit_user_event"
><a href="#TOC"
  >al_emit_user_event</a
  ></h1
><pre
><code
  >bool al_emit_user_event(ALLEGRO_EVENT_SOURCE *src,
   ALLEGRO_EVENT *event, void (*dtor)(ALLEGRO_USER_EVENT *))
</code
  ></pre
><p
>Emit a user event. The event source must have been initialised with <a href="events.html#al_init_user_event_source"
  >al_init_user_event_source</a
  >. Returns <code
  >false</code
  > if the event source isn't registered with any queues, hence the event wouldn't have been delivered into any queues.</p
><p
>Events are <em
  >copied</em
  > in and out of event queues, so after this function returns the memory pointed to by <code
  >event</code
  > may be freed or reused. Some fields of the event being passed in may be modified by the function.</p
><p
>Reference counting will be performed if <code
  >dtor</code
  > is not NULL. Whenever a copy of the event is made, the reference count increases. You need to call <a href="events.html#al_unref_user_event"
  >al_unref_user_event</a
  > to decrease the reference count once you are done a user event that you have received from <a href="events.html#al_get_next_event"
  >al_get_next_event</a
  >, <a href="events.html#al_peek_next_event"
  >al_peek_next_event</a
  >, <a href="events.html#al_wait_for_event"
  >al_wait_for_event</a
  >, etc.</p
><p
>Once the reference count drops to zero <code
  >dtor</code
  > will be called with a copy of the event as an argument. It should free the resources associated with the event, but <em
  >not</em
  > the event itself (since it is just a copy).</p
><p
>If <code
  >dtor</code
  > is NULL then reference counting will not be performed. It is safe, but unnecessary, to call <a href="events.html#al_unref_user_event"
  >al_unref_user_event</a
  > on non-reference counted user events.</p
><p
>See also: <a href="events.html#allegro_user_event"
  >ALLEGRO_USER_EVENT</a
  >, <a href="events.html#al_unref_user_event"
  >al_unref_user_event</a
  ></p
><h1 id="al_unref_user_event"
><a href="#TOC"
  >al_unref_user_event</a
  ></h1
><pre
><code
  >void al_unref_user_event(ALLEGRO_USER_EVENT *event)
</code
  ></pre
><p
>Decrease the reference count of a user-defined event. This must be called on any user event that you get from <a href="events.html#al_get_next_event"
  >al_get_next_event</a
  >, <a href="events.html#al_peek_next_event"
  >al_peek_next_event</a
  >, <a href="events.html#al_wait_for_event"
  >al_wait_for_event</a
  >, etc. which is reference counted. This function does nothing if the event is not reference counted.</p
><p
>See also: <a href="events.html#al_emit_user_event"
  >al_emit_user_event</a
  ></p
><h1 id="al_get_event_source_data"
><a href="#TOC"
  >al_get_event_source_data</a
  ></h1
><pre
><code
  >intptr_t al_get_event_source_data(const ALLEGRO_EVENT_SOURCE *source)
</code
  ></pre
><p
>Returns the abstract user data associated with the event source. If no data was previously set, returns NULL.</p
><p
>See also: <a href="events.html#al_set_event_source_data"
  >al_set_event_source_data</a
  ></p
><h1 id="al_set_event_source_data"
><a href="#TOC"
  >al_set_event_source_data</a
  ></h1
><pre
><code
  >void al_set_event_source_data(ALLEGRO_EVENT_SOURCE *source, intptr_t data)
</code
  ></pre
><p
>Assign the abstract user data to the event source. Allegro does not use the data internally for anything; it is simply meant as a convenient way to associate your own data or objects with events.</p
><p
>See also: <a href="events.html#al_get_event_source_data"
  >al_get_event_source_data</a
  ></p
>
<p class="timestamp">
Allegro version 5.0.3
 - Last updated: 2011-05-22 02:32:04 UTC
</p>
</div>

</body>
</html>