544 lines
11 KiB
HTML
544 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of XIGRABBUTTON</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>XIGRABBUTTON</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>
|
|
|
|
XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode, XIGrabTouchBegin, XIUngrabTouchBegin - grab/ungrab buttons or keys
|
|
<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>
|
|
int XIGrabButton( Display *display,
|
|
int deviceid,
|
|
int button,
|
|
Window grab_window,
|
|
Cursor cursor,
|
|
int grab_mode,
|
|
int paired_device_mode,
|
|
Bool owner_events,
|
|
XIEventMask *mask,
|
|
int num_modifiers,
|
|
XIGrabModifiers *modifiers_inout);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
int XIUngrabButton( Display *display,
|
|
int deviceid,
|
|
int button,
|
|
Window grab_window,
|
|
int num_modifiers,
|
|
XIGrabModifiers *modifiers);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
int XIGrabKeycode( Display *display,
|
|
int deviceid,
|
|
int keycode,
|
|
Window grab_window,
|
|
int grab_mode,
|
|
int paired_device_mode,
|
|
Bool owner_events,
|
|
XIEventMask *mask,
|
|
int num_modifiers,
|
|
XIGrabModifiers *modifiers_inout);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
int XIUngrabKeycode( Display *display,
|
|
int deviceid,
|
|
int keycode,
|
|
Window grab_window,
|
|
int num_modifiers,
|
|
XIGrabModifiers *modifiers);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
int XIGrabTouchBegin( Display *display,
|
|
int deviceid,
|
|
Window grab_window,
|
|
Bool owner_events,
|
|
XIEventMask *mask,
|
|
int num_modifiers,
|
|
XIGrabModifiers *modifiers_inout);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
int XIUngrabTouchBegin( Display *display,
|
|
int deviceid,
|
|
Window grab_window,
|
|
int num_modifiers,
|
|
XIGrabModifiers *modifiers);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
display
|
|
Specifies the connection to the X server.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
device
|
|
Specifies the device that is to be grabbed or released
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
button
|
|
Specifies the device button that is to be grabbed or
|
|
released or XIAnyButton.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
keycode
|
|
Specifies the keycode that is to be grabbed or released
|
|
or XIAnyKeycode.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
num_modifiers
|
|
Number of elements in modifiers or modifiers_inout.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
modifiers
|
|
Specifies the set of latched and base modifiers or
|
|
XIAnyModifier to ungrab. The data type is for
|
|
consistency with the respective grab request and the
|
|
status code of the XIGrabModifiers struct is ignored.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
modifiers_inout
|
|
Specifies the set of latched and base modifiers or
|
|
XIAnyModifier to grab. Returns the modifiers that could
|
|
not be grabbed and their error code.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
grab_window
|
|
Specifies the grab window.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
owner_events
|
|
Specifies a Boolean value that indicates whether the are
|
|
to be reported as usual or reported with respect to the
|
|
grab window.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
mask
|
|
Specifies the event mask.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
grab_mode
|
|
Specifies further processing of events from this device.
|
|
You can pass XIGrabModeSync or XIGrabModeAsync.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
paired_device_mode
|
|
Specifies further processing of events from the paired
|
|
master device. You can pass XIGrabModeSync or
|
|
XIGrabModeAsync. If deviceid specifies a floating slave
|
|
device, this parameter is ignored.
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="1"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIGrabButton, XIGrabKeycode and XIGrabTouchBegin establish a passive
|
|
grab. The modifier device for a button grab is the paired master device
|
|
if deviceid specifies a master pointer. Otherwise, the modifier
|
|
device is the device specified with deviceid. In the future,
|
|
the device is actively grabbed (as for XIGrabDevice, the
|
|
last-grab time is set to the time at which the button or keycode
|
|
was pressed and the XI_ButtonPress or XI_KeyPress event is
|
|
reported if all of the following conditions are true:
|
|
* The device is not grabbed, and the specified button or
|
|
keycode is logically pressed or a touch event occurs when the
|
|
specified modifier keys are logically down on the modifier device
|
|
and no other buttons or modifier keys are logically down.
|
|
* Either the grab window is an ancestor of (or is) the focus
|
|
window, OR the grab window is a descendent of the focus
|
|
window and contains the device.
|
|
* A passive grab on the same button/modifier combination does
|
|
not exist on any ancestor of grab_window.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The interpretation of the remaining arguments is as for
|
|
XIGrabDevice. The active grab is terminated automatically when
|
|
the logical state of the device has all buttons or keys
|
|
released (independent of the logical state of the modifier
|
|
keys).
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If the device is an attached slave device, the device is
|
|
automatically detached from the master device when the grab
|
|
activates and reattached to the same master device when the
|
|
grab deactivates. 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="4"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
Note that the logical state of a device (as seen by client
|
|
applications) may lag the physical state if device event
|
|
processing is frozen.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="5"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
This request overrides all previous grabs by the same client on
|
|
the same button/modifier or keycode/modifier combinations on the
|
|
same window. A modifiers of XIAnyModifier is equivalent to
|
|
issuing the grab request for all possible modifier combinations
|
|
(including the combination of no modifiers). It is not required
|
|
that all modifiers specified have currently assigned KeyCodes.
|
|
A button of XIAnyButton is equivalent to issuing the request
|
|
for all possible buttons. Otherwise, it is not required that
|
|
the specified button currently be assigned to a physical
|
|
button.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="6"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If some other client has already issued a XIGrabButton or
|
|
XIGrabKeycode with the same button/modifier or keycode/modifier
|
|
combination on the same window, a BadAccess error results. When
|
|
using XIAnyModifier or XIAnyButton , the request fails
|
|
completely, and a XIBadAccess error results (no grabs are
|
|
established) if there is a conflicting grab for any
|
|
combination. XIGrabButton and XIGrabKeycode have no effect on an
|
|
active grab.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="7"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
On success, XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return 0;
|
|
If one or more modifier combinations could not be grabbed,
|
|
XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of
|
|
failed combinations and modifiers_inout contains the failed combinations
|
|
and their respective error codes.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="8"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIGrabButton, XIGrabKeycode and XIGrabTouchBegin can generate BadClass,
|
|
BadDevice, BadMatch, BadValue, and BadWindow errors.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="9"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin release the
|
|
passive grab for a button/modifier, keycode/modifier or touch/modifier
|
|
combination on the specified window if it was grabbed by this client. A
|
|
modifier of XIAnyModifier is equivalent to issuing the ungrab request
|
|
for all possible modifier combinations, including the
|
|
combination of no modifiers. A button of XIAnyButton is
|
|
equivalent to issuing the request for all possible buttons.
|
|
XIUngrabButton and XIUngrabKeycode have no effect on an active
|
|
grab.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="10"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin can generate
|
|
BadDevice, BadMatch, BadValue and BadWindow errors.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="11"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of
|
|
modifier combination that could not establish a passive grab. The
|
|
modifiers are returned in modifiers_inout, along with the respective
|
|
error for this modifier combination. If XIGrabButton, XIGrabKeycode
|
|
or XIGrabTouchBegin return zero, passive grabs with all requested
|
|
modifier combinations were established successfully.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>DIAGNOSTICS</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="12"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadDevice
|
|
An invalid deviceid was specified.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="13"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadMatch
|
|
This error may occur if XIGrabButton specified a device
|
|
that has no buttons, or XIGrabKeycode specified a device
|
|
that has no keys, or XIGrabTouchBegin specified a device
|
|
that is not touch-capable.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="14"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadValue
|
|
Some numeric value falls outside the range of values
|
|
accepted by the request. Unless a specific range is
|
|
specified for an argument, the full range defined by the
|
|
argument's type is accepted. Any argument defined as a
|
|
set of alternatives can generate this error.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="15"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
BadWindow
|
|
A value for a Window argument does not name a defined
|
|
Window.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="16"><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="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="17"><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="18"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="19"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="20"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="21"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="22"><A HREF="#lbAF">DIAGNOSTICS</A><DD>
|
|
<DT id="23"><A HREF="#lbAG">BUGS</A><DD>
|
|
<DT id="24"><A HREF="#lbAH">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>
|