Public Types | |
| CACA_EVENT_NONE = 0x0000 | |
| CACA_EVENT_KEY_PRESS = 0x0001 | |
| CACA_EVENT_KEY_RELEASE = 0x0002 | |
| CACA_EVENT_MOUSE_PRESS = 0x0004 | |
| CACA_EVENT_MOUSE_RELEASE = 0x0008 | |
| CACA_EVENT_MOUSE_MOTION = 0x0010 | |
| CACA_EVENT_RESIZE = 0x0020 | |
| CACA_EVENT_QUIT = 0x0040 | |
| CACA_EVENT_ANY = 0xffff | |
| enum | caca_event_type { CACA_EVENT_NONE = 0x0000, CACA_EVENT_KEY_PRESS = 0x0001, CACA_EVENT_KEY_RELEASE = 0x0002, CACA_EVENT_MOUSE_PRESS = 0x0004, CACA_EVENT_MOUSE_RELEASE = 0x0008, CACA_EVENT_MOUSE_MOTION = 0x0010, CACA_EVENT_RESIZE = 0x0020, CACA_EVENT_QUIT = 0x0040, CACA_EVENT_ANY = 0xffff } |
| User event type enumeration. More... | |
Data Fields | |
| enum caca_event::caca_event_type | type |
| User event type enumeration.User event type member. | |
| union { | |
| struct { | |
| unsigned int x | |
| unsigned int y | |
| unsigned int button | |
| } mouse | |
| struct { | |
| unsigned int w | |
| unsigned int h | |
| } resize | |
| struct { | |
| unsigned int ch | |
| unsigned long int utf32 | |
| char utf8 [8] | |
| } key | |
| } | data |
| User event data member. | |
This enum serves two purposes:
This field is always valid when caca_get_event() returns.
| union { ... } caca_event::data |
The validity of the data union depends on the value of the type field:
CACA_EVENT_NONE: no field is valid.CACA_EVENT_KEY_PRESS, CACA_EVENT_KEY_RELEASE: the data.key.ch field is valid and contains either the ASCII value for the key, or an enum caca_key value. If the value is a printable ASCII character, the data.key.utf32 and data.key.utf8 fields are also filled and contain respectively the UTF-32/UCS-4 and the UTF-8 representations of the character. Otherwise, their content is undefined.CACA_EVENT_MOUSE_PRESS, CACA_EVENT_MOUSE_RELEASE: the data.mouse.button field is valid and contains the index of the mouse button that was pressed.CACA_EVENT_MOUSE_MOTION: the data.mouse.x and data.mouse.y fields are valid and contain the mouse coordinates in character cells.CACA_EVENT_RESIZE: the data.resize.w and data.resize.h fields are valid and contain the new width and height values of the libcucul canvas attached to libcaca.CACA_EVENT_QUIT: no other field is valid.The result of accessing data members outside the above conditions is undefined.