2 .\" Title: xlistinputdevices
3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
6 .\" Manual: [FIXME: manual]
7 .\" Source: [FIXME: source]
10 .TH "XLISTINPUTDEVICES" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 XListInputDevices, XFreeDeviceList \- list available input devices
35 #include <X11/extensions/XInput\&.h>
39 XDeviceInfo *XListInputDevices( Display *display,
40 int *ndevices_return);
44 int XFreeDeviceList( XDeviceInfo *list);
49 Specifies the connection to the X server\&.
54 Specifies a pointer to a variable where the number of
55 available devices canbe returned\&.
60 Specifies the list of devices to free\&. The
61 XFreeDeviceList functionfrees the list of available
62 extension input devices\&.
70 The XListInputDevices request lists the available input
71 devices\&. This list includes the core keyboard and any physical
72 input device currently accessible through the X server, and any
73 input devices that are not currently accessible through the X
74 server but could be accessed if requested\&.
84 A master pointer is a virtual pointer device that does not
85 represent a physical device\&. It is visually represented through
86 a cursor\&. A master keyboard is a virtual keyboard device that
87 does not represent a physical device\&. It is virtually
88 representd through a keyboard focus\&. A master pointer and a
89 master keyboard are always paired (i\&.e\&. if shift is pressed on
90 the master keyboard, a pointer click would be a shift\-click)\&.
91 Multiple master pointer/keyboard pairs can exist\&.
101 X servers supporting the X Input Extension version 2,
102 XListInputDevices only returns the first master pointer, the
103 first master keyboard and all slave devices\&. Additional master
104 devices are not listed\&.
114 Physical devices (so\-called slave devices) are attached to
115 either a master pointer or a master keyboard, depending on
116 their capabilities\&. If a slave device generates an event, the
117 event is also generated by the respective master device\&.
118 Multiple slave devices can be attached to a single master
129 Some server implementations may make all physical input devices
130 available at the time the server is initialized\&. Others may
131 wait until requested by a client to access an input device\&. In
132 the latter case, it is possible that an input device will be
133 listed as available at one time but not at another\&.
143 For each input device available to the server, the
144 XListInputDevices request returns an XDeviceInfo structure\&.
145 That structure contains a pointer to a list of structures, each
146 of which contains information about one class of input
147 supported by the device\&. The XDeviceInfo structure is defined
149 typedef struct _XDeviceInfo {
155 XAnyClassPtr inputclassinfo;
166 The id is a number in the range 0\-128 that uniquely identifies
167 the device\&. It is assigned to the device when it is initialized
178 The type field is of type Atom and indicates the nature of the
179 device\&. The type will correspond to one of the following strings
180 (defined in the header file XI\&.h):
190 XI_MOUSE XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD
191 XI_BUTTONBOX XI_BARCODE XI_TRACKBALL XI_QUADRATURE XI_ID_MODULE
192 XI_ONE_KNOB XI_NINE_KNOB XI_KNOB_BOX XI_SPACEBALL XI_DATAGLOVE
193 XI_EYETRACKER XI_CURSORKEYS XI_FOOTMOUSE XI_JOYSTICK
203 These strings may be used in an XInternAtom request to return
204 an atom that can be compared with the type field of the
205 XDeviceInfo structure\&.
215 The name field contains a pointer to a null\-terminated string
216 that serves as identifier of the device\&. This identifier may be
217 user\-configured or automatically assigned by the server\&.
227 The num_classes field is a number in the range 0\-255 that
228 specifies the number of input classes supported by the device
229 for which information is returned by ListInputDevices\&. Some
230 input classes, such as class Focus and class Proximity do not
231 have any information to be returned by ListInputDevices\&.
241 All devices provide an AttachClass\&. This class specifies the
242 master device a given slave device is attached to\&. For master
243 devices, the class specifies the respective paired master
254 The use field specifies how the device is currently being used\&.
255 If the value is IsXKeyboard, the device is a master keyboard\&.
256 If the value is IsXPointer, the device is a master pointer\&. If
257 the value is IsXExtensionPointer, the device is a slave
258 pointer\&. If the value is IsXExtensionKeyboard, the device is a
259 slave keyboard\&. If the value is IsXExtensionDevice, the device
260 is available for use as an extension device\&.
270 The inputclassinfo field contains a pointer to the first
271 input\-class specific data\&. The first two fields are common to
282 The class field is a number in the range 0\-255\&. It uniquely
283 identifies the class of input for which information is
284 returned\&. Currently defined classes are KeyClass, ButtonClass,
295 The length field is a number in the range 0\- 255\&. It specifies
296 the number of bytes of data that are contained in this input
297 class\&. The length includes the class and length fields\&.
307 The XKeyInfo structure describes the characteristics of the
308 keys on the device\&. It is defined as follows:
318 typedef struct _XKeyInfo {
321 unsigned short min_keycode;
322 unsigned short max_keycode;
323 unsigned short num_keys;
334 min_keycode is of type KEYCODE\&. It specifies the minimum
335 keycode that the device will report\&. The minimum keycode will
336 not be smaller than 8\&.
346 max_keycode is of type KEYCODE\&. It specifies the maximum
347 keycode that the device will report\&. The maximum keycode will
348 not be larger than 255\&.
358 num_keys specifies the number of keys that the device has\&.
368 The XButtonInfo structure defines the characteristics of the
369 buttons on the device\&. It is defined as follows:
379 typedef struct _XButtonInfo {
393 num_buttons specifies the number of buttons that the device
404 The XValuatorInfo structure defines the characteristics of the
405 valuators on the device\&. It is defined as follows:
415 typedef struct _XValuatorInfo {
418 unsigned char num_axes;
420 unsigned long motion_buffer;
432 num_axes contains the number of axes the device supports\&.
442 mode is a constant that has one of the following values:
443 Absolute or Relative\&. Some devices allow the mode to be changed
444 dynamically via the SetDeviceMode request\&.
454 motion_buffer_size is a cardinal number that specifies the
455 number of elements that can be contained in the motion history
456 buffer for the device\&.
466 The axes field contains a pointer to an XAxisInfo structure\&.
476 The XAxisInfo structure is defined as follows:
486 typedef struct _XAxisInfo {
500 The resolution contains a number in counts/meter\&.
510 The min_val field contains a number that specifies the minimum
511 value the device reports for this axis\&. For devices whose mode
512 is Relative, the min_val field will contain 0\&.
522 The max_val field contains a number that specifies the maximum
523 value the device reports for this axis\&. For devices whose mode
524 is Relative, the max_val field will contain 0\&.
534 The XAttachInfo structure is defined as follows:
535 typedef struct _XAttachInfo {
547 If the device is a slave device, attached specifies the device
548 ID of the master device this device is attached to\&. If the
549 device is not attached to a master device, attached is
550 Floating\&. If the device is a master device, attached specifies
551 the device ID of the master device this device is paired with\&.
561 To free the XDeviceInfo array created by XListInputDevices, use