Name
ggiJoinInputs, ggiEventPoll, ggiEventSelect, ggiEventsQueued, ggiEventRead, ggiSetEventMask, ggiGetEventMask, ggiAddEventMask, ggiRemoveEventMask — Event management for LibGGI visual
Synopsis
#include <ggi/ggi.h>
gii_input_t ggiJoinInputs( | vis, | |
| inp) ; | |
ggi_visual_t | vis; |
gii_input_t | inp; |
gii_event_mask ggiEventPoll( | vis, | |
| mask, | |
| t) ; | |
ggi_visual_t | vis; |
gii_event_mask | mask; |
struct timeval * | t; |
int giiEventSelect( | vis, | |
| mask, | |
| n, | |
| readfds, | |
| writefds, | |
| exceptfds, | |
| timeout) ; | |
ggi_visual_t | vis; |
gii_event_mask * | mask; |
int | n; |
fd_set * | readfds; |
fd_set * | writefds; |
fd_set * | exceptfds; |
struct timeval * | timeout; |
int ggiEventsQueued( | vis, | |
| mask) ; | |
ggi_visual_t | vis; |
gii_event_mask | mask; |
int ggiEventRead( | vis, | |
| ev, | |
| mask) ; | |
ggi_visual_t | vis; |
gii_event * | ev; |
gii_event_mask | mask; |
int ggiSetEventMask( | vis, | |
| evm) ; | |
ggi_visual_t | vis; |
gii_event_mask | evm; |
gii_event_mask ggiGetEventMask( | vis) ; | |
int ggiAddEventMask( | vis, | |
| mask) ; | |
ggi_visual_t | vis; |
gii_event_mask | mask; |
int giiRemoveEventMask( | vis, | |
| mask) ; | |
ggi_visual_t | vis; |
gii_event_mask | mask; |
Description
LibGGI provides input facilities through an auxiliary library,
LibGII. Each LibGGI visual internally
contains a gii_input_t input, and all LibGII functions
are available to manipulate and process inputs. The LibGGI versions
provided of most LibGII functions simply take a
ggi_visual_t rather than gii_input_t for
convenience during everyday usage. Events are LibGII types. All
other semantics are the same; see libgii(7) for
details.
Important
By default LibGGI visuals autodetect and open the
appropriate inputs, including mouse and keyboard and any other inputs
that are 'intrinsic' to the visual e.g. any registered X11 input
device under the X target. Thus in the usual cases there is no need
to open a LibGII gii_input_t directly (and that may in
fact fail because an input device is already open). The LibGGI
ggiEvent* functions must be
used to do event handling with LibGGI visuals, and provide adequate
support for most everyday, single-visual usage.
Advanced management of input sources is accomplished by detaching the
input from the visual and using LibGII functions on the separate
visual handle (see ggiDetachInput). This is encouraged,
for example, when joining inputs from multiple visuals, because when
two visuals share the same joined input, you cannot ggiClose both of
the visuals (a fatal error will result, because closing the first
visual closes both of the joined inputs and leaves the second closed
visual with a stale input handle.)