XGETFEEDBACKCONTROL(3)
β¨ NAME β¨
okay so this is the XGETFEEDBACKCONTROL(3) page bestie!! it's all about XGetFeedbackControl and XChangeFeedbackControl β literally the two functions that let you query and change input device feedbacks π
πΈ SYNOPSIS πΈ
#include <X11/extensions/XInput.h>
XFeedbackState *XGetFeedbackControl( Display *display,
XDevice *device,
int *num_feedbacks);
int XChangeFeedbackControl( Display *display,
XDevice *device,
Mask mask,
XFeedbackControl *control);
displayβ the connection to the X server, obvi πdeviceβ the device whose feedbacks you wanna query or modify, bestienum_feedbacksβ an address where the number of feedbacks supported by the device gets written. it's giving "out parameter" energy β¨maskβ a mask that's specific to each type of feedback, describing how the feedback is to be modifiedcontrolβ the address of anXFeedbackControlstructure holding the new values for the feedback π«Ά
π DESCRIPTION π
okay so these requests exist to manipulate those input devices that support feedbacks. and no cap β if the requested device does not support feedbacks, you get a BadMatch error. rude but valid π
how do you even know if a device supports feedbacks?? you check the info that XOpenDevice hands you. for devices that do support feedbacks, XOpenDevice returns an XInputClassInfo structure with the input_class field equal to the constant FeedbackClass (defined in the file XI.h). iykyk π
the XGetFeedbackControl request returns a pointer to a list of XFeedbackState structures. each item in that list describes one of the feedbacks supported by the device. and here's the tea β the items are variable length, so each one contains its own length to let you traverse to the next item in the list. so iconic of them honestly π¦
the feedback classes that are currently defined are: KbdFeedbackClass, PtrFeedbackClass, StringFeedbackClass, IntegerFeedbackClass, LedFeedbackClass, and BellFeedbackClass. these constants live in the file XI.h β¨
an input device may support zero or more classes of feedback, and it may support multiple feedbacks of the same class. each feedback contains a class identifier and an id that is unique within that class for that input device. that id is the whole point β it's used to identify the feedback when you make an XChangeFeedbackControl request π
XGetFeedbackControl can generate a BadDevice or BadMatch error. noted, bestie.
the XChangeFeedbackControl request modifies the values of one feedback on the specified device. the feedback is identified by the id field of the XFeedbackControl structure that's passed with the request. the fields of the feedback that are to be modified are identified by the bits of the mask that's passed with the request π
XChangeFeedbackControl can generate a BadDevice, BadMatch, or BadValue error.
π Structures π
each class of feedback is described by a structure specific to that class. these structures are defined in the file XInput.h. XFeedbackState and XFeedbackControl are generic structures that contain three fields that sit at the beginning of each class of feedback:
typedef struct {
XID class;
int length;
XID id;
} XFeedbackState, XFeedbackControl;
the XKbdFeedbackState structure defines the attributes that are returned for feedbacks equivalent to those on the X keyboard β¨οΈ
typedef struct {
XID class;
int length;
XID id;
int click;
int percent;
int pitch;
int duration;
int led_mask;
int global_auto_repeat;
char auto_repeats[32];
} XKbdFeedbackState;
the XPtrFeedbackState structure defines the attributes that are returned for feedbacks equivalent to those on the the X pointer π±οΈ (yes it says "the the", i'm not fixing it, that's the source's little moment)
typedef struct {
XID class;
int length;
XID id;
int accelNum;
int accelDenom;
int threshold;
} XPtrFeedbackState;
the XIntegerFeedbackState structure defines attributes that are returned for integer feedbacks π’
typedef struct {
XID class;
int length;
XID id;
int resolution;
int minVal;
int maxVal;
} XIntegerFeedbackState;
the XStringFeedbackState structure defines the attributes that are returned for string feedbacks π§΅
typedef struct {
XID class;
int length;
XID id;
int max_symbols;
int num_syms_supported;
KeySym *syms_supported;
} XStringFeedbackState;
the XBellFeedbackState structure defines the attributes that are returned for bell feedbacks π
typedef struct {
XID class;
int length;
XID id;
int percent;
int pitch;
int duration;
} XBellFeedbackState;
the XLedFeedbackState structure defines the attributes that are returned for LED feedbacks π‘
typedef struct {
XID class;
int length;
XID id;
int led_values;
} XLedFeedbackState;
the XPrtFeedbackControl structure defines the attributes that can be controlled for pointer feedbacks β¨
typedef struct {
XID class;
int length;
XID id;
int accelNum;
int accelDenom;
int threshold;
} XPtrFeedbackControl;
the XKbdFeedbackControl structure defines the attributes that can be controlled for keyboard feedbacks β¨οΈπ
typedef struct {
XID class;
int length;
XID id;
int click;
int percent;
int pitch;
int duration;
int led_mask;
int led_value;
int key;
int auto_repeat_mode;
} XKbdFeedbackControl;
the XStringFeedbackControl structure defines the attributes that can be controlled for string feedbacks π
typedef struct {
XID class;
int length;
XID id;
int num_keysyms;
KeySym *syms_to_display;
} XStringFeedbackControl;
the XIntegerFeedbackControl structure defines the attributes that can be controlled for integer feedbacks π
typedef struct {
XID class;
int length;
XID id;
int int_to_display;
} XIntegerFeedbackControl;
the XBellFeedbackControl structure defines the attributes that can be controlled for bell feedbacks πβ¨
typedef struct {
XID class;
int length;
XID id;
int percent;
int pitch;
int duration;
} XBellFeedbackControl;
the XLedFeedbackControl structure defines the attributes that can be controlled for LED feedbacks π‘π
typedef struct {
XID class;
int length;
XID id;
int led_mask;
int led_values;
} XLedFeedbackControl;
π DIAGNOSTICS π
BadDeviceβ an invalid device was specified. the specified device does not exist, or it hasn't been opened by this client viaXOpenInputDevice. this error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via theXChangeKeyboardDeviceorXChangePointerDevicerequests π€BadMatchβ this error may occur if anXGetFeedbackControlrequest was made specifying a device that has no feedbacks, or anXChangeFeedbackControlrequest was made with anXFeedbackControlstructure that contains an invalid feedback type. it may also occur if an invalid combination of mask bits is specified (DvKeybut noDvAutoRepeatModefor keyboard feedbacks), or if an invalidKeySymis specified for a string feedback πBadValueβ some numeric value falls outside the range of values accepted by theXChangeFeedbackControlrequest. unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. any argument defined as a set of alternatives can generate this error π
lowkey if you're seeing these errors, check your device, your mask bits, and your KeySyms before you spiral. you got this bestie π«Ά
and that's the whole page!! this absolute banger of a man page is XGETFEEDBACKCONTROL(3), dated 05/18/2026 β so go forth and control those feedbacks, main character π
β¨πΈ
π¦ where this page comes from
- fedora 44: libXi-devel 1.8.3-1.fc44 Β· MIT-open-group AND SMLNJ AND MIT
- fedora 44: libXi-devel 1.8.3-1.fc44 Β· MIT-open-group AND SMLNJ AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms