1c27c18e8SmrgXISELECTEVENTS(libmansuffix) 2c27c18e8Smrg============================ 3c27c18e8Smrg 4c27c18e8SmrgNAME 5c27c18e8Smrg---- 6c27c18e8Smrg 7c27c18e8Smrg XISelectEvents, XIGetSelectedEvents - select for or get selected XI2 events on the window. 8c27c18e8Smrg 9c27c18e8SmrgSYNOPSIS 10c27c18e8Smrg-------- 11c27c18e8Smrg 12c27c18e8Smrg #include <X11/extensions/XInput2.h> 13c27c18e8Smrg 14c27c18e8Smrg Status XISelectEvents( Display *display, 15c27c18e8Smrg Window win, 16c27c18e8Smrg XIEventMask *masks, 17c27c18e8Smrg int num_masks); 18c27c18e8Smrg 19c27c18e8Smrg display 20c27c18e8Smrg Specifies the connection to the X server. 21c27c18e8Smrg 22c27c18e8Smrg masks 23c27c18e8Smrg Device event mask. 24c27c18e8Smrg 25c27c18e8Smrg num_masks 26c27c18e8Smrg Number of masks in masks. 27c27c18e8Smrg 28c27c18e8Smrg win 29c27c18e8Smrg Specifies the window. 30c27c18e8Smrg 31c27c18e8Smrg XIEventMask *XIGetSelectedEvents( Display *display, 32c27c18e8Smrg Window win, 33c27c18e8Smrg int *num_masks_return); 34c27c18e8Smrg 35c27c18e8Smrg display 36c27c18e8Smrg Specifies the connection to the X server. 37c27c18e8Smrg 38c27c18e8Smrg num_masks_return 39c27c18e8Smrg Number of masks in the return value. 40c27c18e8Smrg 41c27c18e8Smrg win 42c27c18e8Smrg Specifies the window. 43c27c18e8Smrg 44c27c18e8SmrgDESCRIPTION 45c27c18e8Smrg----------- 46c27c18e8Smrg 47c27c18e8Smrg XI2 events must be selected using XISelectEvents. 48c27c18e8Smrg 49c27c18e8Smrg XISelectEvents sets the event mask for this client on win. 50c27c18e8Smrg Further events are only reported to this client if the event 51c27c18e8Smrg type matches the selected event mask. The masks overrides the 52c27c18e8Smrg previously selected event mask for the given device. 53c27c18e8Smrg 54c27c18e8Smrg If deviceid is a valid device, the event mask is selected only 55c27c18e8Smrg for this device. If deviceid is XIAllDevices or 56c27c18e8Smrg XIAllMasterDevices, the event mask is selected for all devices 57c27c18e8Smrg or all master devices, respectively. The effective event mask 58c27c18e8Smrg is the bit-wise OR of the XIAllDevices, XIAllMasterDevices and 59c27c18e8Smrg the respective device's event mask. 60c27c18e8Smrg 61c27c18e8Smrg typedef struct { 62c27c18e8Smrg int deviceid; 63c27c18e8Smrg int mask_len; 64c27c18e8Smrg unsigned char* mask; 65c27c18e8Smrg } XIEventMask; 66c27c18e8Smrg 67c27c18e8Smrg The mask_len specifies the length of mask in bytes. mask is a 68c27c18e8Smrg binary mask in the form of (1 << event type). deviceid must be 69c27c18e8Smrg either a device or XIAllDevices or XIAllMasterDevices. A client 70c27c18e8Smrg may submit several masks with the same deviceid in one request 71c27c18e8Smrg but only the last mask will be effective. 72c27c18e8Smrg 73c27c18e8Smrg XISelectEvents can generate a BadValue, a BadDevice, and a 74c27c18e8Smrg BadWindow error. 75c27c18e8Smrg 76c27c18e8Smrg XIGetSelectedEvents returns the events selected by this client on the given 77c27c18e8Smrg window. If no events were selected on this window, XIGetSelectedEvents 78c27c18e8Smrg returns NULL and num_masks_return is set to 0. If an internal error occurs, 79c27c18e8Smrg XIGetSelectedEvents returns NULL and num_masks_return is set to -1. 80c27c18e8Smrg Otherwise, XIGetSelectedEvent returns the selected event masks for all 81c27c18e8Smrg devices including the masks for XIAllDevices and XIAllMasterDevices 82c27c18e8Smrg 83c27c18e8Smrg The caller must free the returned data using XFree(). 84c27c18e8Smrg 85c27c18e8Smrg 86c27c18e8SmrgDIAGNOSTICS 87c27c18e8Smrg----------- 88c27c18e8Smrg 89c27c18e8Smrg BadValue 90c27c18e8Smrg A value is outside of the permitted range. 91c27c18e8Smrg 92c27c18e8Smrg BadWindow 93c27c18e8Smrg A value for a Window argument does not name a defined 94c27c18e8Smrg window. 95c27c18e8Smrg 96c27c18e8Smrg BadDevice 97c27c18e8Smrg An invalid device was specified. The device does not 98c27c18e8Smrg exist. 99