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