1XListInputDevices(3) X FUNCTIONS XListInputDevices(3)
2
3
4
6 XListInputDevices, XFreeDeviceList - list available input devices
7
9 XDeviceInfo *XListInputDevices(Display *display, int *ndevices_return);
10
11 int XFreeDeviceList(XDeviceInfo *list);
12
14 display Specifies the connection to the X server.
15
16 ndevices_return
17 Specifies a pointer to a variable where the number of
18 available devices can be returned.
19
20 list Specifies the list of devices to free. The XFreeDeviceList
21 function frees the list of available extension input
22 devices.
23
25 The XListInputDevices request lists the available extension input
26 devices. This list includes the X pointer and X keyboard, any other
27 input devices that are currently accessible through the X server, and
28 any input devices that are not currently accessible through the X
29 server but could be accessed if requested.
30
31 Some server implementations may make all input devices available at the
32 time the server is initialized. Others may wait until requested by a
33 client to access an input device. In the latter case, it is possible
34 that an input device will be listed as available at one time but not at
35 another.
36
37 For each input device available to the server, the XListInputDevices
38 request returns an XDeviceInfo structure. That structure contains a
39 pointer to a list of structures, each of which contains information
40 about one class of input supported by the device.
41
42 The XDeviceInfo structure is defined as follows:
43
44 typedef struct _XDeviceInfo
45 {
46 XID id;
47 Atom type;
48 char *name;
49 int num_classes;
50 int use;
51 XAnyClassPtr inputclassinfo;
52 } XDeviceInfo;
53
54 The id is a number in the range 0-128 that uniquely identifies the
55 device. It is assigned to the device when it is initialized by the
56 server.
57
58 The type field is of type Atom and indicates the nature of the device.
59
60 The name field contains a pointer to a null-terminated string that cor‐
61 responds to one of the defined device types. The name will correspond
62 to one of the following strings (defined in the header file XI.h:
63
64 XI_MOUSE XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD XI_BUTTONBOX
65 XI_BARCODE XI_TRACKBALL XI_QUADRATURE XI_ID_MODULE XI_ONE_KNOB
66 XI_NINE_KNOB XI_KNOB_BOX XI_SPACEBALL XI_DATAGLOVE XI_EYETRACKER
67 XI_CURSORKEYS XI_FOOTMOUSE
68
69 These names may be directly compared with the name field of the XDevi‐
70 ceInfo structure, or used in an XInternAtom request to return an atom
71 that can be compared with the type field of the XDeviceInfo structure.
72
73 The num_classes field is a number in the range 0-255 that specifies the
74 number of input classes supported by the device for which information
75 is returned by ListInputDevices. Some input classes, such as class
76 Focus and class Proximity do not have any information to be returned by
77 ListInputDevices.
78
79 The use field specifies how the device is currently being used. If the
80 value is IsXKeyboard, the device is currently being used as the X key‐
81 board. If the value is IsXPointer, the device is currently being used
82 as the X pointer. If the value is IsXExtensionDevice, the device is
83 available for use as an extension device.
84
85 The inputclassinfo field contains a pointer to the first input-class
86 specific data. The first two fields are common to all classes.
87
88 The class field is a number in the range 0-255. It uniquely identifies
89 the class of input for which information is returned. Currently
90 defined classes are KeyClass, ButtonClass, and ValuatorClass.
91
92 The length field is a number in the range 0- 255. It specifies the
93 number of bytes of data that are contained in this input class. The
94 length includes the class and length fields.
95
96 The XKeyInfo structure describes the characteristics of the keys on the
97 device. It is defined as follows:
98
99 typedef struct _XKeyInfo {
100 XID class;
101 int length;
102 unsigned short min_keycode;
103 unsigned short max_keycode;
104 unsigned short num_keys;
105 } XKeyInfo;
106
107 min_keycode is of type KEYCODE. It specifies the minimum keycode that
108 the device will report. The minimum keycode will not be smaller than
109 8.
110
111 max_keycode is of type KEYCODE. It specifies the maximum keycode that
112 the device will report. The maximum keycode will not be larger than
113 255.
114
115 num_keys specifies the number of keys that the device has.
116
117 The XButtonInfo structure defines the characteristics of the buttons on
118 the device. It is defined as follows:
119
120 typedef struct _XButtonInfo {
121 XID class;
122 int length;
123 short num_buttons;
124 } XButtonInfo;
125
126 num_buttons specifies the number of buttons that the device has.
127
128 The XValuatorInfo structure defines the characteristics of the valua‐
129 tors on the device. It is defined as follows:
130
131 typedef struct _XValuatorInfo {
132 XID class;
133 int length;
134 unsigned char num_axes;
135 unsigned char mode;
136 unsigned long motion_buffer;
137 XAxisInfoPtr axes;
138 } XValuatorInfo;
139 num_axes contains the number of axes the device supports.
140
141 mode is a constant that has one of the following values: Absolute or
142 Relative. Some devices allow the mode to be changed dynamically via
143 the SetDeviceMode request.
144
145 motion_buffer_size is a cardinal number that specifies the number of
146 elements that can be contained in the motion history buffer for the
147 device.
148
149 The axes field contains a pointer to an XAxisInfo structure.
150
151 The XAxisInfo structure is defined as follows:
152
153 typedef struct _XAxisInfo {
154 int resolution;
155 int min_value;
156 int max_value;
157 } XAxisInfo;
158
159 The resolution contains a number in counts/meter.
160
161 The min_val field contains a number that specifies the minimum value
162 the device reports for this axis. For devices whose mode is Relative,
163 the min_val field will contain 0.
164
165 The max_val field contains a number that specifies the maximum value
166 the device reports for this axis. For devices whose mode is Relative,
167 the max_val field will contain 0.
168
169 To free the XDeviceInfo array created by XListInputDevices, use
170 XFreeDeviceList.
171
173 none.
174
176 Programming with Xlib
177
178
179
180X Version 11 libXi 1.1.1 XListInputDevices(3)