1 XGRABDEVICEKEY(libmansuffix)
2 ============================
7 XGrabDeviceKey, XUngrabDeviceKey - grab/ungrab extension input
13 #include <X11/extensions/XInput.h>
15 int XGrabDeviceKey( Display *display,
18 unsigned int modifiers,
19 XDevice *modifier_device,
22 unsigned int event_count,
23 XEventClass *event_list,
25 int other_devices_mode);
27 int XUngrabDeviceKey( Display *display,
30 unsigned int modifiers,
31 XDevice *modifier_device,
35 Specifies the connection to the X server.
38 Specifies the device that is to be grabbed or released.
41 Specifies the device Key that is to be grabbed released
45 Specifies the set of keymasks or AnyModifier.The mask is
46 the bitwise inclusive OR of the valid keymask bits.Valid
47 bits are: ShiftMask, LockMask, ControlMask, Mod1Mask,
48 Mod2Mask,Mod3Mask, Mod4Mask, Mod5Mask.
51 Specifies the device whose modifiers are to be used. If
52 a modifier_device ofNULL is specified, the X keyboard
53 will be used as the modifier_device.
56 Specifies the grab window.
59 Specifies a Boolean value that indicates whether the
60 deviceevents are to be reported as usual or reported
61 with respect to the grab windowif selected by the event
65 Specifies the number of event classes in the event list.
68 Specifies which device events are reported to the
72 Specifies further processing of events from this
73 device.You can pass GrabModeSync or GrabModeAsync.
76 Specifies further processing of events from other
77 devices.You can pass GrabModeSyncor GrabModeAsync.
82 The XGrabDeviceKey request establishes a passive grab. In the
83 future, the device is actively grabbed (as for XGrabDevice, the
84 last-device-grab time is set to the time at which the Key was
85 pressed (as transmitted in the DeviceKeyPress event), and the
86 DeviceKeyPress event is reported if all of the following
88 * The device is not grabbed, and the specified key is
89 logically pressed when the specified modifier keys are
90 logically down, and no other keys or modifier keys are
92 * The grab_window is an ancestor (or is) the focus window OR
93 the grab window is a descendant of the focus window and
95 * The confine_to window (if any) is viewable.
96 * A passive grab on the same key/modifier combination does
97 not exist on any ancestor of grab_window.
99 The interpretation of the remaining arguments is as for
100 XGrabDevice. The active grab is terminated automatically when
101 the logical state of the device has the specified key released.
103 Note that the logical state of a device (as seen by means of
104 the X protocol ) may lag the physical state if device event
105 processing is frozen.
107 If the key is not AnyKey, it must be in the range specified by
108 min_keycode and max_keycode as returned by the
109 XListInputDevices request. Otherwise, a BadValue error results.
111 This request overrides all previous grabs by the same client on
112 the same Key/modifier combinations on the same window. A
113 modifier of AnyModifier is equivalent to issuing the grab
114 request for all possible modifier combinations (including the
115 combination of no modifiers). It is not required that all
116 modifiers specified have currently assigned KeyCodes. A key of
117 AnyKey is equivalent to issuing the request for all possible
118 keys. Otherwise, it is not required that the specified key
119 currently be assigned to a physical Key.
121 If a modifier_device of NULL is specified, the X keyboard will
122 be used as the modifier_device.
124 If some other client has already issued a XGrabDeviceKey with
125 the same Key/modifier combination on the same window, a
126 BadAccess error results. When using AnyModifier or AnyKey, the
127 request fails completely, and a BadAccess error results (no
128 grabs are established) if there is a conflicting grab for any
129 combination.XGrabDeviceKey has no effect on an active grab.
131 XGrabDeviceKey can generate BadAccess, BadClass, BadDevice,
132 BadMatch, BadValue, and BadWindow errors. It returns Success on
133 successful completion of the request.
135 The XUngrabDeviceKey request releases the passive grab for a
136 key/modifier combination on the specified window if it was
137 grabbed by this client. A modifier of AnyModifier is equivalent
138 to issuing the ungrab request for all possible modifier
139 combinations, including the combination of no modifiers. A Key
140 of AnyKey is equivalent to issuing the request for all possible
141 Keys.XUngrabDeviceKey has no effect on an active grab.
143 If a modifier_device of NULL is specified, the X keyboard will
144 be used as the modifier_device.
146 XUngrabDeviceKey can generate BadDevice, BadMatch, BadValue and
153 An invalid device was specified. The specified device
154 does not exist or has not been opened by this client via
155 XOpenInputDevice. This error may also occur if the
156 specified device is the X keyboard or X pointer device.
159 This error may occur if an XGrabDeviceKey request was
160 made specifying a device that has no keys, or a modifier
161 device that has no keys.
164 Some numeric value falls outside the range of values
165 accepted by the request. Unless a specific range is
166 specified for an argument, the full range defined by the
167 argument's type is accepted. Any argument defined as a
168 set of alternatives can generate this error.
171 A value for a Window argument does not name a defined
177 XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceButton(libmansuffix)