Ignore:
Timestamp:
Mar 24, 2006, 3:17:40 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Documented the caca_event structure and improved a few things here and there in the documentation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r681 r685  
    110110#endif
    111111
    112 /** \brief User events.
     112/** \brief User event types.
    113113 *
    114114 *  Event types returned by caca_get_event().
     
    128128};
    129129
     130/** \brief User events.
     131 *
     132 *  This structure is filled by caca_get_event() when an event is received.
     133 *  The \e type field is always valid. The validity of the \e data union
     134 *  depends on the value of the \e type field:
     135 *
     136 *  \li \b CACA_EVENT_NONE: no other field is valid.
     137 *
     138 *  \li \b CACA_EVENT_KEY_PRESS, \b CACA_EVENT_KEY_RELEASE: the \e data.key.c
     139 *      field is valid and contains either the ASCII value for the key, or
     140 *      an \e enum \e caca_key value. If the value is a printable ASCII
     141 *      character, the \e data.key.ucs4 and \e data.key.utf8 fields are
     142 *      also filled and contain respectively the UCS-4/UTF-32 and the UTF-8
     143 *      representations of the character. Otherwise, their content is
     144 *      undefined.
     145 *
     146 *  \li \b CACA_EVENT_MOUSE_PRESS, \b CACA_EVENT_MOUSE_RELEASE: the
     147 *      \e data.mouse.button field is valid and contains the index of the
     148 *      mouse button that was pressed.
     149 *
     150 *  \li \b CACA_EVENT_MOUSE_MOTION: the \e data.mouse.x and \e data.mouse.y
     151 *      fields are valid and contain the mouse coordinates in character
     152 *      cells.
     153 *
     154 *  \li \b CACA_EVENT_RESIZE: the \e data.resize.w and \e data.resize.h
     155 *      fields are valid and contain the new width and height values of
     156 *      the \e libcucul canvas attached to \e libcaca.
     157 *
     158 *  The result of accessing data members outside the above conditions is
     159 *  undefined.
     160 */
    130161struct caca_event
    131162{
     
    146177enum caca_key
    147178{
    148     CACA_KEY_UNKNOWN = 0, /**< Unknown key. */
     179    CACA_KEY_UNKNOWN = 0x00, /**< Unknown key. */
    149180
    150181    /* The following keys have ASCII equivalents */
    151     CACA_KEY_BACKSPACE = 8, /**< The backspace key. */
    152     CACA_KEY_TAB = 9, /**< The tabulation key. */
    153     CACA_KEY_RETURN = 13, /**< The return key. */
    154     CACA_KEY_PAUSE = 19, /**< The pause key. */
    155     CACA_KEY_ESCAPE = 27, /**< The escape key. */
    156     CACA_KEY_DELETE = 127, /**< The delete key. */
     182    CACA_KEY_BACKSPACE = 0x08, /**< The backspace key. */
     183    CACA_KEY_TAB =       0x09, /**< The tabulation key. */
     184    CACA_KEY_RETURN =    0x0d, /**< The return key. */
     185    CACA_KEY_PAUSE =     0x13, /**< The pause key. */
     186    CACA_KEY_ESCAPE =    0x1b, /**< The escape key. */
     187    CACA_KEY_DELETE =    0x7f, /**< The delete key. */
    157188
    158189    /* The following keys do not have ASCII equivalents but have been
    159190     * chosen to match the SDL equivalents */
    160     CACA_KEY_UP = 273, /**< The up arrow key. */
    161     CACA_KEY_DOWN = 274, /**< The down arrow key. */
    162     CACA_KEY_LEFT = 275, /**< The left arrow key. */
    163     CACA_KEY_RIGHT = 276, /**< The right arrow key. */
    164 
    165     CACA_KEY_INSERT = 277, /**< The insert key. */
    166     CACA_KEY_HOME = 278, /**< The home key. */
    167     CACA_KEY_END = 279, /**< The end key. */
    168     CACA_KEY_PAGEUP = 280, /**< The page up key. */
    169     CACA_KEY_PAGEDOWN = 281, /**< The page down key. */
    170 
    171     CACA_KEY_F1 = 282, /**< The F1 key. */
    172     CACA_KEY_F2 = 283, /**< The F2 key. */
    173     CACA_KEY_F3 = 284, /**< The F3 key. */
    174     CACA_KEY_F4 = 285, /**< The F4 key. */
    175     CACA_KEY_F5 = 286, /**< The F5 key. */
    176     CACA_KEY_F6 = 287, /**< The F6 key. */
    177     CACA_KEY_F7 = 288, /**< The F7 key. */
    178     CACA_KEY_F8 = 289, /**< The F8 key. */
    179     CACA_KEY_F9 = 290, /**< The F9 key. */
    180     CACA_KEY_F10 = 291, /**< The F10 key. */
    181     CACA_KEY_F11 = 292, /**< The F11 key. */
    182     CACA_KEY_F12 = 293, /**< The F12 key. */
    183     CACA_KEY_F13 = 294, /**< The F13 key. */
    184     CACA_KEY_F14 = 295, /**< The F14 key. */
    185     CACA_KEY_F15 = 296 /**< The F15 key. */
     191    CACA_KEY_UP =    0x111, /**< The up arrow key. */
     192    CACA_KEY_DOWN =  0x112, /**< The down arrow key. */
     193    CACA_KEY_LEFT =  0x113, /**< The left arrow key. */
     194    CACA_KEY_RIGHT = 0x114, /**< The right arrow key. */
     195
     196    CACA_KEY_INSERT =   0x115, /**< The insert key. */
     197    CACA_KEY_HOME =     0x116, /**< The home key. */
     198    CACA_KEY_END =      0x117, /**< The end key. */
     199    CACA_KEY_PAGEUP =   0x118, /**< The page up key. */
     200    CACA_KEY_PAGEDOWN = 0x119, /**< The page down key. */
     201
     202    CACA_KEY_F1 =  0x11a, /**< The F1 key. */
     203    CACA_KEY_F2 =  0x11b, /**< The F2 key. */
     204    CACA_KEY_F3 =  0x11c, /**< The F3 key. */
     205    CACA_KEY_F4 =  0x11d, /**< The F4 key. */
     206    CACA_KEY_F5 =  0x11e, /**< The F5 key. */
     207    CACA_KEY_F6 =  0x11f, /**< The F6 key. */
     208    CACA_KEY_F7 =  0x120, /**< The F7 key. */
     209    CACA_KEY_F8 =  0x121, /**< The F8 key. */
     210    CACA_KEY_F9 =  0x122, /**< The F9 key. */
     211    CACA_KEY_F10 = 0x123, /**< The F10 key. */
     212    CACA_KEY_F11 = 0x124, /**< The F11 key. */
     213    CACA_KEY_F12 = 0x125, /**< The F12 key. */
     214    CACA_KEY_F13 = 0x126, /**< The F13 key. */
     215    CACA_KEY_F14 = 0x127, /**< The F14 key. */
     216    CACA_KEY_F15 = 0x128 /**< The F15 key. */
    186217};
    187218
     
    190221/** \defgroup basic Basic functions
    191222 *
    192  *  These functions provide the basic \e libcaca routines for library
     223 *  These functions provide the basic \e libcaca routines for driver
    193224 *  initialisation, system information retrieval and configuration.
    194225 *
Note: See TracChangeset for help on using the changeset viewer.