XGetFeedbackControl.txt revision c27c18e8
1c27c18e8SmrgXGETFEEDBACKCONTROL(libmansuffix) 2c27c18e8Smrg================================= 3c27c18e8Smrg 4c27c18e8SmrgNAME 5c27c18e8Smrg---- 6c27c18e8Smrg 7c27c18e8Smrg XGetFeedbackControl, XChangeFeedbackControl - query and change 8c27c18e8Smrg input device feedbacks 9c27c18e8Smrg 10c27c18e8SmrgSYNOPSIS 11c27c18e8Smrg-------- 12c27c18e8Smrg 13c27c18e8Smrg #include <X11/extensions/XInput.h> 14c27c18e8Smrg 15c27c18e8Smrg XFeedbackState *XGetFeedbackControl( Display *display, 16c27c18e8Smrg XDevice *device, 17c27c18e8Smrg int *num_feedbacks); 18c27c18e8Smrg 19c27c18e8Smrg int XChangeFeedbackControl( Display *display, 20c27c18e8Smrg XDevice *device, 21c27c18e8Smrg Mask mask, 22c27c18e8Smrg XFeedbackControl *control); 23c27c18e8Smrg 24c27c18e8Smrg display 25c27c18e8Smrg Specifies the connection to the X server. 26c27c18e8Smrg 27c27c18e8Smrg device 28c27c18e8Smrg Specifies the device whose feedbacks are to be queried 29c27c18e8Smrg or modified. 30c27c18e8Smrg 31c27c18e8Smrg num_feedbacks 32c27c18e8Smrg Specifies an address into which the number of feedbacks 33c27c18e8Smrg supported by thedevice is to be returned. 34c27c18e8Smrg 35c27c18e8Smrg mask 36c27c18e8Smrg Specifies a mask specific to each type of feedback that 37c27c18e8Smrg describes howthe feedback is to be modified. 38c27c18e8Smrg 39c27c18e8Smrg control 40c27c18e8Smrg Specifies the address of an XFeedbackControl structure 41c27c18e8Smrg that containsthe new values for the feedback. 42c27c18e8Smrg 43c27c18e8SmrgDESCRIPTION 44c27c18e8Smrg----------- 45c27c18e8Smrg 46c27c18e8Smrg These requests are provided to manipulate those input devices 47c27c18e8Smrg that support feedbacks. A BadMatch error will be generated if 48c27c18e8Smrg the requested device does not support feedbacks. Whether or not 49c27c18e8Smrg a given device supports feedbacks can be determined by 50c27c18e8Smrg examining the information returned by the XOpenDevice request. 51c27c18e8Smrg For those devices that support feedbacks, XOpenDevice will 52c27c18e8Smrg return an XInputClassInfo structure with the input_class field 53c27c18e8Smrg equal to the constant FeedbackClass (defined in the file XI.h). 54c27c18e8Smrg 55c27c18e8Smrg The XGetFeedbackControl request returns a pointer to a list of 56c27c18e8Smrg XFeedbackState structures. Each item in this list describes one 57c27c18e8Smrg of the feedbacks supported by the device. The items are 58c27c18e8Smrg variable length, so each contains its length to allow traversal 59c27c18e8Smrg to the next item in the list. 60c27c18e8Smrg 61c27c18e8Smrg The feedback classes that are currently defined are: 62c27c18e8Smrg KbdFeedbackClass, PtrFeedbackClass, StringFeedbackClass, 63c27c18e8Smrg IntegerFeedbackClass, LedFeedbackClass, and BellFeedbackClass. 64c27c18e8Smrg These constants are defined in the file XI.h. An input device 65c27c18e8Smrg may support zero or more classes of feedback, and may support 66c27c18e8Smrg multiple feedbacks of the same class. Each feedback contains a 67c27c18e8Smrg class identifier and an id that is unique within that class for 68c27c18e8Smrg that input device. The id is used to identify the feedback when 69c27c18e8Smrg making an XChangeFeedbackControl request. 70c27c18e8Smrg 71c27c18e8Smrg XGetFeedbackControl can generate a BadDevice or BadMatch error. 72c27c18e8Smrg 73c27c18e8Smrg The XChangeFeedbackControl request modifies the values of one 74c27c18e8Smrg feedback on the specified device. The feedback is identified by 75c27c18e8Smrg the id field of the XFeedbackControl structure that is passed 76c27c18e8Smrg with the request. The fields of the feedback that are to be 77c27c18e8Smrg modified are identified by the bits of the mask that is passed 78c27c18e8Smrg with the request. 79c27c18e8Smrg 80c27c18e8Smrg XChangeFeedbackControl can generate a BadDevice, BadMatch, or 81c27c18e8Smrg BadValue error. 82c27c18e8Smrg 83c27c18e8SmrgStructures 84c27c18e8Smrg 85c27c18e8Smrg Each class of feedback is described by a structure specific to 86c27c18e8Smrg that class. These structures are defined in the file XInput.h. 87c27c18e8Smrg XFeedbackState and XFeedbackControl are generic structures that 88c27c18e8Smrg contain three fields that are at the beginning of each class of 89c27c18e8Smrg feedback: 90c27c18e8Smrg 91c27c18e8Smrg typedef struct { 92c27c18e8Smrg XID class; 93c27c18e8Smrg int length; 94c27c18e8Smrg XID id; 95c27c18e8Smrg } XFeedbackState, 96c27c18e8Smrg XFeedbackControl; 97c27c18e8Smrg 98c27c18e8Smrg The XKbdFeedbackState structure defines the attributes that are 99c27c18e8Smrg returned for feedbacks equivalent to those on the X keyboard. 100c27c18e8Smrg 101c27c18e8Smrg typedef struct { 102c27c18e8Smrg XID class; 103c27c18e8Smrg int length; 104c27c18e8Smrg XID id; 105c27c18e8Smrg int click; 106c27c18e8Smrg int percent; 107c27c18e8Smrg int pitch; 108c27c18e8Smrg int duration; 109c27c18e8Smrg int led_mask; 110c27c18e8Smrg int global_auto_repeat; 111c27c18e8Smrg char auto_repeats[32]; 112c27c18e8Smrg } XKbdFeedbackState; 113c27c18e8Smrg 114c27c18e8Smrg The XPtrFeedbackState structure defines the attributes that are 115c27c18e8Smrg returned for feedbacks equivalent to those on the the X 116c27c18e8Smrg pointer. 117c27c18e8Smrg 118c27c18e8Smrg typedef struct { 119c27c18e8Smrg XID class; 120c27c18e8Smrg int length; 121c27c18e8Smrg XID id; 122c27c18e8Smrg int accelNum; 123c27c18e8Smrg int accelDenom; 124c27c18e8Smrg int threshold; 125c27c18e8Smrg } XPtrFeedbackState; 126c27c18e8Smrg 127c27c18e8Smrg The XIntegerFeedbackState structure defines attributes that are 128c27c18e8Smrg returned for integer feedbacks. 129c27c18e8Smrg 130c27c18e8Smrg typedef struct { 131c27c18e8Smrg XID class; 132c27c18e8Smrg int length; 133c27c18e8Smrg XID id; 134c27c18e8Smrg int resolution; 135c27c18e8Smrg int minVal; 136c27c18e8Smrg int maxVal; 137c27c18e8Smrg } XIntegerFeedbackState; 138c27c18e8Smrg 139c27c18e8Smrg The XStringFeedbackState structure defines the attributes that 140c27c18e8Smrg are returned for string feedbacks. 141c27c18e8Smrg 142c27c18e8Smrg typedef struct { 143c27c18e8Smrg XID class; 144c27c18e8Smrg int length; 145c27c18e8Smrg XID id; 146c27c18e8Smrg int max_symbols; 147c27c18e8Smrg int num_syms_supported; 148c27c18e8Smrg KeySym *syms_supported; 149c27c18e8Smrg } XStringFeedbackState; 150c27c18e8Smrg 151c27c18e8Smrg The XBellFeedbackState structure defines the attributes that 152c27c18e8Smrg are returned for bell feedbacks. 153c27c18e8Smrg 154c27c18e8Smrg typedef struct { 155c27c18e8Smrg XID class; 156c27c18e8Smrg int length; 157c27c18e8Smrg XID id; 158c27c18e8Smrg int percent; 159c27c18e8Smrg int pitch; 160c27c18e8Smrg int duration; 161c27c18e8Smrg } XBellFeedbackState; 162c27c18e8Smrg 163c27c18e8Smrg The XLedFeedbackState structure defines the attributes that are 164c27c18e8Smrg returned for LED feedbacks. 165c27c18e8Smrg 166c27c18e8Smrg typedef struct { XID class; 167c27c18e8Smrg int length; 168c27c18e8Smrg XID id; 169c27c18e8Smrg int led_values; 170c27c18e8Smrg } XLedFeedbackState; 171c27c18e8Smrg 172c27c18e8Smrg The XPrtFeedbackControl structure defines the attributes that 173c27c18e8Smrg can be controlled for pointer feedbacks. 174c27c18e8Smrg 175c27c18e8Smrg typedef struct { 176c27c18e8Smrg XID class; 177c27c18e8Smrg int length; 178c27c18e8Smrg XID id; 179c27c18e8Smrg int accelNum; 180c27c18e8Smrg int accelDenom; 181c27c18e8Smrg int threshold; 182c27c18e8Smrg } XPtrFeedbackControl; 183c27c18e8Smrg 184c27c18e8Smrg The XKbdFeedbackControl structure defines the attributes that 185c27c18e8Smrg can be controlled for keyboard feedbacks. 186c27c18e8Smrg 187c27c18e8Smrg typedef struct { 188c27c18e8Smrg XID class; 189c27c18e8Smrg int length; 190c27c18e8Smrg XID id; 191c27c18e8Smrg int click; 192c27c18e8Smrg int percent; 193c27c18e8Smrg int pitch; 194c27c18e8Smrg int duration; 195c27c18e8Smrg int led_mask; 196c27c18e8Smrg int led_value; 197c27c18e8Smrg int key; 198c27c18e8Smrg int auto_repeat_mode; 199c27c18e8Smrg } XKbdFeedbackControl; 200c27c18e8Smrg 201c27c18e8Smrg The XStringFeedbackControl structure defines the attributes 202c27c18e8Smrg that can be controlled for string feedbacks. 203c27c18e8Smrg 204c27c18e8Smrg typedef struct { 205c27c18e8Smrg XID class; 206c27c18e8Smrg int length; 207c27c18e8Smrg XID id; 208c27c18e8Smrg int num_keysyms; 209c27c18e8Smrg KeySym *syms_to_display; 210c27c18e8Smrg } XStringFeedbackControl; 211c27c18e8Smrg 212c27c18e8Smrg The XIntegerFeedbackControl structure defines the attributes 213c27c18e8Smrg that can be controlled for integer feedbacks. 214c27c18e8Smrg 215c27c18e8Smrg typedef struct { 216c27c18e8Smrg XID class; 217c27c18e8Smrg int length; 218c27c18e8Smrg XID id; 219c27c18e8Smrg int int_to_display; 220c27c18e8Smrg } XIntegerFeedbackControl; 221c27c18e8Smrg 222c27c18e8Smrg The XBellFeedbackControl structure defines the attributes that 223c27c18e8Smrg can be controlled for bell feedbacks. 224c27c18e8Smrg 225c27c18e8Smrg typedef struct { 226c27c18e8Smrg XID class; 227c27c18e8Smrg int length; 228c27c18e8Smrg XID id; 229c27c18e8Smrg int percent; 230c27c18e8Smrg int pitch; 231c27c18e8Smrg int duration; 232c27c18e8Smrg } XBellFeedbackControl; 233c27c18e8Smrg 234c27c18e8Smrg The XLedFeedbackControl structure defines the attributes that 235c27c18e8Smrg can be controlled for LED feedbacks. 236c27c18e8Smrg 237c27c18e8Smrg typedef struct { 238c27c18e8Smrg XID class; 239c27c18e8Smrg int length; 240c27c18e8Smrg XID id; 241c27c18e8Smrg int led_mask; 242c27c18e8Smrg int led_values; 243c27c18e8Smrg } XLedFeedbackControl; 244c27c18e8Smrg 245c27c18e8SmrgDIAGNOSTICS 246c27c18e8Smrg----------- 247c27c18e8Smrg 248c27c18e8Smrg BadDevice 249c27c18e8Smrg An invalid device was specified. The specified device 250c27c18e8Smrg does not exist or has not been opened by this client via 251c27c18e8Smrg XOpenInputDevice. This error may also occur if some 252c27c18e8Smrg other client has caused the specified device to become 253c27c18e8Smrg the X keyboard or X pointer device via the 254c27c18e8Smrg XChangeKeyboardDevice or XChangePointerDevice requests. 255c27c18e8Smrg 256c27c18e8Smrg BadMatch 257c27c18e8Smrg This error may occur if an XGetFeedbackControl request 258c27c18e8Smrg was made specifying a device that has no feedbacks, or 259c27c18e8Smrg an XChangeFeedbackControl request was made with an 260c27c18e8Smrg XFeedbackControl structure that contains an invalid 261c27c18e8Smrg feedback type. It may also occur if an invalid 262c27c18e8Smrg combination of mask bits is specified ( DvKey but no 263c27c18e8Smrg DvAutoRepeatMode for keyboard feedbacks), or if an 264c27c18e8Smrg invalid KeySym is specified for a string feedback. 265c27c18e8Smrg 266c27c18e8Smrg BadValue 267c27c18e8Smrg Some numeric value falls outside the range of values 268c27c18e8Smrg accepted by the XChangeFeedbackControl request. Unless a 269c27c18e8Smrg specific range is specified for an argument, the full 270c27c18e8Smrg range defined by the argument's type is accepted. Any 271c27c18e8Smrg argument defined as a set of alternatives can generate 272c27c18e8Smrg this error. 273