771 lines
11 KiB
HTML
771 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of XLISTINPUTDEVICES</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>XLISTINPUTDEVICES</H1>
|
|
Section: (3)<BR>Updated: 06/19/2019<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
XListInputDevices, XFreeDeviceList - list available input devices
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<PRE>
|
|
#include <<A HREF="file:///usr/include/X11/extensions/XInput.h">X11/extensions/XInput.h</A>>
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
XDeviceInfo *XListInputDevices( Display *display,
|
|
int *ndevices_return);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
int XFreeDeviceList( XDeviceInfo *list);
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
display
|
|
Specifies the connection to the X server.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
ndevices_return
|
|
Specifies a pointer to a variable where the number of
|
|
available devices can be returned.
|
|
</PRE>
|
|
|
|
<P>
|
|
<PRE>
|
|
list
|
|
Specifies the list of devices to free. The
|
|
XFreeDeviceList function frees the list of available
|
|
extension input devices.
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="1"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XListInputDevices request lists the available input
|
|
devices. This list includes the core keyboard and any physical
|
|
input device 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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
A master pointer is a virtual pointer device that does not
|
|
represent a physical device. It is visually represented through
|
|
a cursor. A master keyboard is a virtual keyboard device that
|
|
does not represent a physical device. It is virtually
|
|
representd through a keyboard focus. A master pointer and a
|
|
master keyboard are always paired (i.e. if shift is pressed on
|
|
the master keyboard, a pointer click would be a shift-click).
|
|
Multiple master pointer/keyboard pairs can exist.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
X servers supporting the X Input Extension version 2,
|
|
XListInputDevices only returns the first master pointer, the
|
|
first master keyboard and all slave devices. Additional master
|
|
devices are not listed.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="4"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
Physical devices (so-called slave devices) are attached to
|
|
either a master pointer or a master keyboard, depending on
|
|
their capabilities. If a slave device generates an event, the
|
|
event is also generated by the respective master device.
|
|
Multiple slave devices can be attached to a single master
|
|
device.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="5"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
Some server implementations may make all physical 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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="6"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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:
|
|
typedef struct _XDeviceInfo {
|
|
XID id;
|
|
Atom type;
|
|
char *name;
|
|
int num_classes;
|
|
int use;
|
|
XAnyClassPtr inputclassinfo;
|
|
} XDeviceInfo;
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="7"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="8"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The type field is of type Atom and indicates the nature of the
|
|
device. The type will correspond to one of the following strings
|
|
(defined in the header file XI.h):
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="9"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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 XI_JOYSTICK
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="10"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
These strings may be used in an XInternAtom request to return
|
|
an atom that can be compared with the type field of the
|
|
XDeviceInfo structure.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="11"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The name field contains a pointer to a null-terminated string
|
|
that serves as identifier of the device. This identifier may be
|
|
user-configured or automatically assigned by the server.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="12"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="13"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
All devices provide an AttachClass. This class specifies the
|
|
master device a given slave device is attached to. For master
|
|
devices, the class specifies the respective paired master
|
|
device.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="14"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The use field specifies how the device is currently being used.
|
|
If the value is IsXKeyboard, the device is a master keyboard.
|
|
If the value is IsXPointer, the device is a master pointer. If
|
|
the value is IsXExtensionPointer, the device is a slave
|
|
pointer. If the value is IsXExtensionKeyboard, the device is a
|
|
slave keyboard. If the value is IsXExtensionDevice, the device
|
|
is available for use as an extension device.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="15"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The inputclassinfo field contains a pointer to the first
|
|
input-class specific data. The first two fields are common to
|
|
all classes.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="16"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="17"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="18"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XKeyInfo structure describes the characteristics of the
|
|
keys on the device. It is defined as follows:
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="19"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
typedef struct _XKeyInfo {
|
|
XID class;
|
|
int length;
|
|
unsigned short min_keycode;
|
|
unsigned short max_keycode;
|
|
unsigned short num_keys;
|
|
} XKeyInfo;
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="20"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="21"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="22"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
num_keys specifies the number of keys that the device has.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="23"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XButtonInfo structure defines the characteristics of the
|
|
buttons on the device. It is defined as follows:
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="24"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
typedef struct _XButtonInfo {
|
|
XID class;
|
|
int length;
|
|
short num_buttons;
|
|
} XButtonInfo;
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="25"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
num_buttons specifies the number of buttons that the device
|
|
has.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="26"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XValuatorInfo structure defines the characteristics of the
|
|
valuators on the device. It is defined as follows:
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="27"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
typedef struct _XValuatorInfo {
|
|
XID class;
|
|
int length;
|
|
unsigned char num_axes;
|
|
unsigned char mode;
|
|
unsigned long motion_buffer;
|
|
XAxisInfoPtr axes;
|
|
} XValuatorInfo;
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="28"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
num_axes contains the number of axes the device supports.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="29"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="30"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="31"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The axes field contains a pointer to an XAxisInfo structure.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="32"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XAxisInfo structure is defined as follows:
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="33"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
typedef struct _XAxisInfo {
|
|
int resolution;
|
|
int min_value;
|
|
int max_value;
|
|
} XAxisInfo;
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="34"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The resolution contains a number in counts/meter.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="35"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="36"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
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.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="37"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
The XAttachInfo structure is defined as follows:
|
|
typedef struct _XAttachInfo {
|
|
int attached;
|
|
} XAttachInfo;
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="38"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
If the device is a slave device, attached specifies the device
|
|
ID of the master device this device is attached to. If the
|
|
device is not attached to a master device, attached is
|
|
Floating. If the device is a master device, attached specifies
|
|
the device ID of the master device this device is paired with.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="39"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
XListInputDevices returns a pointer to an array of XDeviceInfo
|
|
structs and sets ndevices_return to the number of elements in
|
|
that array. To free the XDeviceInfo array created by
|
|
XListInputDevices, use XFreeDeviceList.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<DL COMPACT><DT id="40"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
On error, XListInputDevices returns NULL and ndevices_return is
|
|
left unmodified.
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="41"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="42"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="43"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="44"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:01 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|