Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XSetInputFocus(3X) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XWarpPointer(3X)




XSetInputFocus(3X) XSetInputFocus(3X)
NAME XSetInputFocus, XGetInputFocus - control input focus SYNOPSIS XSetInputFocus (display, focus, revert-to, time) Display *display; Window focus; int revert-to; Time time; XGetInputFocus (display, focus-return, revert-to-return) Display *display; Window *focus-return; int *revert-to-return; DESCRIPTION The XSetInputFocus function changes the input focus and the last-focus-change time. The function 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). XSetInputFocus causes the X server to generate FocusIn and FocusOut events. Depending on the value of the focus argument, the following occurs: If focus is None, all keyboard events are discarded un- til a new focus window is set, and the revert-to argu- ment is ignored. 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 re- ported relative to the focus window. If focus is PointerRoot, the focus window is dynamical- ly 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 XSetInputFocus is called, or a BadMatch error results. If the focus window later becomes unviewable, the X server evaluates the revert-to argument to determine the new focus window as follows: If revert-to is RevertToParent, the focus reverts to the parent (or the closest viewable ancestor), and the November, 1990 1



XSetInputFocus(3X) XSetInputFocus(3X)
new revert-to value is taken to be RevertToNone. If revert-to is RevertToPointerRoot or RevertToNone, the focus reverts to PointerRoot or None, respectively. When the focus reverts, the X server generates FocusIn and FocusOut events, but the last- focus-change time is not affected. The XGetInputFocus function returns the focus window ID and the current focus state. Arguments These functions accept the following arguments: display Specifies the connection to the X server. focus Specifies the window ID, or either PointerRoot, or None. focus-return Returns the focus window ID, or either PointerRoot or None. revert-to Specifies the window to which the input focus re- verts if the window becomes unviewable. You can pass one of the following constants: RevertTo- Parent, RevertToPointerRoot, or RevertToNone. revert-to-return Returns the current focus state. The function can return one of the following constants: RevertTo- Parent, RevertToPointerRoot, or RevertToNone. time Specifies the time. You can pass either a times- tamp, expressed in milliseconds, or CurrentTime. ERRORS BadMatch An argument or pair of arguments has the correct type and range but fails to match in some other re- quired way. BadValue A numeric value falls outside the range of values accepted by the request. Unless a range is speci- fied for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. BadWindow 2 November, 1990



XSetInputFocus(3X) XSetInputFocus(3X)
A value for a Window argument does not name a de- fined window. The XSetInputFocus function can generate BadMatch, BadValue, and BadWindow errors. SEE ALSO XWarpPointer(3X)
Xlib - C Language Interface
November, 1990 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026