summaryrefslogtreecommitdiff
path: root/man/XGetFeedbackControl.txt
blob: 820ff96448dce7e58e3a4d72e8bef698822dfff1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
XGETFEEDBACKCONTROL(libmansuffix)
=================================

NAME
----

   XGetFeedbackControl, XChangeFeedbackControl - 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
          Specifies the connection to the X server.

   device
          Specifies the device whose feedbacks are to be queried
          or modified.

   num_feedbacks
          Specifies an address into which the number of feedbacks
          supported by thedevice is to be returned.

   mask
          Specifies a mask specific to each type of feedback that
          describes howthe feedback is to be modified.

   control
          Specifies the address of an XFeedbackControl structure
          that containsthe new values for the feedback.

DESCRIPTION
-----------

   These requests are provided to manipulate those input devices
   that support feedbacks. A BadMatch error will be generated if
   the requested device does not support feedbacks. Whether or not
   a given device supports feedbacks can be determined by
   examining the information returned by the XOpenDevice request.
   For those devices that support feedbacks, XOpenDevice will
   return an XInputClassInfo structure with the input_class field
   equal to the constant FeedbackClass (defined in the file XI.h).

   The XGetFeedbackControl request returns a pointer to a list of
   XFeedbackState structures. Each item in this list describes one
   of the feedbacks supported by the device. The items are
   variable length, so each contains its length to allow traversal
   to the next item in the list.

   The feedback classes that are currently defined are:
   KbdFeedbackClass, PtrFeedbackClass, StringFeedbackClass,
   IntegerFeedbackClass, LedFeedbackClass, and BellFeedbackClass.
   These constants are defined in the file XI.h. An input device
   may support zero or more classes of feedback, and 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. The id is used to identify the feedback when
   making an XChangeFeedbackControl request.

   XGetFeedbackControl can generate a BadDevice or BadMatch error.

   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 is passed
   with the request. The fields of the feedback that are to be
   modified are identified by the bits of the mask that is 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 are 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.

            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 has not been opened by this client via
          XOpenInputDevice. This error may also occur if some
          other client has caused the specified device to become
          the X keyboard or X pointer device via the
          XChangeKeyboardDevice or XChangePointerDevice requests.

   BadMatch
          This error may occur if an XGetFeedbackControl request
          was made specifying a device that has no feedbacks, or
          an XChangeFeedbackControl request was made with an
          XFeedbackControl structure that contains an invalid
          feedback type. It may also occur if an invalid
          combination of mask bits is specified ( DvKey but no
          DvAutoRepeatMode for keyboard feedbacks), or if an
          invalid KeySym is specified for a string feedback.

   BadValue
          Some numeric value falls outside the range of values
          accepted by the XChangeFeedbackControl request. 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.