1XAnyEvent(3) XLIB FUNCTIONS XAnyEvent(3)
2
3
4
6 XAnyEvent, XEvent - generic X event structures
7
9 All the event structures declared in have the following common members:
10 typedef struct {
11 int type;
12 unsigned long serial; /* # of last request processed by server */
13 Bool send_event; /* true if this came from a SendEvent request */
14 Display *display; /* Display the event was read from */
15 Window window;
16 } XAnyEvent;
17
18 The type member is set to the event type constant name that uniquely
19 identifies it. For example, when the X server reports a GraphicsExpose
20 event to a client application, it sends an XGraphicsExposeEvent struc‐
21 ture with the type member set to GraphicsExpose. The display member is
22 set to a pointer to the display the event was read on. The send_event
23 member is set to True if the event came from a SendEvent protocol re‐
24 quest. The serial member is set from the serial number reported in the
25 protocol but expanded from the 16-bit least-significant bits to a full
26 32-bit value. The window member is set to the window that is most use‐
27 ful to toolkit dispatchers.
28
29 The XEvent structure is a union of the individual structures declared
30 for each event type:
31 typedef union _XEvent {
32 int type; /* must not be changed */
33 XAnyEvent xany;
34 XKeyEvent xkey;
35 XButtonEvent xbutton;
36 XMotionEvent xmotion;
37 XCrossingEvent xcrossing;
38 XFocusChangeEvent xfocus;
39 XExposeEvent xexpose;
40 XGraphicsExposeEvent xgraphicsexpose;
41 XNoExposeEvent xnoexpose;
42 XVisibilityEvent xvisibility;
43 XCreateWindowEvent xcreatewindow;
44 XDestroyWindowEvent xdestroywindow;
45 XUnmapEvent xunmap;
46 XMapEvent xmap;
47 XMapRequestEvent xmaprequest;
48 XReparentEvent xreparent;
49 XConfigureEvent xconfigure;
50 XGravityEvent xgravity;
51 XResizeRequestEvent xresizerequest;
52 XConfigureRequestEvent xconfigurerequest;
53 XCirculateEvent xcirculate;
54 XCirculateRequestEvent xcirculaterequest;
55 XPropertyEvent xproperty;
56 XSelectionClearEvent xselectionclear;
57 XSelectionRequestEvent xselectionrequest;
58 XSelectionEvent xselection;
59 XColormapEvent xcolormap;
60 XClientMessageEvent xclient;
61 XMappingEvent xmapping;
62 XErrorEvent xerror;
63 XKeymapEvent xkeymap;
64 long pad[24];
65 } XEvent;
66
67 An XEvent structure's first entry always is the type member, which is
68 set to the event type. The second member always is the serial number
69 of the protocol request that generated the event. The third member al‐
70 ways is send_event, which is a Bool that indicates if the event was
71 sent by a different client. The fourth member always is a display,
72 which is the display that the event was read from. Except for keymap
73 events, the fifth member always is a window, which has been carefully
74 selected to be useful to toolkit dispatchers. To avoid breaking tool‐
75 kits, the order of these first five entries is not to change. Most
76 events also contain a time member, which is the time at which an event
77 occurred. In addition, a pointer to the generic event must be cast be‐
78 fore it is used to access any other information in the structure.
79
81 XButtonEvent(3), XCreateWindowEvent(3), XCirculateEvent(3), XCircu‐
82 lateRequestEvent(3), XColormapEvent(3), XConfigureEvent(3), XConfigur‐
83 eRequestEvent(3), XCrossingEvent(3), XDestroyWindowEvent(3), XEr‐
84 rorEvent(3), XExposeEvent(3), XFocusChangeEvent(3), XGraphicsEx‐
85 poseEvent(3), XGravityEvent(3), XKeymapEvent(3), XMapEvent(3), XMapRe‐
86 questEvent(3), XPropertyEvent(3), XReparentEvent(3), XResiz‐
87 eRequestEvent(3), XSelectionClearEvent(3), XSelectionEvent(3), XSelec‐
88 tionRequestEvent(3), XUnmapEvent(3), XVisibilityEvent(3)
89 Xlib - C Language X Interface
90
91
92
93X Version 11 libX11 1.7.0 XAnyEvent(3)