[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2 Selecting Events

To avoid flooding the clients with events in which they have no interest, they must explicitly tell the server which events they are interested in. This is done by providing the event_mask attribute when creating windows with Window.create_window or in calls to Window.change_attributes. The value of this attribute is a mask of all types of events the client is interested in on that particular window. Whenever the server generates an event for a window which matches the clients event mask on that window, the event will be sent to the client.

The following table lists all event masks and the corresponding event types and classes. All event masks and types are integer constants defined in the module Xlib.X. Classes have the same name as the event type, and are defined in Xlib.protocol.event.

MaskType and ClassGenerated when
ButtonMotionMask
Button1MotionMask
Button2MotionMask
Button3MotionMask
Button4MotionMask
Button5MotionMask
MotionNotifyPointer moved with any or a certain button down
ButtonPressMaskButtonPressPointer button pressed
ButtonReleaseMaskButtonReleasePointer button released
ColormapChangeMaskColormapNotifyColormap changed or installed
EnterWindowMaskEnterNotifyPointer enters window
LeaveWindowMaskLeaveNotifyPointer leaves window
ExposureMaskExpose
NoExpose
Window needs to be redrawn
FocusChangeMaskFocusIn
FocusOut
Focus changes
KeymapStateMaskKeymapNotifyAfter EnterNotify and FocusIn
KeyPressMaskKeyPressKey is pressed
KeyReleaseMaskReleasePressKey is released
PointerMotionMaskMotionNotifyPointer is moved
PropertyChangeMaskPropertyNotifyWindow properties change
StructureNotifyMaskCirculateNotify
ConfigureNotify
DestroyNotify
GravityNotify
MapNotify
ReparentNotify
UnmapNotify
Window structure changes
SubstructureNotifyMaskCirculateNotify
ConfigureNotify
CreateNotify
DestroyNotify
GravityNotify
MapNotify
ReparentNotify
UnmapNotify
Child window structure changes
ResizeRedirectMaskResizeRequestControlling window size change
SubstructureRedirectMaskCirculateRequest
ConfigureRequest
MapRequest
Controlling changes to child windows
VisibilityChangeMaskVisibilityNotifyWindow is obscured or visible

There are also some event types which are always sent to the clients, regardless of any event masks:

Type and ClassCut’n’pasting between windows
ClientMessageOther client sends message
MappingMotifyKeyboard mapping changes
SelectionClear
SelectionNotify
SelectionRequest
Cut’n’pasting between windows

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on September 16, 2020 using texi2html 5.0.