5
.\" Copyright ([\d,\s]*) by Hewlett-Packard Company, Ardent Computer,
7
.\" Permission to use, copy, modify, distribute, and sell this documentation
8
.\" for any purpose and without fee is hereby granted, provided that the above
9
.\" copyright notice and this permission notice appear in all copies.
10
.\" Ardent, and Hewlett-Packard make no representations about the
11
.\" suitability for any purpose of the information in this document. It is
12
.\" provided \`\`as is'' without express or implied warranty.
14
.\" $Xorg: XSeDvFoc.man,v 1.3 2000/08/17 19:41:57 cpqbld Exp $
15
.ds xL Programming with Xlib
16
.TH XSetDeviceFocus __LIB_MAN_SUFFIX__ __xorgversion__ "X FUNCTIONS"
2
.\" Title: xsetdevicefocus
3
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
.\" Generator: DocBook XSL Stylesheets v1.74.3 <http://docbook.sf.net/>
6
.\" Manual: [FIXME: manual]
7
.\" Source: [FIXME: source]
10
.TH "XSETDEVICEFOCUS" "libmansuffix" "10/02/2009" "[FIXME: source]" "[FIXME: manual]"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
18
22
XSetDeviceFocus, XGetDeviceFocus \- control extension input device focus
20
XSetDeviceFocus\^(\^\fIdisplay\fP, \fIdevice\fP\^, \fIfocus\fP\^, \fIrevert_to\fP\^, \fItime\fP\^)
22
Display *\fIdisplay\fP\^;
24
Display *\fIdevice\fP\^;
28
int \fIrevert_to\fP\^;
32
XGetDeviceFocus\^(\^\fIdisplay\fP, \fIdevice\fP\^, \fIfocus_return\fP\^,
33
\fIrevert_to_return\fP, \fItime_return\fP\^)
35
Display *\fIdisplay\fP\^;
37
Display *\fIdevice\fP\^;
39
Window *\fIfocus_return\fP\^;
41
int *\fIrevert_to_return\fP\^;
43
int *\fItime_return\fP\^;
47
Specifies the connection to the X server.
50
Specifies the device whose focus is to be queried or changed.
60
Returns the focus window,
67
Specifies where the input focus reverts to if the window becomes not
71
\fIRevertToPointerRoot\fP,
72
\fIRevertToFollowKeyboard\fP,
77
Returns the current focus state
79
\fIRevertToPointerRoot\fP,
80
\fIRevertToFollowKeyboard\fP,
85
Returns the last_focus_time for the device.
89
You can pass either a timestamp or
92
The \fIXSetDeviceFocus\fP
93
request changes the focus of the specified device and its last-focus-change
95
It has no effect if the specified time is earlier than the current
96
last-focus-change time or is later than the current X server time.
97
Otherwise, the last-focus-change time is set to the specified time
99
is replaced by the current X server time).
100
\fIXSetDeviceFocus\fP
101
causes the X server to generate
107
Depending on the focus argument,
108
the following occurs:
112
all device events are discarded until a new focus window is set,
113
and the revert_to argument is ignored.
115
If focus is a window,
116
it becomes the device's focus window.
117
If a generated device event would normally be reported to this window
118
or one of its inferiors, the event is reported as usual.
119
Otherwise, the event is reported relative to the focus window.
123
the focus window is dynamically taken to be the root window of whatever screen
124
the pointer is on at each event from the specified device.
125
In this case, the revert_to argument is ignored.
128
\fIFollowKeyboard\fP,
129
the focus window is dynamically taken to be the window to which the X keyboard
130
focus is set at each input event.
132
The specified focus window must be viewable at the time
133
\fIXSetDeviceFocus\fP
138
If the focus window later becomes not viewable,
140
evaluates the revert_to argument to determine the new focus window as follows:
143
\fIRevertToParent\fP,
144
the focus reverts to the parent (or the closest viewable ancestor),
145
and the new revert_to value is taken to be
149
\fIRevertToPointerRoot\fP,
150
\fIRevertToFollowKeyboard\fP,
155
\fIFollowKeyboard\fP,
160
When the focus reverts,
161
the X server generates
165
events, but the last-focus-change time is not affected.
167
Input extension devices are not required to support the ability to be focused.
168
Attempting to set the focus of a device that does not support this request
169
will result in a \fIBadMatch\fP error. Whether or not given device can
170
support this request can be determined by the information returned by
172
For those devices that
173
support focus, \fIXOpenDevice\fP will return an
174
\fIXInputClassInfo\fP structure with the input_class field
175
equal to the constant \fIFocusClass\fP (defined in the file \fIXI.h\fP).
177
\fIXSetDeviceFocus\fP
187
\fIXGetDeviceFocus\fP
188
request returns the focus window and the current focus state.
190
Not all input extension devices can be focused. Attempting to query the
191
focus state of a device that can't be focused results in a \fIBadMatch\fP
192
error. A device that can be focused returns information for input Class
193
Focus when an \fIXOpenDevice\fP request is made.
195
\fIXGetDeviceFocus\fP can generate \fIBadDevice\fP,
196
and \fIBadMatch\fP errors.
200
An invalid device was specified. The specified device does not exist or has
201
not been opened by this client via \fIXOpenInputDevice\fP. This error may
202
also occur if the specified device is the X keyboard or X pointer device.
205
Some numeric value falls outside the range of values accepted by the request.
206
Unless a specific range is specified for an argument, the full range defined
207
by the argument's type is accepted. Any argument defined as a set of
208
alternatives can generate this error.
211
A value for a Window argument does not name a defined Window.
214
This error may occur if an \fIXGetDeviceFocus\fP or \fIXSetDeviceFocus\fP
215
request was made specifying a device that the server implementation does not
26
#include <X11/extensions/XInput\&.h>
30
XSetDeviceFocus( Display *display,
38
XGetDeviceFocus( Display *display,
41
int *revert_to_return,
49
Specifies the connection to the X server\&.
54
Specifies the device whose focus is to be queried or
60
Specifies the window, PointerRoot, FollowKeyboard,or
66
Returns the focus window, PointerRoot, FollowKeyboard,or
72
Specifies where the input focus reverts to if the window
73
becomes notviewable\&.You can pass RevertToParent,
74
RevertToPointerRoot, RevertToFollowKeyboard,or
80
Returns the current focus state RevertToParent,
81
RevertToPointerRoot, RevertToFollowKeyboard,or
87
Returns the last_focus_time for the device\&.
92
Specifies the time\&.You can pass either a timestamp or
101
The XSetDeviceFocus request changes the focus of the specified
102
device and its last\-focus\-change time\&. It has no effect if the
103
specified time is earlier than the current last\-focus\-change
104
time or is later than the current X server time\&. Otherwise, the
105
last\-focus\-change time is set to the specified time CurrentTime
106
is replaced by the current X server time)\&. XSetDeviceFocus
107
causes the X server to generate DeviceFocusIn and
108
DeviceFocusOut events\&.
118
Depending on the focus argument, the following occurs:
119
* If focus is None , all device events are discarded until a
120
new focus window is set, and the revert_to argument is
122
* If focus is a window, it becomes the device\'s focus window\&.
123
If a generated device event would normally be reported to
124
this window or one of its inferiors, the event is reported
125
as usual\&. Otherwise, the event is reported relative to the
127
* If focus is PointerRoot, the focus window is dynamically
128
taken to be the root window of whatever screen the pointer
129
is on at each event from the specified device\&. In this
130
case, the revert_to argument is ignored\&.
131
* If focus is FollowKeyboard, the focus window is dynamically
132
taken to be the window to which the X keyboard focus is set
133
at each input event\&.
143
The specified focus window must be viewable at the time
144
XSetDeviceFocus is called, or a BadMatch error results\&. If the
145
focus window later becomes not viewable, the X server evaluates
146
the revert_to argument to determine the new focus window as
148
* If revert_to is RevertToParent, the focus reverts to the
149
parent (or the closest viewable ancestor), and the new
150
revert_to value is taken to be RevertToNone\&.
151
* If revert_to is RevertToPointerRoot,
152
RevertToFollowKeyboard, or RevertToNone, the focus reverts
153
to PointerRoot, FollowKeyboard, or None, respectively\&.
163
When the focus reverts, the X server generates DeviceFocusIn
164
and DeviceFocusOut events, but the last\-focus\-change time is
175
Input extension devices are not required to support the ability
176
to be focused\&. Attempting to set the focus of a device that
177
does not support this request will result in a BadMatch error\&.
178
Whether or not given device can support this request can be
179
determined by the information returned by XOpenDevice\&. For
180
those devices that support focus, XOpenDevice will return an
181
XInputClassInfo structure with the input_class field equal to
182
the constant FocusClass (defined in the file XI\&.h)\&.
192
XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and
203
The XGetDeviceFocus request returns the focus window and the
204
current focus state\&.
214
Not all input extension devices can be focused\&. Attempting to
215
query the focus state of a device that can\'t be focused results
216
in a BadMatch error\&. A device that can be focused returns
217
information for input Class Focus when an XOpenDevice request
228
XGetDeviceFocus can generate BadDevice, and BadMatch errors\&.
240
An invalid device was specified\&. The specified device
241
does not exist or has not been opened by this client via
242
XOpenInputDevice\&. This error may also occur if the
243
specified device is the X keyboard or X pointer device\&.
254
Some numeric value falls outside the range of values
255
accepted by the request\&. Unless a specific range is
256
specified for an argument, the full range defined by the
257
argument\'s type is accepted\&. Any argument defined as a
258
set of alternatives can generate this error\&.
269
A value for a Window argument does not name a defined
281
This error may occur if an XGetDeviceFocus or
282
XSetDeviceFocus request was made specifying a device
283
that the server implementation does not allow to be