summaryrefslogtreecommitdiff
path: root/man/XListInputDevices.man
blob: e0f06c501637e6c917e0524628f7b84b0181fe19 (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
.\"
.\" $XFree86: xc/doc/man/Xi/XListDev.man,v 1.2 2001/01/27 18:20:21 dawes Exp $
.\"
.\"
.\" Copyright ([\d,\s]*) by Hewlett-Packard Company, Ardent Computer, 
.\" 
.\" Permission to use, copy, modify, distribute, and sell this documentation 
.\" for any purpose and without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\" Ardent, and Hewlett-Packard make no representations about the 
.\" suitability for any purpose of the information in this document.  It is 
.\" provided \`\`as is'' without express or implied warranty.
.\" 
.\" $Xorg: XListDev.man,v 1.3 2000/08/17 19:41:56 cpqbld Exp $
.ds xL Programming with Xlib
.TH XListInputDevices 3X11 __xorgversion__ "X FUNCTIONS"
.SH NAME
XListInputDevices, XFreeDeviceList \- list available input devices
.SH SYNTAX
.HP
XDeviceInfo *XListInputDevices\^(\^Display *\fIdisplay\fP\^, int
*\fIndevices_return\fP\^); 
.HP
int XFreeDeviceList\^(\^XDeviceInfo *\fIlist\fP\^); 
.SH ARGUMENTS
.TP 12
.I display
Specifies the connection to the X server.
.TP 12
.I ndevices_return
Specifies a pointer to a variable where the number of available devices can
be returned.
.TP 12
.I list
Specifies the list of devices to free.  The \fIXFreeDeviceList\fP function
frees the list of available extension input devices.
.SH DESCRIPTION
The \fIXListInputDevices\fP
request lists the available extension input devices.  This list includes the
X pointer and X keyboard, any other input devices that are currently accessible
through the X server, and any input devices that are not currently accessible
through the X server but could be accessed if requested.
.LP
Some server implementations may make all input devices available at the time
the server is initialized.  Others may wait until requested by a client to
access an input device.  In the latter case, it is possible that an input 
device will be listed as available at one time but not at another.
.LP
For each input device available to the server, the XListInputDevices
request returns an XDeviceInfo structure.  That structure contains a
pointer to a list of structures, each of which contains information about 
one class of input supported by the device.

The XDeviceInfo structure is defined as follows:

.DS
.nf
typedef struct _XDeviceInfo
{
	XID		id;        
	Atom		type;
	char		*name;
	int		num_classes;
	int		use;
	XAnyClassPtr	inputclassinfo;
} XDeviceInfo;
.fi
.DE
.LP
The id is a number in the range 0-128 that uniquely identifies 
the device.  It is assigned to the device when it is initialized by the server.
.LP
The type field is of type Atom and indicates the nature
of the device.
.LP
The name field contains a pointer to a null-terminated
string that corresponds to one of the defined device
types.  The name will correspond to one of the following
strings (defined in the header file \fIXI.h\fP:
.LP
.DS
XI_MOUSE
XI_TABLET
XI_KEYBOARD
XI_TOUCHSCREEN
XI_TOUCHPAD
XI_BUTTONBOX
XI_BARCODE
XI_TRACKBALL
XI_QUADRATURE
XI_ID_MODULE
XI_ONE_KNOB
XI_NINE_KNOB
XI_KNOB_BOX
XI_SPACEBALL
XI_DATAGLOVE
XI_EYETRACKER
XI_CURSORKEYS
XI_FOOTMOUSE
.DE
.LP
These names may be directly compared with the name field of the
XDeviceInfo structure, or used in an XInternAtom request to return
an atom that can be compared with the type field of the XDeviceInfo
structure.
.LP
The num_classes field is a number in the
range 0-255 that specifies the number of input classes
supported by the device for which information is
returned by ListInputDevices.  Some input classes, such
as class Focus and class Proximity do not have any
information to be returned by ListInputDevices.
.LP
The use field specifies how the device is currently
being used.  If the value is \fIIsXKeyboard\fP, the device is
currently being used as the X keyboard.  If the value
is \fIIsXPointer\fP, the device is currently being used as
the X pointer.  If the value is \fIIsXExtensionDevice\fP, the
device is available for use as an extension device.
.LP
The inputclassinfo field contains a pointer to the first input-class
specific data.  The first two fields are common to all
classes.
.LP
The class field is a number in the range 0-255.
It uniquely identifies the class of input for which
information is returned.  Currently defined classes
are KeyClass, ButtonClass, and ValuatorClass.
.LP
The length field is a number in the range 0- 255.  
It specifies the number of bytes of data that are
contained in this input class.  The length includes the
class and length fields.
.LP
The XKeyInfo structure describes the characteristics of the keys on the
device.  It is defined as follows:
.LP
.DS
.nf
typedef struct _XKeyInfo {
	XID			class;
	int			length;
	unsigned short		min_keycode;
	unsigned short		max_keycode;
	unsigned short		num_keys;
} XKeyInfo;
.fi
.DE
.LP
min_keycode is of type KEYCODE.  It specifies the
minimum keycode that the device will report.  The
minimum keycode will not be smaller than 8.
.LP
max_keycode is of type KEYCODE.  It specifies the
maximum keycode that the device will report.  The
maximum keycode will not be larger than 255.
.LP
num_keys specifies the number of keys that the device has.
.LP
The XButtonInfo structure defines the characteristics of the buttons
on the device.  It is defined as follows:
.LP
.DS
.nf
typedef struct _XButtonInfo {
	XID		class;
	int		length;
	short		num_buttons;
} XButtonInfo;
.fi
.DE
.LP
num_buttons specifies the number of buttons that the device has.
.LP
The XValuatorInfo structure defines the characteristics of the valuators
on the device.  It is defined as follows:
.LP
.DE
.nf
typedef struct	_XValuatorInfo {
	XID			class;
	int			length;
	unsigned char		num_axes;
	unsigned char		mode;
	unsigned long		motion_buffer;
	XAxisInfoPtr		axes;
} XValuatorInfo;
.fi
.DS
num_axes contains the number of axes the device supports.
.LP
mode is a constant that has one of the following
values: Absolute or Relative.  Some devices allow the
mode to be changed dynamically via the SetDeviceMode
request.
.LP
motion_buffer_size is a cardinal number that specifies
the number of elements that can be contained in the
motion history buffer for the device.
.LP
The axes field contains a pointer to an XAxisInfo structure.
.LP
The XAxisInfo structure is defined as follows:
.LP
.DS
.nf
typedef struct _XAxisInfo {
	int 	resolution;
	int 	min_value;
	int 	max_value;
} XAxisInfo;
.fi
.DE
.LP
The resolution contains a number in counts/meter.
.LP
The min_val field contains a number that specifies
the minimum value the device reports for this axis.
For devices whose mode is Relative, the min_val field
will contain 0.
.LP
The max_val field contains a number that specifies
the maximum value the device reports for this axis.
For devices whose mode is Relative, the max_val field
will contain 0.
.LP
To free the \fIXDeviceInfo\fP array created by \fIXListInputDevices\fP,
use \fIXFreeDeviceList\fP.
.SH DIAGNOSTICS
none.
.SH "SEE ALSO"
.br
\fI\*(xL\fP