caca_event Struct Reference

User events. More...


Public Types

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
}

Data Fields

enum caca_event::caca_event_type type
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   ucs4
      char   utf8 [8]
   }   key
data


Detailed Description

This structure is filled by caca_get_event() when an event is received. The type field is always valid. The validity of the data union depends on the value of the type field:

The result of accessing data members outside the above conditions is undefined.


Member Enumeration Documentation

enum caca_event::caca_event_type
 

Enumerator:
CACA_EVENT_NONE  No event.
CACA_EVENT_KEY_PRESS  A key was pressed.
CACA_EVENT_KEY_RELEASE  A key was released.
CACA_EVENT_MOUSE_PRESS  A mouse button was pressed.
CACA_EVENT_MOUSE_RELEASE  A mouse button was released.
CACA_EVENT_MOUSE_MOTION  The mouse was moved.
CACA_EVENT_RESIZE  The window was resized.
CACA_EVENT_QUIT  The user requested to quit.
CACA_EVENT_ANY  Bitmask for any event.