424 lines
7.0 KiB
HTML
424 lines
7.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of XIGRABDEVICE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>XIGRABDEVICE</H1>
|
|
Section: (3)<BR>Updated: 06/19/2019<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
XIGrabDevice, XIUngrabDevice - grab or ungrab the device.
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<PRE>
|
|
#include <<A HREF="file:///usr/include/X11/extensions/XInput2.h">X11/extensions/XInput2.h</A>>
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
Status XIGrabDevice( Display *display,
|
|
int deviceid,
|
|
Window grab_window,
|
|
Time time,
|
|
Cursor cursor,
|
|
int grab_mode,
|
|
int paired_device_mode,
|
|
Bool owner_events,
|
|
XIEventMask *mask);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
Status XIUngrabDevice( Display *display,
|
|
int deviceid,
|
|
Time time);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
cursor
|
|
Specifies the cursor image to display for the duration
|
|
of the grab.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
display
|
|
Specifies the connection to the X server.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
deviceid
|
|
Specifies the device that should be grabbed or
|
|
ungrabbed.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
grab_mode, paired_device_mode
|
|
The grab mode for this device and (if applicable) the
|
|
paired device.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
grab_window
|
|
The grab window.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
mask
|
|
Event mask.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
owner_events
|
|
True if events are to be reported normally.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
time
|
|
A valid timestamp or CurrentTime.
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="1"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIGrabDevice actively grabs control of the device. Further
|
|
device events are reported only to the grabbing client.
|
|
XIGrabDevice overrides any active device grab by this client.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If the device is an attached slave device, the device is
|
|
automatically detached from the master device and reattached to
|
|
the same master device when client ungrabs the device. If the
|
|
master device is removed while the device is floating as a
|
|
result of a grab, the device remains floating once the grab
|
|
deactivates.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If owner_events is False, all generated device events are
|
|
reported with respect to grab_window if selected. If
|
|
owner_events is True and if a generated device event would
|
|
normally be reported to this client, it is reported normally;
|
|
otherwise, the event is reported with respect to the
|
|
grab_window, and is only reported if specified in the event
|
|
mask.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="4"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If the grab_mode argument is XIGrabModeAsync, device event
|
|
processing continues as usual. If the device is currently
|
|
frozen by this client, then processing of device events is
|
|
resumed. If the grab_mode argument is XIGrabModeSync, the state
|
|
of the device (as seen by client applications) appears to
|
|
freeze, and the X server generates no further device events
|
|
until the grabbing client issues a releasing XIAllowEvents call
|
|
or until the device grab is released. Actual device changes are
|
|
not lost while the device is frozen; they are simply queued in
|
|
the server for later processing.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="5"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If paired_device_mode is XIGrabModeAsync, processing of events
|
|
from the paired master device is unaffected by activation of
|
|
the grab. If paired_device_mode is XIGrabModeSync, the state of
|
|
the paired master device (as seen by client applications)
|
|
appears to freeze, and the X server generates no further events
|
|
from this device until the grabbing client issues a releasing
|
|
XIAllowEvents call or until the device grab is released. Actual
|
|
events are not lost while the devices are frozen; they are
|
|
simply queued in the server for later processing. If the device
|
|
is a slave device paired_device_mode is ignored.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="6"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If the device is actively grabbed by some other client,
|
|
XIGrabDevice fails and returns AlreadyGrabbed. If grab_window
|
|
is not viewable, it fails and returns GrabNotViewable. If the
|
|
device is frozen by an active grab of another client, it fails
|
|
and returns GrabFrozen. If the specified time is earlier than
|
|
the last-device-grab time or later than the current X server
|
|
time, it fails and returns GrabInvalidTime. Otherwise, the
|
|
last-device-grab time is set to the specified time. CurrentTime
|
|
is replaced by the current X server time.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="7"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If cursor is not None this cursor is displayed until the client
|
|
calls XIUngrabDevice.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="8"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIGrabDevice can generate BadDevice, BadValue, and BadWindow
|
|
errors.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="9"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XIUngrabDevice request releases the device and any queued
|
|
events if this client has it actively grabbed from either
|
|
XIGrabDevice or XIGrabKey or XIGrabButton. If other devices are
|
|
frozen by the grab, XUngrabDevice thaws them. XUngrabDevice
|
|
does not release the device and any queued events if the
|
|
specified time is earlier than the last-device-grab time or is
|
|
later than the current X server time. The X server
|
|
automatically performs an XIUngrabDevice request if the event
|
|
window for an active device grab becomes not viewable.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="10"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIUngrabDevice can generate a BadDevice error.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DIAGNOSTICS</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="11"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadValue
|
|
A value is outside of the permitted range.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="12"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadDevice
|
|
An invalid device was specified. The device does not
|
|
exist or is not a appropriate for the type of change.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="13"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadMatch
|
|
The window is not viewable.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="14"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadWindow
|
|
A value for a Window argument does not name a defined
|
|
Window.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="15"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The protocol headers for XI 2.0 did not provide
|
|
XIGrabModeAsync or XIGrabModeSync. Use GrabModeSync and
|
|
GrabModeAsync instead, respectively.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="16"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
<A HREF="/cgi-bin/man/man2html?3+XIAllowEvents">XIAllowEvents</A>(3)
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="17"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="18"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="19"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="20"><A HREF="#lbAE">DIAGNOSTICS</A><DD>
|
|
<DT id="21"><A HREF="#lbAF">BUGS</A><DD>
|
|
<DT id="22"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:01 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|