Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xisetfocus(3) [debian man page]

XISETFOCUS(3)															     XISETFOCUS(3)

NAME
XISetFocus, XIGetFocus - set or get the device's focus. SYNOPSIS
#include <X11/extensions/XInput2.h> Status XISetFocus( Display *display, int deviceid, Window focus, Time time); Status XIGetFocus( Display *display, Window *focus_return); display Specifies the connection to the X server. deviceid Specifies the device whose focus is to be queried or changed. focus The new focus window. focus_return Returns the current focus window. time A valid timestamp or CurrentTime. DESCRIPTION
XISetFocus changes the focus of the specified device ans its 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. CurrentTime is replaced by the current X server time). XISetFocus causes the X server to generate core, XI and XI2 focus events. If the focus window is None all keyboard events by this device are discarded until a new focus window is set. Otherwise, if focus is a window, it becomes the device's focus window. If a generated device 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. The specified focus window must be viewable at the time XISetFocus is called, or a BadMatch error results. If the focus window later becomes not viewable, the focus reverts to the parent (or the closest viewable ancestor. When the focus reverts, the X server generates core, XI and XI2 focus events but the last-focus-change time is not affected. Attempting to set the focus on a master pointer device or an attached slave device will result in a BadDevice error. XISetFocus can generate BadDevice, BadMatch, BadValue, and BadWindow errors. DIAGNOSTICS
BadValue A value is outside of the permitted range. BadDevice An invalid device was specified. The device does not exist or is not a appropriate for the type of change. BadMatch The window is not viewable. BadWindow A value for a Window argument does not name a defined Window. 05/15/2013 XISETFOCUS(3)

Check Out this Related Man Page

XSetInputFocus()														  XSetInputFocus()

Name
  XSetInputFocus - set the keyboard focus window.

Synopsis
  XSetInputFocus(display, focus, revert_to, time)
	Display *display;
	Window focus;
	int revert_to;
	Time time;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  focus    Specifies the ID of the window you want to be the keyboard focus.  Pass the window ID, PointerRoot, or None.

  revert_to
	   Specifies  which  window  the  keyboard  focus  reverts to if the focus window becomes not viewable.  Pass one of these constants:
	   RevertToParent, RevertToPointerRoot, or RevertToNone.  Must not be a window ID.

  time	   Specifies the time when the focus change should take place.	Pass either a timestamp, expressed in milliseconds, or	the  constant
	   CurrentTime.  Also returns the time of the focus change when CurrentTime is specified.

Description
  XSetInputFocus() changes the keyboard focus and the last-focus-change time.  The function has no effect if time is earlier than the current
  last-focus-change time or later than the current X server time.  Otherwise, the last-focus-change time is set to the specified  time,  with
  CurrentTime replaced by the current X server time.

  XSetInputFocus() generates FocusIn and FocusOut events if focus is different from the current focus.

  XSetInputFocus() executes as follows, depending on what value you assign to the focus argument:

  o  If you assign None, all keyboard events are discarded until you set a new focus window.  In this case, revert_to is ignored.

  o  If  you  assign  a  window ID, it becomes the main 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 normally; otherwise, the event is reported to the focus window.   The  speci-
     fied  focus window must be viewable at the time of the request (else a BadMatch error).  If the focus window later becomes not viewable,
     the focus window will change to the revert_to argument.

  o  If you assign PointerRoot, the focus window is dynamically taken to be the root window of whatever screen the pointer is on at each key-
     board event.  In this case, revert_to is ignored.	This is the default keyboard focus setting.

  If the focus window later becomes not viewable, XSetInputFocus() evaluates the revert_to argument to determine the new focus window:

  o  If  you  assign  RevertToParent,  the  focus reverts to the parent (or the closest viewable ancestor) automatically with a new revert_to
     argument of RevertToName.

  o  If you assign RevertToPointerRoot or RevertToNone, the focus reverts to that value automatically.	FocusIn and FocusOut events are  gen-
     erated when the focus reverts, but the last focus change time is not affected.

Errors
  BadMatch  focus window not viewable when XSetInputFocus() called.

  BadValue

  BadWindow

See Also
  XQLength(),	XAllowEvents(),   XCheckIfEvent(),   XCheckMaskEvent(),  XCheckTypedEvent(),  XCheckTypedWindowEvent(),  XCheckWindowEvent(),
  XEventsQueued(), XGetInputFocus(), XGetMotionEvents(), XIfEvent(), XMaskEvent(), XNextEvent(),  XPeekEvent(),  XPeekIfEvent(),  XPending(),
  XPutBackEvent(), XSelectInput(), XSendEvent(), XSynchronize(), XWindowEvent().

Xlib - Input Handling														  XSetInputFocus()
Man Page