12.1 Introductions

A client application uses CLX functions to send requests to an X server over a display connection returned by the open-display function. In return, the X server sends back replies and events. Replies are synchronized with specific requests and return requested server information. Events typically occur asynchronously. Device events are generated by user input from both the keyboard and pointer devices. Other events are side-effects of the requests sent by CLX functions. The types of events returned by an X server are summarized below.

Device Events Events Returned
Keyboard :key-press
Pointer :button-press
Side-Effect Events Events Returned
Client communication :client-message
Color map state :colormap-notify
Exposure :exposure
Input focus :focus-in
Keyboard and pointer state :keymap-notify
Structure control :circulate-request
Window state :resize-request

Client programs can override the server's normal distribution of events bygrabbing the pointer or the keyboard. Grabbing causes events from the pointer or keyboard device to be reported to a single specified window, rather than to their ordinary destinations. It can also cause the server to freeze the grabbed device, sending queued events only when explicitly requested by the grabbing client. Two kinds of grabs are possible:

Grabbing an input device is performed rarely and usually only by special clients, such as window managers.

This section describes the CLX functions used to:

This section also contains a detailed description of the content of each type of event.