6d76e215d1d1aac6c467e1d461ccd59a04d151fb
[platform/upstream/libXi.git] / man / XISetFocus.man
1 '\" t
2 .\"     Title: xisetfocus
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\"      Date: 09/23/2011
6 .\"    Manual: [FIXME: manual]
7 .\"    Source: [FIXME: source]
8 .\"  Language: English
9 .\"
10 .TH "XISETFOCUS" "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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 XISetFocus, XIGetFocus \- set or get the device\*(Aqs focus\&.
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 #include <X11/extensions/XInput2\&.h>
36 .fi
37 .sp
38 .nf
39 Status XISetFocus( Display *display,
40                    int deviceid,
41                    Window focus,
42                    Time time);
43 .fi
44 .sp
45 .nf
46 Status XIGetFocus( Display *display,
47                    Window *focus_return);
48 .fi
49 .sp
50 .nf
51 display
52        Specifies the connection to the X server\&.
53 .fi
54 .sp
55 .nf
56 deviceid
57        Specifies the device whose focus is to be queried or
58        changed\&.
59 .fi
60 .sp
61 .nf
62 focus
63        The new focus window\&.
64 .fi
65 .sp
66 .nf
67 focus_return
68        Returns the current focus window\&.
69 .fi
70 .sp
71 .nf
72 time
73        A valid timestamp or CurrentTime\&.
74 .fi
75 .SH "DESCRIPTION"
76 .sp
77 .if n \{\
78 .RS 4
79 .\}
80 .nf
81 XISetFocus changes the focus of the specified device ans its
82 last\-focus\-change time\&. It has no effect if the specified time
83 is earlier than the current last\-focus\-change time or is later
84 than the current X server time\&. Otherwise, the
85 last\-focus\-change time is set to the specified time\&.
86 CurrentTime is replaced by the current X server time)\&.
87 XISetFocus causes the X server to generate core, XI and XI2
88 focus events\&.
89 .fi
90 .if n \{\
91 .RE
92 .\}
93 .sp
94 .if n \{\
95 .RS 4
96 .\}
97 .nf
98 If the focus window is None all keyboard events by this device
99 are discarded until a new focus window is set\&. Otherwise, if
100 focus is a window, it becomes the device\*(Aqs focus window\&. If a
101 generated device event would normally be reported to this
102 window or one of its inferiors, the event is reported as usual\&.
103 Otherwise, the event is reported relative to the focus window\&.
104 .fi
105 .if n \{\
106 .RE
107 .\}
108 .sp
109 .if n \{\
110 .RS 4
111 .\}
112 .nf
113 The specified focus window must be viewable at the time
114 XISetFocus is called, or a BadMatch error results\&. If the focus
115 window later becomes not viewable, the focus reverts to the
116 parent (or the closest viewable ancestor\&. When the focus
117 reverts, the X server generates core, XI and XI2 focus events
118 but the last\-focus\-change time is not affected\&.
119 .fi
120 .if n \{\
121 .RE
122 .\}
123 .sp
124 .if n \{\
125 .RS 4
126 .\}
127 .nf
128 Attempting to set the focus on a master pointer device or an
129 attached slave device will result in a BadDevice error\&.
130 .fi
131 .if n \{\
132 .RE
133 .\}
134 .sp
135 .if n \{\
136 .RS 4
137 .\}
138 .nf
139 XISetFocus can generate BadDevice, BadMatch, BadValue, and
140 BadWindow errors\&.
141 .fi
142 .if n \{\
143 .RE
144 .\}
145 .SH "DIAGNOSTICS"
146 .sp
147 .if n \{\
148 .RS 4
149 .\}
150 .nf
151 BadValue
152        A value is outside of the permitted range\&.
153 .fi
154 .if n \{\
155 .RE
156 .\}
157 .sp
158 .if n \{\
159 .RS 4
160 .\}
161 .nf
162 BadDevice
163        An invalid device was specified\&. The device does not
164        exist or is not a appropriate for the type of change\&.
165 .fi
166 .if n \{\
167 .RE
168 .\}
169 .sp
170 .if n \{\
171 .RS 4
172 .\}
173 .nf
174 BadMatch
175        The window is not viewable\&.
176 .fi
177 .if n \{\
178 .RE
179 .\}
180 .sp
181 .if n \{\
182 .RS 4
183 .\}
184 .nf
185 BadWindow
186        A value for a Window argument does not name a defined
187        Window\&.
188 .fi
189 .if n \{\
190 .RE
191 .\}