1 XIQUERYDEVICE(libmansuffix)
2 ============================
7 XIQueryDevice, XIFreeDeviceInfo - get information about devices.
12 #include <X11/extensions/XInput2.h>
14 XIDeviceInfo* XIQueryDevice( Display *display,
16 int *ndevices_return);
18 XIFreeDeviceInfo( XIDeviceInfo *info);
21 Specifies the device to query or XIAllDevices or
25 Specifies the connection to the X server.
28 Returns the number of devices returned.
31 A list of device XIDeviceInfo structs to be freed.
37 The XIQueryDevice returns information about one or more input
38 devices. If the deviceid specifies a device, ndevices_return is
39 1 and the returned information describes only the requested
40 device. If deviceid is XIAllDevices or XIAllMasterDevices,
41 ndevices_return is the number of devices or master devices,
42 respectively, and the returned information represents all
43 devices or all master devices, respectively.
45 To free the XIDeviceInfo array returned by XIQueryDevice, use
48 For each input device requested, the XIQueryDevice returns an
49 XIDeviceInfo structure. Each structure contains information
50 about the capabilities of one input device available to the
61 XIAnyClassInfo **classes;
64 The deviceid is the numeric unique id of the device. A deviceid
65 is unique for the life-time of a device but a server may re-use
66 the id once a device has been removed.
68 The name points to a null-terminated string specifying the
69 identifier of the device.
71 The use and attachment fields specify the type of the device
72 and the current attachment or pairing.
73 - If use is XIMasterPointer, the device is a master pointer and
74 attachment specifies the deviceid of the paired master
76 - If use is XIMasterKeyboard, the device is a master keyboard,
77 and the attachment field specifies the paired master pointer.
78 - If use is XISlavePointer, the device is a slave device and
79 currently attached to the master pointer specified in
81 - If use is XISlaveKeyboard, the device is a slave device an
82 currently attached to the master keyboard specified in
84 - If use is XIFloatingSlave, the device is a slave device
85 currently not attached to any master device. The value of the
86 attachment field for floating slave devices is undefined.
88 The enabled field specifies if the device is currently enabled
89 and can send events. Disabled devices will not send events.
91 The num_classes field specifies the number of input classes
92 pointed to by classes. The first two fields of all input
93 classes are identical.
101 The type field specifies the type of the input class.
102 Currently, the following types are defined:
103 XIKeyClass, XIButtonClass, XIValuatorClass, XIScrollClass,
106 In the future, additional types may be added. Clients are
107 required to ignore unknown input classes.
109 The sourceid is the deviceid this class originated from. For
110 master devices, the sourceid is typically the id of the slave
111 device currently sending events. For slave devices, the
112 sourceid is typically the device's id.
114 A device may have zero or one XIButtonClass, denoting the
115 device's capability to send button events.
131 The num_buttons field specifies the number of buttons available
132 on this device. A device that has an XIButtonClass must have at
135 labels is a list of num_buttons Atoms specifying the button
136 labels for this device. If the label is not None, then the
137 label specifies the type of button in physical device order
138 (i.e. as the buttons are numbered on the physical input
141 The state is the current button state as seen by clients (i.e.
142 after button mapping is applied). The mask_len field specifies
143 the length of mask in bytes. For each button on the device, the
144 respective bit in mask is set if the button is currently
147 A device may have zero or one XIKeyClass, denoting the device's
148 capability to send key events.
158 The num_keycodes field specifies the number of keycodes
159 available on this device. A device that has an XIKeyClass must
160 have at least one keycode.
162 keycodes is a list of num_keycodes keycodes the device may
165 A device may have zero or more XIValuatorClass, denoting the
166 device's capability to send coordinates.
179 } XIValuatorClassInfo;
181 The number field specifies the number of the axis on the
184 If the label field is not None, the value of label is an Atom
187 min and max are the minimum and maximum values allowed on this
188 axis. If both are zero, no minumum or maximum values are set on
189 this device. value is the current value of this axis.
191 The resolution field specifies the resolution of the device in
194 The mode specifies the mode of this axis. If the mode is
195 XIModeAbsolute this axis sends absolute coordinates. If the
196 mode is XIModeRelative, this device sends relative coordinates.
208 This class describes scrolling capability on a valuator. For
209 each XIScrollClassInfo, an XIValuatorClassInfo with the same
210 number is present on the device.
212 The number field specifies the valuator number on the physical
213 device that this scroll information applies to. See the
214 respective XIValuatorClassInfo for detailed information on this
217 The scroll_type field specifies the type of scrolling, either
218 XIScrollTypeVertical or XIScrollTypeHorizontal.
220 The increment specifies the value change considered one unit of
223 The flags field specifies flags that apply to this scrolling
226 If XIScrollFlagNoEmulation is set, the server will not
227 emulate legacy button events for valuator changes on this
230 If XIScrollFlagPreferred is set, this axis is the
231 preferred axis for this scroll type and will be used for
232 the emulation of XI_Motion events when the driver submits
233 legacy scroll button events.
243 A device may have zero or one XITouchClassInfo, denoting
244 multi-touch capability on the device. A device with a XITouchClassInfo
245 may send TouchBegin, TouchUpdate, TouchEnd and TouchOwnership events.
247 The mode field is either XIDirectTouch for direct-input touch devices
248 such as touchscreens or XIDependentTouch for indirect input devices such
249 as touchpads. For XIDirectTouch devices, touch events are sent to window
250 at the position the touch occured. For XIDependentTouch devices, touch
251 events are sent to the window at the position of the device's sprite.
253 The num_touches field defines the maximum number of simultaneous touches
254 the device supports. A num_touches of 0 means the maximum number of
255 simultaneous touches is undefined or unspecified. This field should be
256 used as a guide only, devices will lie about their capabilities.
258 A device with an XITouchClassInfo may still send pointer events. The
259 valuators must be defined with the respective XIValuatorClass
260 classes. A valuator may send both pointer and touch-events.
262 XIQueryDevice can generate a BadDevice error.
264 XIFreeDeviceInfo frees the information returned by
271 An invalid device was specified. The device does not
272 exist or is not a pointer device.