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