


XSetInputFocus(3X11)					 XSetInputFocus(3X11)
X11R5									X11R5



NAME
  XSetInputFocus, XGetInputFocus - control input focus

SYNTAX
  XSetInputFocus(_d_i_s_p_l_a_y, _f_o_c_u_s, _r_e_v_e_r_t__t_o, _t_i_m_e)
	Display	*_d_i_s_p_l_a_y;
	Window _f_o_c_u_s;
	int _r_e_v_e_r_t__t_o;
	Time _t_i_m_e;

  XGetInputFocus(_d_i_s_p_l_a_y, _f_o_c_u_s__r_e_t_u_r_n,	_r_e_v_e_r_t__t_o__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	Window *_f_o_c_u_s__r_e_t_u_r_n;
	int *_r_e_v_e_r_t__t_o__r_e_t_u_r_n;

ARGUMENTS

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

  _f_o_c_u_s	    Specifies the window, _P_o_i_n_t_e_r_R_o_o_t, or _N_o_n_e.

  _f_o_c_u_s__r_e_t_u_r_n
	    Returns the	focus window, _P_o_i_n_t_e_r_R_o_o_t, or _N_o_n_e.

  _r_e_v_e_r_t__t_o Specifies where the	input focus reverts to if the window becomes
	    not	viewable.  You can pass	_R_e_v_e_r_t_T_o_P_a_r_e_n_t,	_R_e_v_e_r_t_T_o_P_o_i_n_t_e_r_R_o_o_t,
	    or _R_e_v_e_r_t_T_o_N_o_n_e.

  _r_e_v_e_r_t__t_o__r_e_t_u_r_n
	    Returns the	current	focus state (_R_e_v_e_r_t_T_o_P_a_r_e_n_t, _R_e_v_e_r_t_T_o_P_o_i_n_t_e_r_-
	    _R_o_o_t, or _R_e_v_e_r_t_T_o_N_o_n_e).

  _t_i_m_e	    Specifies the time.	 You can pass either a timestamp or _C_u_r_r_e_n_t_-
	    _T_i_m_e.

DESCRIPTION
  The _X_S_e_t_I_n_p_u_t_F_o_c_u_s function changes the input	focus and the last-focus-
  change time.	It has no effect if the	specified time is earlier than the
  current last-focus-change time or is later than the current X	server time.
  Otherwise, the last-focus-change time	is set to the specified	time
  (_C_u_r_r_e_n_t_T_i_m_e is replaced by the current X server time).  _X_S_e_t_I_n_p_u_t_F_o_c_u_s
  causes the X server to generate _F_o_c_u_s_I_n and _F_o_c_u_s_O_u_t events.

  Depending on the focus argument, the following occurs:

  oo++    If focus	is _N_o_n_e, all keyboard events are discarded until a new focus
       window is set, and the revert_to	argument is ignored.

  oo++    If focus	is a window, it	becomes	the keyboard's focus window.  If a
       generated keyboard event	would normally be reported to this window or
       one of its inferiors, the event is reported as usual. Otherwise,	the
       event is	reported relative to the focus window.

  oo++    If focus	is _P_o_i_n_t_e_r_R_o_o_t,	the focus window is dynamically	taken to be
       the root	window of whatever screen the pointer is on at each keyboard
       event. In this case, the	revert_to argument is ignored.


  The specified	focus window must be viewable at the time _X_S_e_t_I_n_p_u_t_F_o_c_u_s is
  called, or a _B_a_d_M_a_t_c_h	error results.	If the focus window later becomes not
  viewable, the	X server evaluates the revert_to argument to determine the
  new focus window as follows:

  oo++    If revert_to is _R_e_v_e_r_t_T_o_P_a_r_e_n_t, the focus reverts to the	parent (or
       the closest viewable ancestor), and the new revert_to value is taken
       to be _R_e_v_e_r_t_T_o_N_o_n_e.

  oo++    If revert_to is _R_e_v_e_r_t_T_o_P_o_i_n_t_e_r_R_o_o_t or _R_e_v_e_r_t_T_o_N_o_n_e, the	focus reverts
       to _P_o_i_n_t_e_r_R_o_o_t or _N_o_n_e, respectively.  When the focus reverts, the X
       server generates	_F_o_c_u_s_I_n	and _F_o_c_u_s_O_u_t events, but the last-focus-
       change time is not affected.

  _X_S_e_t_I_n_p_u_t_F_o_c_u_s can generate _B_a_d_M_a_t_c_h,	_B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w	errors.

  The _X_G_e_t_I_n_p_u_t_F_o_c_u_s function returns the focus	window and the current focus
  state.

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 argu-
	    ment, the full range defined by the	argument's type	is accepted.
	    Any	argument defined as a set of alternatives can generate 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
  XWarpPointer(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e


































