2 .\" Title: xsetdevicefocus
3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
6 .\" Manual: [FIXME: manual]
7 .\" Source: [FIXME: source]
10 .TH "XSETDEVICEFOCUS" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 XSetDeviceFocus, XGetDeviceFocus \- control extension input device focus
35 #include <X11/extensions/XInput\&.h>
39 XSetDeviceFocus( Display *display,
47 XGetDeviceFocus( Display *display,
50 int *revert_to_return,
58 Specifies the connection to the X server\&.
63 Specifies the device whose focus is to be queried or
69 Specifies the window, PointerRoot, FollowKeyboard,or
75 Returns the focus window, PointerRoot, FollowKeyboard,or
81 Specifies where the input focus reverts to if the window
82 becomes notviewable\&.You can pass RevertToParent,
83 RevertToPointerRoot, RevertToFollowKeyboard,or
89 Returns the current focus state RevertToParent,
90 RevertToPointerRoot, RevertToFollowKeyboard,or
96 Returns the last_focus_time for the device\&.
101 Specifies the time\&.You can pass either a timestamp or
110 The XSetDeviceFocus request changes the focus of the specified
111 device and its last\-focus\-change time\&. It has no effect if the
112 specified time is earlier than the current last\-focus\-change
113 time or is later than the current X server time\&. Otherwise, the
114 last\-focus\-change time is set to the specified time CurrentTime
115 is replaced by the current X server time)\&. XSetDeviceFocus
116 causes the X server to generate DeviceFocusIn and
117 DeviceFocusOut events\&.
127 Depending on the focus argument, the following occurs:
128 * If focus is None , all device events are discarded until a
129 new focus window is set, and the revert_to argument is
131 * If focus is a window, it becomes the device\*(Aqs focus window\&.
132 If a generated device event would normally be reported to
133 this window or one of its inferiors, the event is reported
134 as usual\&. Otherwise, the event is reported relative to the
136 * If focus is PointerRoot, the focus window is dynamically
137 taken to be the root window of whatever screen the pointer
138 is on at each event from the specified device\&. In this
139 case, the revert_to argument is ignored\&.
140 * If focus is FollowKeyboard, the focus window is dynamically
141 taken to be the window to which the X keyboard focus is set
142 at each input event\&.
152 The specified focus window must be viewable at the time
153 XSetDeviceFocus is called, or a BadMatch error results\&. If the
154 focus window later becomes not viewable, the X server evaluates
155 the revert_to argument to determine the new focus window as
157 * If revert_to is RevertToParent, the focus reverts to the
158 parent (or the closest viewable ancestor), and the new
159 revert_to value is taken to be RevertToNone\&.
160 * If revert_to is RevertToPointerRoot,
161 RevertToFollowKeyboard, or RevertToNone, the focus reverts
162 to PointerRoot, FollowKeyboard, or None, respectively\&.
172 When the focus reverts, the X server generates DeviceFocusIn
173 and DeviceFocusOut events, but the last\-focus\-change time is
184 Input extension devices are not required to support the ability
185 to be focused\&. Attempting to set the focus of a device that
186 does not support this request will result in a BadMatch error\&.
187 Whether or not given device can support this request can be
188 determined by the information returned by XOpenDevice\&. For
189 those devices that support focus, XOpenDevice will return an
190 XInputClassInfo structure with the input_class field equal to
191 the constant FocusClass (defined in the file XI\&.h)\&.
201 XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and
212 The XGetDeviceFocus request returns the focus window and the
213 current focus state\&.
223 Not all input extension devices can be focused\&. Attempting to
224 query the focus state of a device that can\*(Aqt be focused results
225 in a BadMatch error\&. A device that can be focused returns
226 information for input Class Focus when an XOpenDevice request
237 XGetDeviceFocus can generate BadDevice, and BadMatch errors\&.
249 An invalid device was specified\&. The specified device
250 does not exist or has not been opened by this client via
251 XOpenInputDevice\&. This error may also occur if the
252 specified device is the X keyboard or X pointer device\&.
263 Some numeric value falls outside the range of values
264 accepted by the request\&. Unless a specific range is
265 specified for an argument, the full range defined by the
266 argument\*(Aqs type is accepted\&. Any argument defined as a
267 set of alternatives can generate this error\&.
278 A value for a Window argument does not name a defined
290 This error may occur if an XGetDeviceFocus or
291 XSetDeviceFocus request was made specifying a device
292 that the server implementation does not allow to be