2 .\" Title: xiquerydevice
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 "XIQUERYDEVICE" "libmansuffix" "12/22/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 XIQueryDevice, XIFreeDeviceInfo \- get information about devices\&.
35 #include <X11/extensions/XInput2\&.h>
39 XIDeviceInfo* XIQueryDevice( Display *display,
41 int *ndevices_return);
45 XIFreeDeviceInfo( XIDeviceInfo *info);
50 Specifies the device to query or XIAllDevices or
56 Specifies the connection to the X server\&.
61 Returns the number of devices returned\&.
66 A list of device XIDeviceInfo structs to be freed\&.
74 The XIQueryDevice returns information about one or more input
75 devices\&. If the deviceid specifies a device, ndevices_return is
76 1 and the returned information describes only the requested
77 device\&. If deviceid is XIAllDevices or XIAllMasterDevices,
78 ndevices_return is the number of devices or master devices,
79 respectively, and the returned information represents all
80 devices or all master devices, respectively\&.
90 To free the XIDeviceInfo array returned by XIQueryDevice, use
101 For each input device requested, the XIQueryDevice returns an
102 XIDeviceInfo structure\&. Each structure contains information
103 about the capabilities of one input device available to the
122 XIAnyClassInfo **classes;
133 The deviceid is the numeric unique id of the device\&. A deviceid
134 is unique for the life\-time of a device but a server may re\-use
135 the id once a device has been removed\&.
145 The name points to a null\-terminated string specifying the
146 identifier of the device\&.
156 The use and attachment fields specify the type of the device
157 and the current attachment or pairing\&.
158 \- If use is XIMasterPointer, the device is a master pointer and
159 attachment specifies the deviceid of the paired master
161 \- If use is XIMasterKeyboard, the device is a master keyboard,
162 and the attachment field specifies the paired master pointer\&.
163 \- If use is XISlavePointer, the device is a slave device and
164 currently attached to the master pointer specified in
166 \- If use is XISlaveKeyboard, the device is a slave device an
167 currently attached to the master keyboard specified in
169 \- If use is XIFloatingSlave, the device is a slave device
170 currently not attached to any master device\&. The value of the
171 attachment field for floating slave devices is undefined\&.
181 The enabled field specifies if the device is currently enabled
182 and can send events\&. Disabled devices will not send events\&.
192 The num_classes field specifies the number of input classes
193 pointed to by classes\&. The first two fields of all input
194 classes are identical\&.
218 The type field specifies the type of the input class\&.
219 Currently, the following types are defined:
220 XIKeyClass, XIButtonClass, XIValuatorClass, XIScrollClass,
231 In the future, additional types may be added\&. Clients are
232 required to ignore unknown input classes\&.
242 The sourceid is the deviceid this class originated from\&. For
243 master devices, the sourceid is typically the id of the slave
244 device currently sending events\&. For slave devices, the
245 sourceid is typically the device\*(Aqs id\&.
255 A device may have zero or one XIButtonClass, denoting the
256 device\*(Aqs capability to send button events\&.
296 The num_buttons field specifies the number of buttons available
297 on this device\&. A device that has an XIButtonClass must have at
308 labels is a list of num_buttons Atoms specifying the button
309 labels for this device\&. If the label is not None, then the
310 label specifies the type of button in physical device order
311 (i\&.e\&. as the buttons are numbered on the physical input
322 The state is the current button state as seen by clients (i\&.e\&.
323 after button mapping is applied)\&. The mask_len field specifies
324 the length of mask in bytes\&. For each button on the device, the
325 respective bit in mask is set if the button is currently
336 A device may have zero or one XIKeyClass, denoting the device\*(Aqs
337 capability to send key events\&.
363 The num_keycodes field specifies the number of keycodes
364 available on this device\&. A device that has an XIKeyClass must
365 have at least one keycode\&.
375 keycodes is a list of num_keycodes keycodes the device may
386 A device may have zero or more XIValuatorClass, denoting the
387 device\*(Aqs capability to send coordinates\&.
408 } XIValuatorClassInfo;
418 The number field specifies the number of the axis on the
429 If the label field is not None, the value of label is an Atom
430 describing the axis\&.
440 min and max are the minimum and maximum values allowed on this
441 axis\&. If both are zero, no minumum or maximum values are set on
442 this device\&. value is the current value of this axis\&.
452 The resolution field specifies the resolution of the device in
463 The mode specifies the mode of this axis\&. If the mode is
464 XIModeAbsolute this axis sends absolute coordinates\&. If the
465 mode is XIModeRelative, this device sends relative coordinates\&.
493 This class describes scrolling capability on a valuator\&. For
494 each XIScrollClassInfo, an XIValuatorClassInfo with the same
495 number is present on the device\&.
505 The number field specifies the valuator number on the physical
506 device that this scroll information applies to\&. See the
507 respective XIValuatorClassInfo for detailed information on this
518 The scroll_type field specifies the type of scrolling, either
519 XIScrollTypeVertical or XIScrollTypeHorizontal\&.
529 The increment specifies the value change considered one unit of
540 The flags field specifies flags that apply to this scrolling
551 If XIScrollFlagNoEmulation is set, the server will not
552 emulate legacy button events for valuator changes on this
563 If XIScrollFlagPreferred is set, this axis is the
564 preferred axis for this scroll type and will be used for
565 the emulation of XI_Motion events when the driver submits
566 legacy scroll button events\&.
592 A device may have zero or one XITouchClassInfo, denoting
593 multi\-touch capability on the device\&. A device with a XITouchClassInfo
594 may send TouchBegin, TouchUpdate, TouchEnd and TouchOwnership events\&.
604 The mode field is either XIDirectTouch for direct\-input touch devices
605 such as touchscreens or XIDependentTouch for indirect input devices such
606 as touchpads\&. For XIDirectTouch devices, touch events are sent to window
607 at the position the touch occured\&. For XIDependentTouch devices, touch
608 events are sent to the window at the position of the device\*(Aqs sprite\&.
618 The num_touches field defines the maximum number of simultaneous touches
619 the device supports\&. A num_touches of 0 means the maximum number of
620 simultaneous touches is undefined or unspecified\&. This field should be
621 used as a guide only, devices will lie about their capabilities\&.
631 A device with an XITouchClassInfo may still send pointer events\&. The
632 valuators must be defined with the respective XIValuatorClass
633 classes\&. A valuator may send both pointer and touch\-events\&.
643 XIQueryDevice can generate a BadDevice error\&.
653 XIFreeDeviceInfo frees the information returned by
666 An invalid device was specified\&. The device does not
667 exist or is not a pointer device\&.