~ubuntu-branches/ubuntu/natty/libxi/natty-201011191114

« back to all changes in this revision

Viewing changes to man/XSetDeviceFocus.man

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-11-21 18:39:28 UTC
  • mfrom: (1.1.10 upstream) (0.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20091121183928-ek2jwqx3rmhv3zjz
Tags: 2:1.3-1
* Bump Standards-Version to 3.8.3.
* Add build-deps on xmlto and asciidoc to build the manpages.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\"
2
 
.\" $XFree86$
3
 
.\"
4
 
.\"
5
 
.\" Copyright ([\d,\s]*) by Hewlett-Packard Company, Ardent Computer, 
6
 
.\" 
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.
13
 
.\" 
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"
17
 
.SH NAME
 
1
'\" t
 
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/>
 
5
.\"      Date: 10/02/2009
 
6
.\"    Manual: [FIXME: manual]
 
7
.\"    Source: [FIXME: source]
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "XSETDEVICEFOCUS" "libmansuffix" "10/02/2009" "[FIXME: source]" "[FIXME: manual]"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.SH "NAME"
18
22
XSetDeviceFocus, XGetDeviceFocus \- control extension input device focus
19
 
.SH SYNTAX
20
 
XSetDeviceFocus\^(\^\fIdisplay\fP, \fIdevice\fP\^, \fIfocus\fP\^, \fIrevert_to\fP\^, \fItime\fP\^)
21
 
.br
22
 
      Display *\fIdisplay\fP\^;
23
 
.br
24
 
      Display *\fIdevice\fP\^;
25
 
.br
26
 
      Window \fIfocus\fP\^;
27
 
.br
28
 
      int \fIrevert_to\fP\^; 
29
 
.br
30
 
      Time \fItime\fP\^; 
31
 
.sp
32
 
XGetDeviceFocus\^(\^\fIdisplay\fP, \fIdevice\fP\^, \fIfocus_return\fP\^, 
33
 
\fIrevert_to_return\fP, \fItime_return\fP\^)
34
 
.br
35
 
      Display *\fIdisplay\fP\^;
36
 
.br
37
 
      Display *\fIdevice\fP\^;
38
 
.br
39
 
      Window *\fIfocus_return\fP\^;
40
 
.br
41
 
      int *\fIrevert_to_return\fP\^;
42
 
.br
43
 
      int *\fItime_return\fP\^;
44
 
.SH ARGUMENTS
45
 
.TP 12
46
 
.I display
47
 
Specifies the connection to the X server.
48
 
.TP 12
49
 
.I device
50
 
Specifies the device whose focus is to be queried or changed.
51
 
.TP 12
52
 
.I focus
53
 
Specifies the window,
54
 
\fIPointerRoot\fP,
55
 
\fIFollowKeyboard\fP,
56
 
or
57
 
\fINone\fP.
58
 
.TP 12
59
 
.I focus_return
60
 
Returns the focus window,
61
 
\fIPointerRoot\fP,
62
 
\fIFollowKeyboard\fP,
63
 
or 
64
 
\fINone\fP.
65
 
.TP 12
66
 
.I revert_to
67
 
Specifies where the input focus reverts to if the window becomes not
68
 
viewable.
69
 
You can pass 
70
 
\fIRevertToParent\fP, 
71
 
\fIRevertToPointerRoot\fP, 
72
 
\fIRevertToFollowKeyboard\fP, 
73
 
or 
74
 
\fIRevertToNone\fP.
75
 
.TP 12
76
 
.I revert_to_return
77
 
Returns the current focus state
78
 
\fIRevertToParent\fP, 
79
 
\fIRevertToPointerRoot\fP, 
80
 
\fIRevertToFollowKeyboard\fP, 
81
 
or 
82
 
\fIRevertToNone\fP.
83
 
.TP 12
84
 
.I time_return
85
 
Returns the last_focus_time for the device.
86
 
.TP 12
87
 
.I time
88
 
Specifies the time.
89
 
You can pass either a timestamp or
90
 
\fICurrentTime\fP.
91
 
.SH DESCRIPTION
92
 
The \fIXSetDeviceFocus\fP
93
 
request changes the focus of the specified device and its last-focus-change 
94
 
time.
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
98
 
\fICurrentTime\fP
99
 
is replaced by the current X server time).
100
 
\fIXSetDeviceFocus\fP
101
 
causes the X server to generate
102
 
\fIDeviceFocusIn\fP
103
 
and 
104
 
\fIDeviceFocusOut\fP
105
 
events.
106
 
.LP
107
 
Depending on the focus argument,
108
 
the following occurs: 
109
 
.IP \(bu 5
110
 
If focus is
111
 
\fINone\fP ,
112
 
all device events are discarded until a new focus window is set,
113
 
and the revert_to argument is ignored.
114
 
.IP \(bu 5
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.
120
 
.IP \(bu 5
121
 
If focus is
122
 
\fIPointerRoot\fP,
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.
126
 
.IP \(bu 5
127
 
If focus is
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.
131
 
.LP
132
 
The specified focus window must be viewable at the time 
133
 
\fIXSetDeviceFocus\fP
134
 
is called,
135
 
or a
136
 
\fIBadMatch\fP
137
 
error results.
138
 
If the focus window later becomes not viewable, 
139
 
the X server
140
 
evaluates the revert_to argument to determine the new focus window as follows: 
141
 
.IP \(bu 5
142
 
If revert_to is
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
146
 
\fIRevertToNone\fP.  
147
 
.IP \(bu 5
148
 
If revert_to is
149
 
\fIRevertToPointerRoot\fP,
150
 
\fIRevertToFollowKeyboard\fP,
151
 
or 
152
 
\fIRevertToNone\fP,
153
 
the focus reverts to
154
 
\fIPointerRoot\fP,
155
 
\fIFollowKeyboard\fP,
156
 
or
157
 
\fINone\fP,
158
 
respectively.
159
 
.LP
160
 
When the focus reverts,
161
 
the X server generates
162
 
\fIDeviceFocusIn\fP
163
 
and
164
 
\fIDeviceFocusOut\fP
165
 
events, but the last-focus-change time is not affected.
166
 
.LP
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
171
 
\fIXOpenDevice\fP.
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).
176
 
.LP
177
 
\fIXSetDeviceFocus\fP
178
 
can generate
179
 
\fIBadDevice\fP,
180
 
\fIBadMatch\fP,
181
 
\fIBadValue\fP,
182
 
and
183
 
\fIBadWindow\fP
184
 
errors.
185
 
.LP
186
 
The
187
 
\fIXGetDeviceFocus\fP
188
 
request returns the focus window and the current focus state.
189
 
.LP
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.
194
 
.LP
195
 
\fIXGetDeviceFocus\fP can generate \fIBadDevice\fP,
196
 
and \fIBadMatch\fP errors.
197
 
.SH DIAGNOSTICS
198
 
.TP 12
199
 
\fIBadDevice\fP
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.
203
 
.TP 12
204
 
\fIBadValue\fP
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.
209
 
.TP 12
210
 
\fIBadWindow\fP
211
 
A value for a Window argument does not name a defined Window.
212
 
.TP 12
213
 
\fIBadMatch\fP
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 
216
 
allow to be focused.
217
 
.SH "SEE ALSO"
218
 
.br
219
 
\fI\*(xL\fP
 
23
.SH "SYNOPSIS"
 
24
.sp
 
25
.nf
 
26
#include <X11/extensions/XInput\&.h>
 
27
.fi
 
28
.sp
 
29
.nf
 
30
XSetDeviceFocus( Display *display,
 
31
                 XDevice *device,
 
32
                 Window focus,
 
33
                 int revert_to,
 
34
                 Time time);
 
35
.fi
 
36
.sp
 
37
.nf
 
38
XGetDeviceFocus( Display *display,
 
39
                 XDevice *device,
 
40
                 Window *focus_return,
 
41
                 int *revert_to_return,
 
42
                 int * time_return);
 
43
.fi
 
44
.sp
 
45
Arguments
 
46
.sp
 
47
.nf
 
48
display
 
49
       Specifies the connection to the X server\&.
 
50
.fi
 
51
.sp
 
52
.nf
 
53
device
 
54
       Specifies the device whose focus is to be queried or
 
55
       changed\&.
 
56
.fi
 
57
.sp
 
58
.nf
 
59
focus
 
60
       Specifies the window, PointerRoot, FollowKeyboard,or
 
61
       None\&.
 
62
.fi
 
63
.sp
 
64
.nf
 
65
focus_return
 
66
       Returns the focus window, PointerRoot, FollowKeyboard,or
 
67
       None\&.
 
68
.fi
 
69
.sp
 
70
.nf
 
71
revert_to
 
72
       Specifies where the input focus reverts to if the window
 
73
       becomes notviewable\&.You can pass RevertToParent,
 
74
       RevertToPointerRoot, RevertToFollowKeyboard,or
 
75
       RevertToNone\&.
 
76
.fi
 
77
.sp
 
78
.nf
 
79
revert_to_return
 
80
       Returns the current focus state RevertToParent,
 
81
       RevertToPointerRoot, RevertToFollowKeyboard,or
 
82
       RevertToNone\&.
 
83
.fi
 
84
.sp
 
85
.nf
 
86
time_return
 
87
       Returns the last_focus_time for the device\&.
 
88
.fi
 
89
.sp
 
90
.nf
 
91
time
 
92
       Specifies the time\&.You can pass either a timestamp or
 
93
       CurrentTime\&.
 
94
.fi
 
95
.SH "DESCRIPTION"
 
96
.sp
 
97
.if n \{\
 
98
.RS 4
 
99
.\}
 
100
.nf
 
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\&.
 
109
.fi
 
110
.if n \{\
 
111
.RE
 
112
.\}
 
113
.sp
 
114
.if n \{\
 
115
.RS 4
 
116
.\}
 
117
.nf
 
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
 
121
    ignored\&.
 
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
 
126
    focus window\&.
 
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\&.
 
134
.fi
 
135
.if n \{\
 
136
.RE
 
137
.\}
 
138
.sp
 
139
.if n \{\
 
140
.RS 4
 
141
.\}
 
142
.nf
 
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
 
147
follows:
 
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\&.
 
154
.fi
 
155
.if n \{\
 
156
.RE
 
157
.\}
 
158
.sp
 
159
.if n \{\
 
160
.RS 4
 
161
.\}
 
162
.nf
 
163
When the focus reverts, the X server generates DeviceFocusIn
 
164
and DeviceFocusOut events, but the last\-focus\-change time is
 
165
not affected\&.
 
166
.fi
 
167
.if n \{\
 
168
.RE
 
169
.\}
 
170
.sp
 
171
.if n \{\
 
172
.RS 4
 
173
.\}
 
174
.nf
 
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)\&.
 
183
.fi
 
184
.if n \{\
 
185
.RE
 
186
.\}
 
187
.sp
 
188
.if n \{\
 
189
.RS 4
 
190
.\}
 
191
.nf
 
192
XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and
 
193
BadWindow errors\&.
 
194
.fi
 
195
.if n \{\
 
196
.RE
 
197
.\}
 
198
.sp
 
199
.if n \{\
 
200
.RS 4
 
201
.\}
 
202
.nf
 
203
The XGetDeviceFocus request returns the focus window and the
 
204
current focus state\&.
 
205
.fi
 
206
.if n \{\
 
207
.RE
 
208
.\}
 
209
.sp
 
210
.if n \{\
 
211
.RS 4
 
212
.\}
 
213
.nf
 
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
 
218
is made\&.
 
219
.fi
 
220
.if n \{\
 
221
.RE
 
222
.\}
 
223
.sp
 
224
.if n \{\
 
225
.RS 4
 
226
.\}
 
227
.nf
 
228
XGetDeviceFocus can generate BadDevice, and BadMatch errors\&.
 
229
.fi
 
230
.if n \{\
 
231
.RE
 
232
.\}
 
233
.SH "DIAGNOSTICS"
 
234
.sp
 
235
.if n \{\
 
236
.RS 4
 
237
.\}
 
238
.nf
 
239
BadDevice
 
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\&.
 
244
.fi
 
245
.if n \{\
 
246
.RE
 
247
.\}
 
248
.sp
 
249
.if n \{\
 
250
.RS 4
 
251
.\}
 
252
.nf
 
253
BadValue
 
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\&.
 
259
.fi
 
260
.if n \{\
 
261
.RE
 
262
.\}
 
263
.sp
 
264
.if n \{\
 
265
.RS 4
 
266
.\}
 
267
.nf
 
268
BadWindow
 
269
       A value for a Window argument does not name a defined
 
270
       Window\&.
 
271
.fi
 
272
.if n \{\
 
273
.RE
 
274
.\}
 
275
.sp
 
276
.if n \{\
 
277
.RS 4
 
278
.\}
 
279
.nf
 
280
BadMatch
 
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
 
284
       focused\&.
 
285
.fi
 
286
.if n \{\
 
287
.RE
 
288
.\}