10.4 Event Processing Overview

The event reported to a client application during event processing depends on which event masks you provide as the event-mask attribute for a window. For some event masks, there is a one-to-one correspondence between the event mask constant and the event type constant. For example, if you pass the event mask ButtonPressMask, the X server sends back only ButtonPress events. Most events contain a time member, which is the time at which an event occurred.

In other cases, one event mask constant can map to several event type constants. For example, if you pass the event mask SubstructureNotifyMask, the X server can send back CirculateNotify, ConfigureNotify, CreateNotify, DestroyNotify, GravityNotify, MapNotify, ReparentNotify, or UnmapNotify events.

In another case, two event masks can map to one event type. For example, if you pass either PointerMotionMask or ButtonMotionMask, the X server sends back a MotionNotify event.

The following table lists the event mask, its associated event type or types, and the structure name associated with the event type. Some of these structures actually are typedefs to a generic structure that is shared between two event types. Note that N.A. appears in columns for which the information is not applicable.

Event Mask Event Type Structure Generic Structure

ButtonMotionMask MotionNotify XPointerMovedEvent XMotionEvent
ButtonPressMask ButtonPress XButtonPressedEvent XButtonEvent
ButtonReleaseMask ButtonRelease XButtonReleasedEvent XButtonEvent
ColormapChangeMask ColormapNotify XColormapEvent
EnterWindowMask EnterNotify XEnterWindowEvent XCrossingEvent
LeaveWindowMask LeaveNotify XLeaveWindowEvent XCrossingEvent
ExposureMask Expose XExposeEvent
GCGraphicsExposures in GC GraphicsExpose XGraphicsExposeEvent
NoExpose XNoExposeEvent
FocusChangeMask FocusIn XFocusInEvent XFocusChangeEvent
FocusOut XFocusOutEvent XFocusChangeEvent
KeymapStateMask KeymapNotify XKeymapEvent
KeyPressMask KeyPress XKeyPressedEvent XKeyEvent
KeyReleaseMask KeyRelease XKeyReleasedEvent XKeyEvent
OwnerGrabButtonMask N.A. N.A.
PointerMotionMask MotionNotify XPointerMovedEvent XMotionEvent
PointerMotionHintMask N.A. N.A.
PropertyChangeMask PropertyNotify XPropertyEvent
ResizeRedirectMask ResizeRequest XResizeRequestEvent
StructureNotifyMask CirculateNotify XCirculateEvent
ConfigureNotify XConfigureEvent
DestroyNotify XDestroyWindowEvent
GravityNotify XGravityEvent
MapNotify XMapEvent
ReparentNotify XReparentEvent
UnmapNotify XUnmapEvent
SubstructureNotifyMask CirculateNotify XCirculateEvent
ConfigureNotify XConfigureEvent
CreateNotify XCreateWindowEvent
DestroyNotify XDestroyWindowEvent
GravityNotify XGravityEvent
MapNotify XMapEvent
ReparentNotify XReparentEvent
UnmapNotify XUnmapEvent
SubstructureRedirectMask CirculateRequest XCirculateRequestEvent
ConfigureRequest XConfigureRequestEvent
MapRequest XMapRequestEvent
N.A. ClientMessage XClientMessageEvent
N.A. MappingNotify XMappingEvent
N.A. SelectionClear XSelectionClearEvent
N.A. SelectionNotify XSelectionEvent
N.A. SelectionRequest XSelectionRequestEvent
VisibilityChangeMask VisibilityNotify XVisibilityEvent

The sections that follow describe the processing that occurs when you select the different event masks. The sections are organized according to these processing categories:

Next: Keyboard and Pointer Events

Christophe Tronche, [email protected]