2
.\" $XFree86: xc/doc/man/Xi/XListDev.man,v 1.2 2001/01/27 18:20:21 dawes Exp $
5
.\" Copyright ([\d,\s]*) by Hewlett-Packard Company, Ardent Computer,
7
.\" Permission to use, copy, modify, distribute, and sell this documentation
8
.\" for any purpose and without fee is hereby granted, provided that the above
9
.\" copyright notice and this permission notice appear in all copies.
10
.\" Ardent, and Hewlett-Packard make no representations about the
11
.\" suitability for any purpose of the information in this document. It is
12
.\" provided \`\`as is'' without express or implied warranty.
14
.\" $Xorg: XListDev.man,v 1.3 2000/08/17 19:41:56 cpqbld Exp $
15
.ds xL Programming with Xlib
16
.TH XListInputDevices __LIB_MAN_SUFFIX__ __xorgversion__ "X FUNCTIONS"
2
.\" Title: xlistinputdevices
3
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
.\" Generator: DocBook XSL Stylesheets v1.74.3 <http://docbook.sf.net/>
6
.\" Manual: [FIXME: manual]
7
.\" Source: [FIXME: source]
10
.TH "XLISTINPUTDEVICES" "libmansuffix" "10/02/2009" "[FIXME: source]" "[FIXME: manual]"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
18
22
XListInputDevices, XFreeDeviceList \- list available input devices
21
XDeviceInfo *XListInputDevices\^(\^Display *\fIdisplay\fP\^, int
22
*\fIndevices_return\fP\^);
24
int XFreeDeviceList\^(\^XDeviceInfo *\fIlist\fP\^);
28
Specifies the connection to the X server.
31
Specifies a pointer to a variable where the number of available devices can
35
Specifies the list of devices to free. The \fIXFreeDeviceList\fP function
36
frees the list of available extension input devices.
38
The \fIXListInputDevices\fP
39
request lists the available extension input devices. This list includes the
40
X pointer and X keyboard, any other input devices that are currently accessible
41
through the X server, and any input devices that are not currently accessible
42
through the X server but could be accessed if requested.
44
Some server implementations may make all input devices available at the time
45
the server is initialized. Others may wait until requested by a client to
46
access an input device. In the latter case, it is possible that an input
47
device will be listed as available at one time but not at another.
49
For each input device available to the server, the XListInputDevices
50
request returns an XDeviceInfo structure. That structure contains a
51
pointer to a list of structures, each of which contains information about
52
one class of input supported by the device.
54
The XDeviceInfo structure is defined as follows:
58
typedef struct _XDeviceInfo
65
XAnyClassPtr inputclassinfo;
70
The id is a number in the range 0-128 that uniquely identifies
71
the device. It is assigned to the device when it is initialized by the server.
73
The type field is of type Atom and indicates the nature
76
The name field contains a pointer to a null-terminated
77
string that corresponds to one of the defined device
78
types. The name will correspond to one of the following
79
strings (defined in the header file \fIXI.h\fP:
103
These names may be directly compared with the name field of the
104
XDeviceInfo structure, or used in an XInternAtom request to return
105
an atom that can be compared with the type field of the XDeviceInfo
108
The num_classes field is a number in the
109
range 0-255 that specifies the number of input classes
110
supported by the device for which information is
111
returned by ListInputDevices. Some input classes, such
112
as class Focus and class Proximity do not have any
113
information to be returned by ListInputDevices.
115
The use field specifies how the device is currently
116
being used. If the value is \fIIsXKeyboard\fP, the device is
117
currently being used as the X keyboard. If the value
118
is \fIIsXPointer\fP, the device is currently being used as
119
the X pointer. If the value is \fIIsXExtensionDevice\fP, the
120
device is available for use as an extension device.
122
The inputclassinfo field contains a pointer to the first input-class
123
specific data. The first two fields are common to all
126
The class field is a number in the range 0-255.
127
It uniquely identifies the class of input for which
128
information is returned. Currently defined classes
129
are KeyClass, ButtonClass, and ValuatorClass.
131
The length field is a number in the range 0- 255.
132
It specifies the number of bytes of data that are
133
contained in this input class. The length includes the
134
class and length fields.
136
The XKeyInfo structure describes the characteristics of the keys on the
137
device. It is defined as follows:
26
#include <X11/extensions/XInput\&.h>
30
XDeviceInfo *XListInputDevices( Display *display,
31
int *ndevices_return);
35
int XFreeDeviceList( XDeviceInfo *list);
40
Specifies the connection to the X server\&.
45
Specifies a pointer to a variable where the number of
46
available devices canbe returned\&.
51
Specifies the list of devices to free\&. The
52
XFreeDeviceList functionfrees the list of available
53
extension input devices\&.
61
The XListInputDevices request lists the available input
62
devices\&. This list includes the core keyboard and any physical
63
input device currently accessible through the X server, and any
64
input devices that are not currently accessible through the X
65
server but could be accessed if requested\&.
75
A master pointer is a virtual pointer device that does not
76
represent a physical device\&. It is visually represented through
77
a cursor\&. A master keyboard is a virtual keyboard device that
78
does not represent a physical device\&. It is virtually
79
representd through a keyboard focus\&. A master pointer and a
80
master keyboard are always paired (i\&.e\&. if shift is pressed on
81
the master keyboard, a pointer click would be a shift\-click)\&.
82
Multiple master pointer/keyboard pairs can exist\&.
92
X servers supporting the X Input Extension version 2,
93
XListInputDevices only returns the first master pointer, the
94
first master keyboard and all slave devices\&. Additional master
95
devices are not listed\&.
105
Physical devices (so\-called slave devices) are attached to
106
either a master pointer or a master keyboard, depending on
107
their capabilities\&. If a slave device generates an event, the
108
event is also generated by the respective master device\&.
109
Multiple slave devices can be attached to a single master
120
Some server implementations may make all physical input devices
121
available at the time the server is initialized\&. Others may
122
wait until requested by a client to access an input device\&. In
123
the latter case, it is possible that an input device will be
124
listed as available at one time but not at another\&.
134
For each input device available to the server, the
135
XListInputDevices request returns an XDeviceInfo structure\&.
136
That structure contains a pointer to a list of structures, each
137
of which contains information about one class of input
138
supported by the device\&. The XDeviceInfo structure is defined
140
typedef struct _XDeviceInfo {
146
XAnyClassPtr inputclassinfo;
157
The id is a number in the range 0\-128 that uniquely identifies
158
the device\&. It is assigned to the device when it is initialized
169
The type field is of type Atom and indicates the nature of the
170
device\&. The type will correspond to one of the following strings
171
(defined in the header file XI\&.h):
181
XI_MOUSE XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD
182
XI_BUTTONBOX XI_BARCODE XI_TRACKBALL XI_QUADRATURE XI_ID_MODULE
183
XI_ONE_KNOB XI_NINE_KNOB XI_KNOB_BOX XI_SPACEBALL XI_DATAGLOVE
184
XI_EYETRACKER XI_CURSORKEYS XI_FOOTMOUSE XI_JOYSTICK
194
These strings may be used in an XInternAtom request to return
195
an atom that can be compared with the type field of the
196
XDeviceInfo structure\&.
206
The name field contains a pointer to a null\-terminated string
207
that serves as identifier of the device\&. This identifier may be
208
user\-configured or automatically assigned by the server\&.
218
The num_classes field is a number in the range 0\-255 that
219
specifies the number of input classes supported by the device
220
for which information is returned by ListInputDevices\&. Some
221
input classes, such as class Focus and class Proximity do not
222
have any information to be returned by ListInputDevices\&.
232
All devices provide an AttachClass\&. This class specifies the
233
master device a given slave device is attached to\&. For master
234
devices, the class specifies the respective paired master
245
The use field specifies how the device is currently being used\&.
246
If the value is IsXKeyboard, the device is a master keyboard\&.
247
If the value is IsXPointer, the device is a master pointer\&. If
248
the value is IsXExtensionPointer, the device is a slave
249
pointer\&. If the value is IsXExtensionKeyboard, the device is a
250
slave keyboard\&. If the value is IsXExtensionDevice, the device
251
is available for use as an extension device\&.
261
The inputclassinfo field contains a pointer to the first
262
input\-class specific data\&. The first two fields are common to
273
The class field is a number in the range 0\-255\&. It uniquely
274
identifies the class of input for which information is
275
returned\&. Currently defined classes are KeyClass, ButtonClass,
286
The length field is a number in the range 0\- 255\&. It specifies
287
the number of bytes of data that are contained in this input
288
class\&. The length includes the class and length fields\&.
298
The XKeyInfo structure describes the characteristics of the
299
keys on the device\&. It is defined as follows:
141
309
typedef struct _XKeyInfo {
144
unsigned short min_keycode;
145
unsigned short max_keycode;
146
unsigned short num_keys;
312
unsigned short min_keycode;
313
unsigned short max_keycode;
314
unsigned short num_keys;
151
min_keycode is of type KEYCODE. It specifies the
152
minimum keycode that the device will report. The
153
minimum keycode will not be smaller than 8.
155
max_keycode is of type KEYCODE. It specifies the
156
maximum keycode that the device will report. The
157
maximum keycode will not be larger than 255.
159
num_keys specifies the number of keys that the device has.
161
The XButtonInfo structure defines the characteristics of the buttons
162
on the device. It is defined as follows:
325
min_keycode is of type KEYCODE\&. It specifies the minimum
326
keycode that the device will report\&. The minimum keycode will
327
not be smaller than 8\&.
337
max_keycode is of type KEYCODE\&. It specifies the maximum
338
keycode that the device will report\&. The maximum keycode will
339
not be larger than 255\&.
349
num_keys specifies the number of keys that the device has\&.
359
The XButtonInfo structure defines the characteristics of the
360
buttons on the device\&. It is defined as follows:
166
370
typedef struct _XButtonInfo {
174
num_buttons specifies the number of buttons that the device has.
176
The XValuatorInfo structure defines the characteristics of the valuators
177
on the device. It is defined as follows:
181
typedef struct _XValuatorInfo {
184
unsigned char num_axes;
186
unsigned long motion_buffer;
384
num_buttons specifies the number of buttons that the device
395
The XValuatorInfo structure defines the characteristics of the
396
valuators on the device\&. It is defined as follows:
406
typedef struct _XValuatorInfo {
409
unsigned char num_axes;
411
unsigned long motion_buffer;
191
num_axes contains the number of axes the device supports.
193
mode is a constant that has one of the following
194
values: Absolute or Relative. Some devices allow the
195
mode to be changed dynamically via the SetDeviceMode
198
motion_buffer_size is a cardinal number that specifies
199
the number of elements that can be contained in the
200
motion history buffer for the device.
202
The axes field contains a pointer to an XAxisInfo structure.
423
num_axes contains the number of axes the device supports\&.
433
mode is a constant that has one of the following values:
434
Absolute or Relative\&. Some devices allow the mode to be changed
435
dynamically via the SetDeviceMode request\&.
445
motion_buffer_size is a cardinal number that specifies the
446
number of elements that can be contained in the motion history
447
buffer for the device\&.
457
The axes field contains a pointer to an XAxisInfo structure\&.
204
467
The XAxisInfo structure is defined as follows:
208
477
typedef struct _XAxisInfo {
216
The resolution contains a number in counts/meter.
218
The min_val field contains a number that specifies
219
the minimum value the device reports for this axis.
220
For devices whose mode is Relative, the min_val field
223
The max_val field contains a number that specifies
224
the maximum value the device reports for this axis.
225
For devices whose mode is Relative, the max_val field
228
To free the \fIXDeviceInfo\fP array created by \fIXListInputDevices\fP,
229
use \fIXFreeDeviceList\fP.
491
The resolution contains a number in counts/meter\&.
501
The min_val field contains a number that specifies the minimum
502
value the device reports for this axis\&. For devices whose mode
503
is Relative, the min_val field will contain 0\&.
513
The max_val field contains a number that specifies the maximum
514
value the device reports for this axis\&. For devices whose mode
515
is Relative, the max_val field will contain 0\&.
525
The XAttachInfo structure is defined as follows:
526
typedef struct _XAttachInfo {
538
If the device is a slave device, attached specifies the device
539
ID of the master device this device is attached to\&. If the
540
device is not attached to a master device, attached is
541
Floating\&. If the device is a master device, attached specifies
542
the device ID of the master device this device is paired with\&.
552
To free the XDeviceInfo array created by XListInputDevices, use