10.1 Event Types

An event is data generated asynchronously by the X server as a result of some device activity or as side effects of a request sent by an Xlib function. Device-related events propagate from the source window to ancestor windows until some client application has selected that event type or until the event is explicitly discarded. The X server generally sends an event to a client application only if the client has specifically asked to be informed of that event type, typically by setting the event-mask attribute of the window. The mask can also be set when you create a window or by changing the window's event-mask. You can also mask out events that would propagate to ancestor windows by manipulating the do-not-propagate mask of the window's attributes. However, MappingNotify events are always sent to all clients.

An event type describes a specific event generated by the X server. For each event type, a corresponding constant name is defined in X11/X.h, which is used when referring to an event type. The following table lists the event category and its associated event type or types. The processing associated with these events is discussed in section "Event Processing Overview".


Event Category Event Type

Keyboard events KeyPress, KeyRelease
Pointer events ButtonPress, ButtonRelease, MotionNotify
Window crossing events EnterNotify, LeaveNotify
Input focus events FocusIn, FocusOut
Keymap state notification event KeymapNotify
Exposure events Expose, GraphicsExpose, NoExpose
Structure control events CirculateRequest, ConfigureRequest, MapRequest, ResizeRequest
Window state notification events CirculateNotify, ConfigureNotify, CreateNotify, DestroyNotify, GravityNotify, MapNotify, MappingNotify, ReparentNotify, UnmapNotify, VisibilityNotify
Colormap state notification event ColormapNotify
Client communication events ClientMessage, PropertyNotify, SelectionClear, SelectionNotify, SelectionRequest

Next: Event Structures

Christophe Tronche, [email protected]