XGetDeviceControl.txt revision c27c18e8
1c27c18e8SmrgXGETDEVICECONTROL(libmansuffix) 2c27c18e8Smrg=============================== 3c27c18e8Smrg 4c27c18e8SmrgNAME 5c27c18e8Smrg---- 6c27c18e8Smrg 7c27c18e8Smrg XGetDeviceControl, XChangeDeviceControl - query and change 8c27c18e8Smrg input device controls 9c27c18e8Smrg 10c27c18e8SmrgSYNOPSIS 11c27c18e8Smrg-------- 12c27c18e8Smrg 13c27c18e8Smrg #include <X11/extensions/XInput.h> 14c27c18e8Smrg 15c27c18e8Smrg XDeviceControl *XGetDeviceControl( Display *display, 16c27c18e8Smrg XDevice *device, 17c27c18e8Smrg int *controlType); 18c27c18e8Smrg 19c27c18e8Smrg int XChangeDeviceControl( Display *display, 20c27c18e8Smrg XDevice *device, 21c27c18e8Smrg int controlType, 22c27c18e8Smrg XDeviceControl *control); 23c27c18e8Smrg 24c27c18e8Smrg display 25c27c18e8Smrg Specifies the connection to the X server. 26c27c18e8Smrg 27c27c18e8Smrg device 28c27c18e8Smrg Specifies the device whose control is to be interrogated 29c27c18e8Smrg or modified. 30c27c18e8Smrg 31c27c18e8Smrg controlType 32c27c18e8Smrg Specifies the type of control to be interrogated or 33c27c18e8Smrg changed. 34c27c18e8Smrg 35c27c18e8Smrg control 36c27c18e8Smrg Specifies the address of an XDeviceControl structure 37c27c18e8Smrg that contains the new values for the Device. 38c27c18e8Smrg 39c27c18e8SmrgDESCRIPTION 40c27c18e8Smrg----------- 41c27c18e8Smrg 42c27c18e8Smrg These requests are provided to manipulate those input devices 43c27c18e8Smrg that support device control. A BadMatch error will be generated 44c27c18e8Smrg if the requested device does not support any device controls. 45c27c18e8Smrg 46c27c18e8Smrg Valid device control types that can be used with these requests 47c27c18e8Smrg include the following: 48c27c18e8Smrg 49c27c18e8Smrg DEVICE_RESOLUTION Queries or changes the resolution of 50c27c18e8Smrg valuators on input devices. 51c27c18e8Smrg 52c27c18e8Smrg The XGetDeviceControl request returns a pointer to an 53c27c18e8Smrg XDeviceControl structure. 54c27c18e8Smrg 55c27c18e8Smrg XGetDeviceControl can generate a BadDevice or BadMatch error. 56c27c18e8Smrg 57c27c18e8Smrg The XChangeDeviceControl request modifies the values of one 58c27c18e8Smrg control on the specified device. The control is identified by 59c27c18e8Smrg the id field of the XDeviceControl structure that is passed 60c27c18e8Smrg with the request. 61c27c18e8Smrg 62c27c18e8Smrg XChangeDeviceControl can generate a BadDevice, BadMatch, or 63c27c18e8Smrg BadValue error..SH STRUCTURES Each control is described by a 64c27c18e8Smrg structure specific to that control. These structures are 65c27c18e8Smrg defined in the file XInput.h. 66c27c18e8Smrg 67c27c18e8Smrg XDeviceControl is a generic structure that contains two fields 68c27c18e8Smrg that are at the beginning of each class of control: 69c27c18e8Smrg 70c27c18e8Smrg typedef struct { 71c27c18e8Smrg XID class; 72c27c18e8Smrg int length; 73c27c18e8Smrg } XDeviceControl; 74c27c18e8Smrg 75c27c18e8Smrg The XDeviceResolutionState structure defines the information 76c27c18e8Smrg that is returned for device resolution for devices with 77c27c18e8Smrg valuators. 78c27c18e8Smrg 79c27c18e8Smrg typedef struct { 80c27c18e8Smrg XID control; 81c27c18e8Smrg int length; 82c27c18e8Smrg int num_valuators; 83c27c18e8Smrg int* resolutions; 84c27c18e8Smrg int* min_resolutions; 85c27c18e8Smrg int* max_resolutions; 86c27c18e8Smrg } XDeviceResolutionState; 87c27c18e8Smrg 88c27c18e8Smrg The XDeviceResolutionControl structure defines the attributes 89c27c18e8Smrg that can be controlled for keyboard Devices. 90c27c18e8Smrg 91c27c18e8Smrg typedef struct { 92c27c18e8Smrg XID control; 93c27c18e8Smrg int length; 94c27c18e8Smrg int first_valuator; 95c27c18e8Smrg int num_valuators; 96c27c18e8Smrg int* resolutions; 97c27c18e8Smrg } XDeviceResolutionControl; 98c27c18e8Smrg 99c27c18e8SmrgDIAGNOSTICS 100c27c18e8Smrg----------- 101c27c18e8Smrg 102c27c18e8Smrg BadDevice 103c27c18e8Smrg An invalid device was specified. The specified device 104c27c18e8Smrg does not exist or has not been opened by this client via 105c27c18e8Smrg XOpenInputDevice. This error may also occur if some 106c27c18e8Smrg other client has caused the specified device to become 107c27c18e8Smrg the X keyboard or X pointer device via the 108c27c18e8Smrg XChangeKeyboardDevice or XChangePointerDevice requests. 109c27c18e8Smrg 110c27c18e8Smrg BadMatch 111c27c18e8Smrg This error may occur if an XGetDeviceControl request was 112c27c18e8Smrg made specifying a device that has no controls or an 113c27c18e8Smrg XChangeDeviceControl request was made with an 114c27c18e8Smrg XDeviceControl structure that contains an invalid Device 115c27c18e8Smrg type. It may also occur if an invalid combination of 116c27c18e8Smrg mask bits is specified ( DvKey but no DvAutoRepeatMode 117c27c18e8Smrg for keyboard Devices), or if an invalid KeySym is 118c27c18e8Smrg specified for a string Device. 119c27c18e8Smrg 120c27c18e8Smrg BadValue 121c27c18e8Smrg Some numeric value falls outside the range of values 122c27c18e8Smrg accepted by the XChangeDeviceControl request. Unless a 123c27c18e8Smrg specific range is specified for an argument, the full 124c27c18e8Smrg range defined by the argument's type is accepted. Any 125c27c18e8Smrg argument defined as a set of alternatives can generate 126c27c18e8Smrg this error. 127