1XGRABDEVICEKEY(libmansuffix) 2============================ 3 4NAME 5---- 6 7 XGrabDeviceKey, XUngrabDeviceKey - grab/ungrab extension input 8 device Keys 9 10SYNOPSIS 11-------- 12 13 #include <X11/extensions/XInput.h> 14 15 int XGrabDeviceKey( Display *display, 16 XDevice *device, 17 unsigned int key, 18 unsigned int modifiers, 19 XDevice *modifier_device, 20 Window grab_window, 21 Bool owner_events, 22 unsigned int event_count, 23 XEventClass *event_list, 24 int this_device_mode, 25 int other_devices_mode); 26 27 int XUngrabDeviceKey( Display *display, 28 XDevice *device, 29 unsigned int key, 30 unsigned int modifiers, 31 XDevice *modifier_device, 32 Window grab_window); 33 34 display 35 Specifies the connection to the X server. 36 37 device 38 Specifies the device that is to be grabbed or released. 39 40 Key 41 Specifies the device Key that is to be grabbed released 42 or AnyKey. 43 44 modifiers 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. 49 50 modifier_device 51 Specifies the device whose modifiers are to be used. If 52 a modifier_device of NULL is specified, the X keyboard 53 will be used as the modifier_device. 54 55 grab_window 56 Specifies the grab window. 57 58 owner_events 59 Specifies a Boolean value that indicates whether the 60 device events are to be reported as usual or reported 61 with respect to the grab window if selected by the event 62 list. 63 64 event_count 65 Specifies the number of event classes in the event list. 66 67 event_list 68 Specifies which device events are reported to the 69 client. 70 71 this_device_mode 72 Specifies further processing of events from this 73 device. You can pass GrabModeSync or GrabModeAsync. 74 75 other_devices_mode 76 Specifies further processing of events from other 77 devices. You can pass GrabModeSync or GrabModeAsync. 78 79DESCRIPTION 80----------- 81 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 87 conditions are true: 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 91 logically down. 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 94 contains the device. 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. 98 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. 102 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. 106 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. 110 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. 120 121 If a modifier_device of NULL is specified, the X keyboard will 122 be used as the modifier_device. 123 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. 130 131 XGrabDeviceKey can generate BadAccess, BadClass, BadDevice, 132 BadMatch, BadValue, and BadWindow errors. It returns Success on 133 successful completion of the request. 134 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. 142 143 If a modifier_device of NULL is specified, the X keyboard will 144 be used as the modifier_device. 145 146 XUngrabDeviceKey can generate BadDevice, BadMatch, BadValue and 147 BadWindow errors. 148 149DIAGNOSTICS 150----------- 151 152 BadDevice 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. 157 158 BadMatch 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. 162 163 BadValue 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. 169 170 BadWindow 171 A value for a Window argument does not name a defined 172 Window. 173 174SEE ALSO 175-------- 176 177 XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceButton(libmansuffix) 178