


XSendEvent(3X11)					     XSendEvent(3X11)
X11R5									X11R5



NAME
  XSendEvent, XDisplayMotionBufferSize,	XGetMotionEvents, XTimeCoord - send
  events and pointer motion history structure

SYNTAX
  Status XSendEvent(_d_i_s_p_l_a_y, _w,	_p_r_o_p_a_g_a_t_e, _e_v_e_n_t__m_a_s_k, _e_v_e_n_t__s_e_n_d)
	Display	*_d_i_s_p_l_a_y;
	Window _w;
	Bool _p_r_o_p_a_g_a_t_e;
	long _e_v_e_n_t__m_a_s_k;
	XEvent *_e_v_e_n_t__s_e_n_d;

  unsigned long	XDisplayMotionBufferSize(_d_i_s_p_l_a_y)
	  Display *_d_i_s_p_l_a_y;

  XTimeCoord *XGetMotionEvents(_d_i_s_p_l_a_y,	_w, _s_t_a_r_t, _s_t_o_p,	_n_e_v_e_n_t_s__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	Window _w;
	Time _s_t_a_r_t, _s_t_o_p;
	int *_n_e_v_e_n_t_s__r_e_t_u_r_n;

ARGUMENTS

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _e_v_e_n_t__m_a_s_k
	    Specifies the event	mask.

  _e_v_e_n_t__s_e_n_d
	    Specifies the event	that is	to be sent.

  _n_e_v_e_n_t_s__r_e_t_u_r_n
	    Returns the	number of events from the motion history buffer.

  _p_r_o_p_a_g_a_t_e Specifies a	Boolean	value.

  _s_t_a_r_t
  _s_t_o_p	    Specify the	time interval in which the events are returned from
	    the	motion history buffer.	You can	pass a timestamp or _C_u_r_r_e_n_t_-
	    _T_i_m_e.  _P_o_i_n_t_e_r_W_i_n_d_o_w,

  _w	    Specifies the window the window the	event is to be sent to,.

DESCRIPTION
  The _X_S_e_n_d_E_v_e_n_t function identifies the destination window, determines	which
  clients should receive the specified events, and ignores any active grabs.
  This function	requires you to	pass an	event mask.  For a discussion of the
  valid	event mask names, see section 10.3.  This function uses	the w argu-
  ment to identify the destination window as follows:

  oo++    If w is _P_o_i_n_t_e_r_W_i_n_d_o_w, the destination window is	the window that	con-
       tains the pointer.

  oo++    If w is _I_n_p_u_t_F_o_c_u_s and if the focus window contains the pointer,	the
       destination window is the window	that contains the pointer; otherwise,
       the destination window is the focus window.


  To determine which clients should receive the	specified events, _X_S_e_n_d_E_v_e_n_t
  uses the propagate argument as follows:

  oo++    If event_mask is	the empty set, the event is sent to the	client that
       created the destination window.	If that	client no longer exists, no
       event is	sent.

  oo++    If propagate is _F_a_l_s_e, the event	is sent	to every client	selecting on
       destination any of the event types in the event_mask argument.

  oo++    If propagate is _T_r_u_e and	no clients have	selected on destination	any
       of the event types in event-mask, the destination is replaced with the
       closest ancestor	of destination for which some client has selected a
       type in event-mask and for which	no intervening window has that type
       in its do-not-propagate-mask. If	no such	window exists or if the	win-
       dow is an ancestor of the focus window and _I_n_p_u_t_F_o_c_u_s was originally
       specified as the	destination, the event is not sent to any clients.
       Otherwise, the event is reported	to every client	selecting on the
       final destination any of	the types specified in event_mask.

  The event in the _X_E_v_e_n_t structure must be one	of the core events or one of
  the events defined by	an extension (or a _B_a_d_V_a_l_u_e error results) so that
  the X	server can correctly byte-swap the contents as necessary. The con-
  tents	of the event are otherwise unaltered and unchecked by the X server
  except to force send_event to	_T_r_u_e in	the forwarded event and	to set the
  serial number	in the event correctly.

  _X_S_e_n_d_E_v_e_n_t returns zero if the conversion to wire protocol format failed
  and returns nonzero otherwise.  _X_S_e_n_d_E_v_e_n_t can generate _B_a_d_V_a_l_u_e and
  _B_a_d_W_i_n_d_o_w errors.

  The server may retain	the recent history of the pointer motion and do	so to
  a finer granularity than is reported by _M_o_t_i_o_n_N_o_t_i_f_y events.	The _X_G_e_t_M_o_-
  _t_i_o_n_E_v_e_n_t_s function makes this history available.

  The _X_G_e_t_M_o_t_i_o_n_E_v_e_n_t_s function	returns	all events in the motion history
  buffer that fall between the specified start and stop	times, inclusive, and
  that have coordinates	that lie within	the specified window (including	its
  borders) at its present placement.  If the server does not support motion
  history, or if the start time	is later than the stop time, or	if the start
  time is in the future, no events are returned, and _X_G_e_t_M_o_t_i_o_n_E_v_e_n_t_s returns
  NULL.	 If the	stop time is in	the future, it is equivalent to	specifying
  _C_u_r_r_e_n_t_T_i_m_e.	_X_G_e_t_M_o_t_i_o_n_E_v_e_n_t_s can generate a	_B_a_d_W_i_n_d_o_w error.

STRUCTURES
  The _X_T_i_m_e_C_o_o_r_d structure contains:

  typedef struct {
	  Time time;
	  short	x, y;
  } XTimeCoord;

  The time member is set to the	time, in milliseconds. The x and y members
  are set to the coordinates of	the pointer and	are reported relative to the
  origin of the	specified window.

DIAGNOSTICS

  _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of values accepted by
	    the	request.  Unless a specific range is specified for an
	    argument, the full range defined by	the argument's type is
	    accepted.  Any argument defined as a set of	alternatives can gen-
	    erate this error.

  _B_a_d_W_i_n_d_o_w A value for	a Window argument does not name	a defined Window.

SEE ALSO
  XAnyEvent(3X11), XIfEvent(3X11), XNextEvent(3X11), XPutBackEvent(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e































































