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