1 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
11 .\" The above copyright notice and this permission notice shall be included
12 .\" in all copies or substantial portions of the Software.
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 .\" OTHER DEALINGS IN THE SOFTWARE.
22 .\" Except as contained in this notice, the name of the X Consortium shall
23 .\" not be used in advertising or otherwise to promote the sale, use or
24 .\" other dealings in this Software without prior written authorization
25 .\" from the X Consortium.
27 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
28 .\" Digital Equipment Corporation
30 .\" Portions Copyright \(co 1990, 1991 by
33 .\" Permission to use, copy, modify and distribute this documentation for
34 .\" any purpose and without fee is hereby granted, provided that the above
35 .\" copyright notice appears in all copies and that both that copyright notice
36 .\" and this permission notice appear in all copies, and that the names of
37 .\" Digital and Tektronix not be used in in advertising or publicity pertaining
38 .\" to this documentation without specific, written prior permission.
39 .\" Digital and Tektronix makes no representations about the suitability
40 .\" of this documentation for any purpose.
41 .\" It is provided ``as is'' without express or implied warranty.
44 .ds xT X Toolkit Intrinsics \- C Language Interface
45 .ds xW Athena X Widgets \- C Language X Toolkit Interface
46 .ds xL Xlib \- C Language X Interface
47 .ds xC Inter-Client Communication Conventions Manual
54 .\".if \\n(VS>=40 .vs \\n(VSu
55 .\".if \\n(VS<=39 .vs \\n(VSp
78 .de IN \" send an index entry to the stderr
85 .\" choose appropriate monospace font
86 .\" the imagen conditional, 480,
87 .\" may be changed to L if LB is too
88 .\" heavy for your eyes...
90 .ie "\\*(.T"480" .ft L
91 .el .ie "\\*(.T"300" .ft L
92 .el .ie "\\*(.T"202" .ft PO
93 .el .ie "\\*(.T"aps" .ft CW
96 .ie \\n(VS>40 .vs \\n(VSu
104 .ie t \\$1\fB\^\\$2\^\fR\\$3
105 .el \\$1\fI\^\\$2\^\fP\\$3
108 .ie t \fB\^\\$1\^\fR\\$2
109 .el \fI\^\\$1\^\fP\\$2
112 .ie t <\fB\\$1\fR>\\$2
118 .if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
119 .if \\n(.$ .if !'\\$1'C' .ds NO \\$1
133 . \" Note End -- doug kraft 3/85
142 .TH XGrabPointer __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
144 XGrabPointer, XUngrabPointer, XChangeActivePointerGrab \- grab the pointer
147 int XGrabPointer\^(\^Display *\fIdisplay\fP\^, Window \fIgrab_window\fP\^,
148 Bool \fIowner_events\fP\^, unsigned int \fIevent_mask\fP\^, int
149 \fIpointer_mode\fP\^, int \fIkeyboard_mode\fP\^, Window \fIconfine_to\fP\^,
150 Cursor \fIcursor\fP\^, Time \fItime\fP\^);
152 int XUngrabPointer\^(\^Display *\fIdisplay\fP\^, Time \fItime\fP\^);
154 int XChangeActivePointerGrab\^(\^Display *\fIdisplay\fP\^, unsigned int
155 \fIevent_mask\fP\^, Cursor \fIcursor\fP\^, Time \fItime\fP\^);
157 .IP \fIconfine_to\fP 1i
158 Specifies the window to confine the pointer in or
161 Specifies the cursor that is to be displayed during the grab or
164 Specifies the connection to the X server.
165 .IP \fIevent_mask\fP 1i
166 Specifies which pointer events are reported to the client.
167 The mask is the bitwise inclusive OR of the valid pointer event mask bits.
168 .IP \fIgrab_window\fP 1i
169 Specifies the grab window.
170 .IP \fIkeyboard_mode\fP 1i
171 Specifies further processing of keyboard events.
176 .IP \fIowner_events\fP 1i
177 Specifies a Boolean value that indicates whether the pointer
178 events are to be reported as usual or reported with respect to the grab window
179 if selected by the event mask.
180 .IP \fIpointer_mode\fP 1i
181 Specifies further processing of pointer events.
188 You can pass either a timestamp or
193 function actively grabs control of the pointer and returns
195 if the grab was successful.
196 Further pointer events are reported only to the grabbing client.
198 overrides any active pointer grab by this client.
201 all generated pointer events
202 are reported with respect to grab_window and are reported only if
203 selected by event_mask.
207 pointer event would normally be reported to this client,
208 it is reported as usual.
209 Otherwise, the event is reported with respect to the
210 grab_window and is reported only if selected by event_mask.
211 For either value of owner_events, unreported events are discarded.
213 If the pointer_mode is
215 pointer event processing continues as usual.
216 If the pointer is currently frozen by this client,
217 the processing of events for the pointer is resumed.
218 If the pointer_mode is
220 the state of the pointer, as seen by
222 appears to freeze, and the X server generates no further pointer events
223 until the grabbing client calls
225 or until the pointer grab is released.
226 Actual pointer changes are not lost while the pointer is frozen;
227 they are simply queued in the server for later processing.
229 If the keyboard_mode is
231 keyboard event processing is unaffected by activation of the grab.
232 If the keyboard_mode is
234 the state of the keyboard, as seen by
236 appears to freeze, and the X server generates no further keyboard events
237 until the grabbing client calls
239 or until the pointer grab is released.
240 Actual keyboard changes are not lost while the pointer is frozen;
241 they are simply queued in the server for later processing.
243 If a cursor is specified, it is displayed regardless of what
244 window the pointer is in.
248 the normal cursor for that window is displayed
249 when the pointer is in grab_window or one of its subwindows;
250 otherwise, the cursor for grab_window is displayed.
252 If a confine_to window is specified,
253 the pointer is restricted to stay contained in that window.
254 The confine_to window need have no relationship to the grab_window.
255 If the pointer is not initially in the confine_to window,
256 it is warped automatically to the closest edge
257 just before the grab activates and enter/leave events are generated as usual.
258 If the confine_to window is subsequently reconfigured,
259 the pointer is warped automatically, as necessary,
260 to keep it contained in the window.
262 The time argument allows you to avoid certain circumstances that come up
263 if applications take a long time to respond or if there are long network
265 Consider a situation where you have two applications, both
266 of which normally grab the pointer when clicked on.
267 If both applications specify the timestamp from the event,
268 the second application may wake up faster and successfully grab the pointer
269 before the first application.
270 The first application then will get an indication that the other application
271 grabbed the pointer before its request was processed.
280 Either if grab_window or confine_to window is not viewable
281 or if the confine_to window lies completely outside the boundaries of the root
285 .ZN GrabNotViewable .
286 If the pointer is actively grabbed by some other client,
289 If the pointer is frozen by an active grab of another client,
292 If the specified time is earlier than the last-pointer-grab time or later
293 than the current X server time, it fails and returns
294 .ZN GrabInvalidTime .
295 Otherwise, the last-pointer-grab time is set to the specified time
297 is replaced by the current X server time).
309 function releases the pointer and any queued events
310 if this client has actively grabbed the pointer from
313 or from a normal button press.
315 does not release the pointer if the specified
316 time is earlier than the last-pointer-grab time or is later than the
317 current X server time.
323 The X server performs an
325 request automatically if the event window or confine_to window
326 for an active pointer grab becomes not viewable
327 or if window reconfiguration causes the confine_to window to lie completely
328 outside the boundaries of the root window.
331 .ZN XChangeActivePointerGrab
332 function changes the specified dynamic parameters if the pointer is actively
333 grabbed by the client and if the specified time is no earlier than the
334 last-pointer-grab time and no later than the current X server time.
335 This function has no effect on the passive parameters of a
337 The interpretation of event_mask and cursor is the same as described in
340 .ZN XChangeActivePointerGrab
349 A value for a Cursor argument does not name a defined Cursor.
352 Some numeric value falls outside the range of values accepted by the request.
353 Unless a specific range is specified for an argument, the full range defined
354 by the argument's type is accepted. Any argument defined as a set of
355 alternatives can generate this error.
358 A value for a Window argument does not name a defined Window.
360 XAllowEvents(__libmansuffix__),
361 XGrabButton(__libmansuffix__),
362 XGrabKey(__libmansuffix__),
363 XGrabKeyboard(__libmansuffix__)