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 3387404ef7Smrg supported by the device is to be returned. 34c27c18e8Smrg 35c27c18e8Smrg mask 36c27c18e8Smrg Specifies a mask specific to each type of feedback that 3787404ef7Smrg describes how the feedback is to be modified. 38c27c18e8Smrg 39c27c18e8Smrg control 40c27c18e8Smrg Specifies the address of an XFeedbackControl structure 4187404ef7Smrg that contains the 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 84f1ee322dSmrg~~~~~~~~~~ 85c27c18e8Smrg 86c27c18e8Smrg Each class of feedback is described by a structure specific to 87c27c18e8Smrg that class. These structures are defined in the file XInput.h. 88c27c18e8Smrg XFeedbackState and XFeedbackControl are generic structures that 89c27c18e8Smrg contain three fields that are at the beginning of each class of 90c27c18e8Smrg feedback: 91c27c18e8Smrg 92f1ee322dSmrg typedef struct { 93c27c18e8Smrg XID class; 94c27c18e8Smrg int length; 95c27c18e8Smrg XID id; 96f1ee322dSmrg } XFeedbackState, XFeedbackControl; 97c27c18e8Smrg 98c27c18e8Smrg The XKbdFeedbackState structure defines the attributes that are 99c27c18e8Smrg returned for feedbacks equivalent to those on the X keyboard. 100c27c18e8Smrg 101f1ee322dSmrg 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]; 112f1ee322dSmrg } 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 118f1ee322dSmrg typedef struct { 119c27c18e8Smrg XID class; 120c27c18e8Smrg int length; 121c27c18e8Smrg XID id; 122c27c18e8Smrg int accelNum; 123c27c18e8Smrg int accelDenom; 124c27c18e8Smrg int threshold; 125f1ee322dSmrg } XPtrFeedbackState; 126c27c18e8Smrg 127c27c18e8Smrg The XIntegerFeedbackState structure defines attributes that are 128c27c18e8Smrg returned for integer feedbacks. 129c27c18e8Smrg 130f1ee322dSmrg typedef struct { 131c27c18e8Smrg XID class; 132c27c18e8Smrg int length; 133c27c18e8Smrg XID id; 134c27c18e8Smrg int resolution; 135c27c18e8Smrg int minVal; 136c27c18e8Smrg int maxVal; 137f1ee322dSmrg } XIntegerFeedbackState; 138c27c18e8Smrg 139c27c18e8Smrg The XStringFeedbackState structure defines the attributes that 140c27c18e8Smrg are returned for string feedbacks. 141c27c18e8Smrg 142f1ee322dSmrg typedef struct { 143c27c18e8Smrg XID class; 144c27c18e8Smrg int length; 145c27c18e8Smrg XID id; 146c27c18e8Smrg int max_symbols; 147c27c18e8Smrg int num_syms_supported; 148c27c18e8Smrg KeySym *syms_supported; 149f1ee322dSmrg } XStringFeedbackState; 150c27c18e8Smrg 151c27c18e8Smrg The XBellFeedbackState structure defines the attributes that 152c27c18e8Smrg are returned for bell feedbacks. 153c27c18e8Smrg 154f1ee322dSmrg typedef struct { 155c27c18e8Smrg XID class; 156c27c18e8Smrg int length; 157c27c18e8Smrg XID id; 158c27c18e8Smrg int percent; 159c27c18e8Smrg int pitch; 160c27c18e8Smrg int duration; 161f1ee322dSmrg } XBellFeedbackState; 162c27c18e8Smrg 163c27c18e8Smrg The XLedFeedbackState structure defines the attributes that are 164c27c18e8Smrg returned for LED feedbacks. 165c27c18e8Smrg 166f1ee322dSmrg typedef struct { 167f1ee322dSmrg XID class; 168c27c18e8Smrg int length; 169c27c18e8Smrg XID id; 170c27c18e8Smrg int led_values; 171f1ee322dSmrg } XLedFeedbackState; 172c27c18e8Smrg 173c27c18e8Smrg The XPrtFeedbackControl structure defines the attributes that 174c27c18e8Smrg can be controlled for pointer feedbacks. 175c27c18e8Smrg 176f1ee322dSmrg typedef struct { 177c27c18e8Smrg XID class; 178c27c18e8Smrg int length; 179c27c18e8Smrg XID id; 180c27c18e8Smrg int accelNum; 181c27c18e8Smrg int accelDenom; 182c27c18e8Smrg int threshold; 183f1ee322dSmrg } XPtrFeedbackControl; 184c27c18e8Smrg 185c27c18e8Smrg The XKbdFeedbackControl structure defines the attributes that 186c27c18e8Smrg can be controlled for keyboard feedbacks. 187c27c18e8Smrg 188f1ee322dSmrg typedef struct { 189c27c18e8Smrg XID class; 190c27c18e8Smrg int length; 191c27c18e8Smrg XID id; 192c27c18e8Smrg int click; 193c27c18e8Smrg int percent; 194c27c18e8Smrg int pitch; 195c27c18e8Smrg int duration; 196c27c18e8Smrg int led_mask; 197c27c18e8Smrg int led_value; 198c27c18e8Smrg int key; 199c27c18e8Smrg int auto_repeat_mode; 200f1ee322dSmrg } XKbdFeedbackControl; 201c27c18e8Smrg 202c27c18e8Smrg The XStringFeedbackControl structure defines the attributes 203c27c18e8Smrg that can be controlled for string feedbacks. 204c27c18e8Smrg 205f1ee322dSmrg typedef struct { 206c27c18e8Smrg XID class; 207c27c18e8Smrg int length; 208c27c18e8Smrg XID id; 209c27c18e8Smrg int num_keysyms; 210c27c18e8Smrg KeySym *syms_to_display; 211f1ee322dSmrg } XStringFeedbackControl; 212c27c18e8Smrg 213c27c18e8Smrg The XIntegerFeedbackControl structure defines the attributes 214c27c18e8Smrg that can be controlled for integer feedbacks. 215c27c18e8Smrg 216f1ee322dSmrg typedef struct { 217c27c18e8Smrg XID class; 218c27c18e8Smrg int length; 219c27c18e8Smrg XID id; 220c27c18e8Smrg int int_to_display; 221f1ee322dSmrg } XIntegerFeedbackControl; 222c27c18e8Smrg 223c27c18e8Smrg The XBellFeedbackControl structure defines the attributes that 224c27c18e8Smrg can be controlled for bell feedbacks. 225c27c18e8Smrg 226f1ee322dSmrg typedef struct { 227c27c18e8Smrg XID class; 228c27c18e8Smrg int length; 229c27c18e8Smrg XID id; 230c27c18e8Smrg int percent; 231c27c18e8Smrg int pitch; 232c27c18e8Smrg int duration; 233f1ee322dSmrg } XBellFeedbackControl; 234c27c18e8Smrg 235c27c18e8Smrg The XLedFeedbackControl structure defines the attributes that 236c27c18e8Smrg can be controlled for LED feedbacks. 237c27c18e8Smrg 238f1ee322dSmrg typedef struct { 239c27c18e8Smrg XID class; 240c27c18e8Smrg int length; 241c27c18e8Smrg XID id; 242c27c18e8Smrg int led_mask; 243c27c18e8Smrg int led_values; 244f1ee322dSmrg } XLedFeedbackControl; 245c27c18e8Smrg 246c27c18e8SmrgDIAGNOSTICS 247c27c18e8Smrg----------- 248c27c18e8Smrg 249c27c18e8Smrg BadDevice 250c27c18e8Smrg An invalid device was specified. The specified device 251c27c18e8Smrg does not exist or has not been opened by this client via 252c27c18e8Smrg XOpenInputDevice. This error may also occur if some 253c27c18e8Smrg other client has caused the specified device to become 254c27c18e8Smrg the X keyboard or X pointer device via the 255c27c18e8Smrg XChangeKeyboardDevice or XChangePointerDevice requests. 256c27c18e8Smrg 257c27c18e8Smrg BadMatch 258c27c18e8Smrg This error may occur if an XGetFeedbackControl request 259c27c18e8Smrg was made specifying a device that has no feedbacks, or 260c27c18e8Smrg an XChangeFeedbackControl request was made with an 261c27c18e8Smrg XFeedbackControl structure that contains an invalid 262c27c18e8Smrg feedback type. It may also occur if an invalid 263c27c18e8Smrg combination of mask bits is specified ( DvKey but no 264c27c18e8Smrg DvAutoRepeatMode for keyboard feedbacks), or if an 265c27c18e8Smrg invalid KeySym is specified for a string feedback. 266c27c18e8Smrg 267c27c18e8Smrg BadValue 268c27c18e8Smrg Some numeric value falls outside the range of values 269c27c18e8Smrg accepted by the XChangeFeedbackControl request. Unless a 270c27c18e8Smrg specific range is specified for an argument, the full 271c27c18e8Smrg range defined by the argument's type is accepted. Any 272c27c18e8Smrg argument defined as a set of alternatives can generate 273c27c18e8Smrg this error. 274