1XSendEvent(3)                   XLIB FUNCTIONS                   XSendEvent(3)
2
3
4

NAME

6       XSendEvent, XDisplayMotionBufferSize, XGetMotionEvents, XTimeCoord -
7       send events and pointer motion history structure
8

SYNTAX

10       Status XSendEvent(Display *display, Window w, Bool propagate, long
11              event_mask, XEvent *event_send);
12
13       unsigned long XDisplayMotionBufferSize(Display *display);
14
15       XTimeCoord *XGetMotionEvents(Display *display, Window w, Time start,
16              Time stop, int *nevents_return);
17

ARGUMENTS

19       display   Specifies the connection to the X server.
20
21       event_mask
22                 Specifies the event mask.
23
24       event_send
25                 Specifies the event that is to be sent.
26
27       nevents_return
28                 Returns the number of events from the motion history buffer.
29
30       propagate Specifies a Boolean value.
31
32       start
33       stop      Specify the time interval in which the events are returned
34                 from the motion history buffer.  You can pass a timestamp or
35                 CurrentTime.  PointerWindow, or InputFocus.
36
37       w         Specifies the window the window the event is to be sent to,.
38

DESCRIPTION

40       The XSendEvent function identifies the destination window, determines
41       which clients should receive the specified events, and ignores any
42       active grabs.  This function requires you to pass an event mask.  For a
43       discussion of the valid event mask names, see section 10.3.  This func‐
44       tion uses the w argument to identify the destination window as follows:
45
46       ·    If w is PointerWindow, the destination window is the window that
47            contains the pointer.
48
49       ·    If w is InputFocus and if the focus window contains the pointer,
50            the destination window is the window that contains the pointer;
51            otherwise, the destination window is the focus window.
52
53       To determine which clients should receive the specified events, XSendE‐
54       vent uses the propagate argument as follows:
55
56       ·    If event_mask is the empty set, the event is sent to the client
57            that created the destination window.  If that client no longer
58            exists, no event is sent.
59
60       ·    If propagate is False, the event is sent to every client selecting
61            on destination any of the event types in the event_mask argument.
62
63       ·    If propagate is True and no clients have selected on destination
64            any of the event types in event-mask, the destination is replaced
65            with the closest ancestor of destination for which some client has
66            selected a type in event-mask and for which no intervening window
67            has that type in its do-not-propagate-mask.  If no such window
68            exists or if the window is an ancestor of the focus window and
69            InputFocus was originally specified as the destination, the event
70            is not sent to any clients.  Otherwise, the event is reported to
71            every client selecting on the final destination any of the types
72            specified in event_mask.
73
74       The event in the XEvent structure must be one of the core events or one
75       of the events defined by an extension (or a BadValue error results) so
76       that the X server can correctly byte-swap the contents as necessary.
77       The contents of the event are otherwise unaltered and unchecked by the
78       X server except to force send_event to True in the forwarded event and
79       to set the serial number in the event correctly; therefore these fields
80       and the display field are ignored by XSendEvent.
81
82       XSendEvent returns zero if the conversion to wire protocol format
83       failed and returns nonzero otherwise.  XSendEvent can generate BadValue
84       and BadWindow errors.
85
86       The server may retain the recent history of the pointer motion and do
87       so to a finer granularity than is reported by MotionNotify events.  The
88       XGetMotionEvents function makes this history available.
89
90       The XGetMotionEvents function returns all events in the motion history
91       buffer that fall between the specified start and stop times, inclusive,
92       and that have coordinates that lie within the specified window (includ‐
93       ing its borders) at its present placement.  If the server does not sup‐
94       port motion history, if the start time is later than the stop time, or
95       if the start time is in the future, no events are returned; XGetMotion‐
96       Events returns NULL.  If the stop time is in the future, it is equiva‐
97       lent to specifying CurrentTime.  XGetMotionEvents can generate a Bad‐
98       Window error.
99

STRUCTURES

101       The XTimeCoord structure contains:
102
103       typedef struct {
104               Time time;
105               short x, y;
106       } XTimeCoord;
107
108       The time member is set to the time, in milliseconds.  The x and y mem‐
109       bers are set to the coordinates of the pointer and are reported rela‐
110       tive to the origin of the specified window.
111

DIAGNOSTICS

113       BadValue  Some numeric value falls outside the range of values accepted
114                 by the request.  Unless a specific range is specified for an
115                 argument, the full range defined by the argument's type is
116                 accepted.  Any argument defined as a set of alternatives can
117                 generate this error.
118
119       BadWindow A value for a Window argument does not name a defined Window.
120

SEE ALSO

122       XAnyEvent(3), XIfEvent(3), XNextEvent(3), XPutBackEvent(3)
123       Xlib - C Language X Interface
124
125
126
127X Version 11                     libX11 1.6.5                    XSendEvent(3)
Impressum