1c27c18e8SmrgXGRABDEVICEBUTTON(libmansuffix) 2c27c18e8Smrg=============================== 3c27c18e8Smrg 4c27c18e8SmrgNAME 5c27c18e8Smrg---- 6c27c18e8Smrg 7c27c18e8Smrg XGrabDeviceButton, XUngrabDeviceButton - grab/ungrab extension 8c27c18e8Smrg input device buttons 9c27c18e8Smrg 10c27c18e8SmrgSYNOPSIS 11c27c18e8Smrg-------- 12c27c18e8Smrg 13c27c18e8Smrg #include <X11/extensions/XInput.h> 14c27c18e8Smrg 15c27c18e8Smrg int XGrabDeviceButton( Display *display, 16c27c18e8Smrg XDevice *device, 17c27c18e8Smrg unsigned int button, 18c27c18e8Smrg unsigned int modifiers, 19c27c18e8Smrg XDevice* modifier_device, 20c27c18e8Smrg Window grab_window, 21c27c18e8Smrg Bool owner_events, 22c27c18e8Smrg unsigned int event_count, 23c27c18e8Smrg XEventClass *event_list, 24c27c18e8Smrg int this_device_mode, 25c27c18e8Smrg int other_devices_mode); 26c27c18e8Smrg 27c27c18e8Smrg int XUngrabDeviceButton( Display *display, 28c27c18e8Smrg XDevice *device, 29c27c18e8Smrg unsigned int button, 30c27c18e8Smrg unsigned int modifiers, 31c27c18e8Smrg XDevice* modifier_device, 32c27c18e8Smrg Window grab_window); 33c27c18e8Smrg 34c27c18e8Smrg display 35c27c18e8Smrg Specifies the connection to the X server. 36c27c18e8Smrg 37c27c18e8Smrg device 38c27c18e8Smrg Specifies the device that is to be grabbed or released 39c27c18e8Smrg 40c27c18e8Smrg button 41c27c18e8Smrg Specifies the device button that is to be grabbed or 42c27c18e8Smrg released or AnyButton. 43c27c18e8Smrg 44c27c18e8Smrg modifiers 4587404ef7Smrg Specifies the set of keymasks or AnyModifier. The mask is 46c27c18e8Smrg the bitwise inclusive OR of the valid keymask bits. 4787404ef7Smrg Valid bits are: ShiftMask, LockMask, ControlMask, 4887404ef7Smrg Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask. 49c27c18e8Smrg 50c27c18e8Smrg modifier_device 51c27c18e8Smrg specifies the device whose modifiers are to be used. If 524940c694Smrg the modifier_device specified is NULL, the X keyboard 53c27c18e8Smrg will be used as the modifier_device. 54c27c18e8Smrg 55c27c18e8Smrg grab_window 56c27c18e8Smrg Specifies the grab window. 57c27c18e8Smrg 58c27c18e8Smrg owner_events 59c27c18e8Smrg Specifies a Boolean value that indicates whether the 604940c694Smrg device events are to be reported as usual or reported 614940c694Smrg with respect to the grab window if selected by the event 62c27c18e8Smrg list. 63c27c18e8Smrg 64c27c18e8Smrg event_count 65c27c18e8Smrg Specifies the number of event classes in the event list. 66c27c18e8Smrg 67c27c18e8Smrg event_list 68c27c18e8Smrg Specifies which events are reported to the client. 69c27c18e8Smrg 70c27c18e8Smrg this_device_mode 71c27c18e8Smrg Specifies further processing of events from this 724940c694Smrg device. You can pass GrabModeSync or GrabModeAsync. 73c27c18e8Smrg 74c27c18e8Smrg other_devices_mode 75c27c18e8Smrg Specifies further processing of events from all other 764940c694Smrg devices. You can pass GrabModeSync or GrabModeAsync. 77c27c18e8Smrg 78c27c18e8SmrgDESCRIPTION 79c27c18e8Smrg----------- 80c27c18e8Smrg 81c27c18e8Smrg The XGrabDeviceButton request establishes a passive grab. In 82c27c18e8Smrg the future, the device is actively grabbed (as for XGrabDevice, 83c27c18e8Smrg the last-grab time is set to the time at which the button was 84c27c18e8Smrg pressed (as transmitted in the DeviceButtonPress event), and 85c27c18e8Smrg the DeviceButtonPress event is reported if all of the following 86c27c18e8Smrg conditions are true: 87c27c18e8Smrg * The device is not grabbed, and the specified button is 88c27c18e8Smrg logically pressed when the specified modifier keys are 89c27c18e8Smrg logically down on the specified modifier device and no 90c27c18e8Smrg other buttons or modifier keys are logically down. 91c27c18e8Smrg * Either the grab window is an ancestor of (or is) the focus 92c27c18e8Smrg window, OR the grab window is a descendent of the focus 93c27c18e8Smrg window and contains the device. 94c27c18e8Smrg * A passive grab on the same button/modifier combination does 95c27c18e8Smrg not exist on any ancestor of grab_window. 96c27c18e8Smrg 97c27c18e8Smrg The interpretation of the remaining arguments is as for 98c27c18e8Smrg XGrabDevice. The active grab is terminated automatically when 99c27c18e8Smrg the logical state of the device has all buttons released 100c27c18e8Smrg (independent of the logical state of the modifier keys). 101c27c18e8Smrg 102c27c18e8Smrg Note that the logical state of a device (as seen by client 103c27c18e8Smrg applications) may lag the physical state if device event 104c27c18e8Smrg processing is frozen. 105c27c18e8Smrg 106c27c18e8Smrg This request overrides all previous grabs by the same client on 107c27c18e8Smrg the same button/modifier combinations on the same window. A 108c27c18e8Smrg modifiers of AnyModifier is equivalent to issuing the grab 109c27c18e8Smrg request for all possible modifier combinations (including the 110c27c18e8Smrg combination of no modifiers). It is not required that all 111c27c18e8Smrg modifiers specified have currently assigned KeyCodes. A button 112c27c18e8Smrg of AnyButton is equivalent to issuing the request for all 113c27c18e8Smrg possible buttons. Otherwise, it is not required that the 114c27c18e8Smrg specified button currently be assigned to a physical button. 115c27c18e8Smrg 116c27c18e8Smrg A modifier_device of NULL indicates that the X keyboard is to 117c27c18e8Smrg be used as the modifier_device. 118c27c18e8Smrg 119c27c18e8Smrg If some other client has already issued a XGrabDeviceButton 120c27c18e8Smrg with the same button/modifier combination on the same window, a 121c27c18e8Smrg BadAccess error results. When using AnyModifier or AnyButton , 122c27c18e8Smrg the request fails completely, and a BadAccess error results (no 123c27c18e8Smrg grabs are established) if there is a conflicting grab for any 124c27c18e8Smrg combination. XGrabDeviceButton has no effect on an active grab. 125c27c18e8Smrg 126c27c18e8Smrg XGrabDeviceButton can generate BadClass, BadDevice, BadMatch, 12787404ef7Smrg BadValue, and BadWindow errors. 12887404ef7Smrg 12987404ef7Smrg The XUngrabDeviceButton request releases the passive grab for a 13087404ef7Smrg button/modifier combination on the specified window if it was 13187404ef7Smrg grabbed by this client. A modifier of AnyModifier is equivalent to 13287404ef7Smrg issuing the ungrab request for all possible modifier combinations, 13387404ef7Smrg including the combination of no modifiers. A button of AnyButton is 13487404ef7Smrg equivalent to issuing the request for all possible buttons. 13587404ef7Smrg XUngrabDeviceButton has no effect on an active grab. 136c27c18e8Smrg 137c27c18e8Smrg A modifier_device of NULL indicates that the X keyboard should 138c27c18e8Smrg be used as the modifier_device. 139c27c18e8Smrg 140c27c18e8Smrg XUngrabDeviceButton can generate BadDevice, BadMatch, BadValue 141c27c18e8Smrg and BadWindow errors. 142c27c18e8Smrg 143c27c18e8SmrgDIAGNOSTICS 144c27c18e8Smrg----------- 145c27c18e8Smrg 146c27c18e8Smrg BadDevice 147c27c18e8Smrg An invalid device was specified. The specified device 148c27c18e8Smrg does not exist or has not been opened by this client via 149c27c18e8Smrg XOpenInputDevice. This error may also occur if the 150c27c18e8Smrg specified device is the X keyboard or X pointer device. 151c27c18e8Smrg 152c27c18e8Smrg BadMatch 153c27c18e8Smrg This error may occur if an XGrabDeviceButton request was 154c27c18e8Smrg made specifying a device that has no buttons, or 155c27c18e8Smrg specifying a modifier device that has no keys. 156c27c18e8Smrg 157c27c18e8Smrg BadValue 158c27c18e8Smrg Some numeric value falls outside the range of values 159c27c18e8Smrg accepted by the request. Unless a specific range is 160c27c18e8Smrg specified for an argument, the full range defined by the 161c27c18e8Smrg argument's type is accepted. Any argument defined as a 162c27c18e8Smrg set of alternatives can generate this error. 163c27c18e8Smrg 164c27c18e8Smrg BadWindow 165c27c18e8Smrg A value for a Window argument does not name a defined 166c27c18e8Smrg Window. 167c27c18e8Smrg 168c27c18e8SmrgSEE ALSO 169c27c18e8Smrg-------- 170c27c18e8Smrg 171c27c18e8Smrg XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceKey(libmansuffix) 172