XSelectAsyncInput(3X) — Subroutines
Digital
NAME
XSelectAsyncInput − Specifies an action routine and arguments to be called when some subset of events occurs.
SYNOPSIS
XSelectAsyncInput (display, window_id, event_mask,
ast_routine, ast_userarg)
Display ∗display;
Window window_id;
unsigned long event_mask;
int (∗ast_routine)();
unsigned long ast_userarg;
DESCRIPTION
Before calling XSelectInput to specify interest in a particular set of events for a window, clients can call XSelectAsyncInput to specify action routines and arguments to be called when some subset of those events occurs. Xlib uses the client’s ast_routine and ast_userarg information to deliver an asynchronous event whenever it places one of the specified events on its event queue. The ast_routine and ast_userarg arguments allow the client to specify the particular action routine and parameter pair to use when notifying the client that one of the specified events has occurred. The asynchronous event acts only as an event notification mechanism; the application uses the standard Xlib event routines to actually retrieve and process the event from the event queue. Clients can call XSelectAsyncInput multiple times to specify different routine and parameter pairs for different sets of events for a window. The last call always takes precedence. If called with ast_routine equal to zero, asynchronous notification is disabled, but the current selection for the specified events is unaffected. Notification events are queued in the same order as events are placed in the event queue by Xlib. Therefore, clients can assume that they receive notification events in the same order that they find events in the queue. XSelectAsyncInput is similar to XSelectAsyncEvent except that XSelectAsyncEvent specifies one event type and XSelectAsyncInput specifies an event mask.
Arguments
displayThe display information originally returned by XOpenDisplay.
window_idThe identifier of the window for which you want to select asynchronous input.
event_mask
A bitmask that specifies the event types for which you want to remove an event. The mask is an inclusive OR of one or more of the event mask elements described in <REFERENCE>(event_mask_tab71).
ast_routine
The particular action routine to use when notifying the client that one of the specified events has occurred.
ast_userarg
The user-specified parameter to use when notifying the client that one of the specified events has occurred.
| Bit | MIT C Value | Description |
| 1 | KeyPressMask | Keyboard down events wanted (by the application) |
| 2 | KeyReleaseMask | Keyboard up events wanted (by the application) |
| 3 | ButtonPressMask | Pointer button down events wanted (by the application) |
| 4 | ButtonReleaseMask | Pointer button up events wanted (by the application) |
| 5 | EnterWindowMask | Pointerwindow entry events wanted (by the application) |
| 6 | LeaveWindowMask | Pointerwindow leave events wanted (by the application) |
| 7 | PointerMotionMask | Pointer motion events wanted (by the application) |
| 8 | PointerMotionHintMask | Pointer motion hints wanted (by the application) |
| 9 | Button1MotionMask | Pointer motion while button 1 down |
| 10 | Button2MotionMask | Pointer motion while button 2 down |
| 11 | Button3MotionMask | Pointer motion while button 3 down |
| 12 | Button4MotionMask | Pointer motion while button 4 down |
| 13 | Button5MotionMask | Pointer motion while button 5 down |
| 14 | ButtonMotionMask | Pointer motion while any button down |
| 15 | KeymapStateMask | Keyboard state wanted (by the application) at window entry and focus in |
| 16 | ExposureMask | Any exposure wanted (by the application) |
| 17 | VisibilityChangeMask | Any change in visibility wanted (by the application) |
| 18 | StructureNotifyMask | Any change in window structure wanted (by the application) |
| 19 | ResizeRedirectMask | Redirect resize of this window |
| 20 | SubstructureNotifyMask | Substructure notification wanted (by the application) |
| 21 | SubstructureRedirectMask | Redirect substructure of window |
| 22 | FocusChangeMask | Any change in input focus wanted (by the application) |
| 23 | PropertyChangeMask | Any change in property wanted (by the application) |
| 24 | ColormapChangeMask | Any change in color map wanted by the application |
| 25 | OwnerGrabButtonMask | Automatic grabs should activate with owner_events set to true |