[ prev :: next :: up ] libgii-current (3)

LibGII event structures

Name

gii_event, gii_any_event, gii_event_type, gii_event_mask : LibGII event structures

Synopsis

#include <ggi/events.h>

typedef union gii_event {

    uint8                   size;

    gii_any_event           any;
    gii_cmd_event           cmd;
    gii_expose_event        expose;
    gii_val_event           val;
    gii_key_event           key;
    gii_pmove_event         pmove;
    gii_pbutton_event       pbutton;
} gii_event;

#define COMMON_DATA  \
uint8   size;           /* size of event in bytes       */\
uint8   type;           /* type of this event           */\
sint16  error;          /* error (for replies)          */\
uint32  origin;         /* origin device (etc)          */\
uint32  target;         /* target device (etc)          */\
struct  timeval time     /* timestamp                    */

typedef struct {

    COMMON_DATA;

} gii_any_event;

Description

Events are of type gii_event. It is an union of all of the structures for each specific type of event.

Structure Members

All of the event structures contains housekeeping information at the beginning, as defined by COMMON_DATA.

Thus, by analyzing the contents of any.type, you can determine what the given event is, and select the appropriate member of the gii_event union to access to get at the event

The comon fields found in any event structure are:

size
Specifies the size of the given event (in bytes).
type
An enumeration of the possible types of LibGII events (see next section).
error
Mainly there to round things up to a 32-bit boundary, but could be used to signal an error in a send-reply sequence.
origin
A device handle: it distinguishes one input device from another. Other than that there's no real meaning to the number.
target

Also a device handle, but for distinguishes input devices when sending events to an input device via giiEventSend(3).

time

Indicates when the event in question has been generated. See gettimeofday(2) for more info on the timeval structure.

Event types

The different types of events are defined as an enumeration of type gii_event_type. The possible values are:

Event masks

gii_event_mask is passed to various event handling functions to indicate which types of events the program is interested in. The list below sums the available event masks:

See Also

gii_key_event(3), gii_pmove_event(3), gii_pbutton_event(3), gii_cmd_event(3), gii_val_event(3), gii_expose_event(3)

 
[ prev :: next :: up ] libgii-current (3)
2004/03/10 22:44:01