~ubuntu-branches/ubuntu/natty/libxi/natty-201011191114

« back to all changes in this revision

Viewing changes to man/XIQueryDevice.man

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-11-21 18:39:28 UTC
  • mfrom: (1.1.10 upstream) (0.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20091121183928-ek2jwqx3rmhv3zjz
Tags: 2:1.3-1
* Bump Standards-Version to 3.8.3.
* Add build-deps on xmlto and asciidoc to build the manpages.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: xiquerydevice
 
3
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 
4
.\" Generator: DocBook XSL Stylesheets v1.74.3 <http://docbook.sf.net/>
 
5
.\"      Date: 10/02/2009
 
6
.\"    Manual: [FIXME: manual]
 
7
.\"    Source: [FIXME: source]
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "XIQUERYDEVICE" "libmansuffix" "10/02/2009" "[FIXME: source]" "[FIXME: manual]"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.SH "NAME"
 
22
XIQueryDevice, XIFreeDeviceInfo \- get information about devices\&.
 
23
.SH "SYNOPSIS"
 
24
.sp
 
25
.nf
 
26
#include <X11/extensions/XInput2\&.h>
 
27
.fi
 
28
.sp
 
29
.nf
 
30
XIDeviceInfo* XIQueryPointer( Display *display,
 
31
                              int deviceid,
 
32
                              int *ndevices_return);
 
33
.fi
 
34
.sp
 
35
.nf
 
36
XIFreeDeviceInfo( XIDeviceInfo *info);
 
37
.fi
 
38
.sp
 
39
.nf
 
40
deviceid
 
41
       Specifies the device to query or XIAllDevices or
 
42
       XIAllMasterDevices\&.
 
43
.fi
 
44
.sp
 
45
.nf
 
46
display
 
47
       Specifies the connection to the X server\&.
 
48
.fi
 
49
.sp
 
50
.nf
 
51
ndevices_return
 
52
       Returns the number of devices returned\&.
 
53
.fi
 
54
.sp
 
55
.nf
 
56
info
 
57
       A list of device XIDeviceInfo structs to be freed\&.
 
58
.fi
 
59
.SH "DESCRIPTION"
 
60
.sp
 
61
.if n \{\
 
62
.RS 4
 
63
.\}
 
64
.nf
 
65
The XIQueryDevice returns information about one or more input
 
66
devices\&. If the deviceid specifies a device, ndevices_return is
 
67
1 and the returned information describes only the requested
 
68
device\&. If deviceid is XIAllDevices or XIAllMasterDevices,
 
69
ndevices_return is the number of devices or master devices,
 
70
respectively, and the returned information represents all
 
71
devices or all master devices, respectively\&.
 
72
.fi
 
73
.if n \{\
 
74
.RE
 
75
.\}
 
76
.sp
 
77
.if n \{\
 
78
.RS 4
 
79
.\}
 
80
.nf
 
81
To free the XIDeviceInfo array returned by XIQueryDevice, use
 
82
XIFreeDeviceInfo\&.
 
83
.fi
 
84
.if n \{\
 
85
.RE
 
86
.\}
 
87
.sp
 
88
.if n \{\
 
89
.RS 4
 
90
.\}
 
91
.nf
 
92
For each input device requested, the XIQueryDevice returns an
 
93
XIDeviceInfo structure\&. Each structure contains information
 
94
about the capabilities of one input device available to the
 
95
server\&.
 
96
.fi
 
97
.if n \{\
 
98
.RE
 
99
.\}
 
100
.sp
 
101
.if n \{\
 
102
.RS 4
 
103
.\}
 
104
.nf
 
105
typedef struct
 
106
{
 
107
    int                 deviceid;
 
108
    char                *name;
 
109
    int                 use;
 
110
    int                 attachment;
 
111
    Bool                enabled;
 
112
    int                 num_classes;
 
113
    XIAnyClassInfo      **classes;
 
114
} XIDeviceInfo;
 
115
.fi
 
116
.if n \{\
 
117
.RE
 
118
.\}
 
119
.sp
 
120
.if n \{\
 
121
.RS 4
 
122
.\}
 
123
.nf
 
124
The deviceid is the numeric unique id of the device\&. A deviceid
 
125
is unique for the life\-time of a device but a server may re\-use
 
126
the id once a device has been removed\&.
 
127
.fi
 
128
.if n \{\
 
129
.RE
 
130
.\}
 
131
.sp
 
132
.if n \{\
 
133
.RS 4
 
134
.\}
 
135
.nf
 
136
The name points to a null\-terminated string specifying the
 
137
identifier of the device\&.
 
138
.fi
 
139
.if n \{\
 
140
.RE
 
141
.\}
 
142
.sp
 
143
.if n \{\
 
144
.RS 4
 
145
.\}
 
146
.nf
 
147
The use and attachment fields specify the type of the device
 
148
and the current attachment or pairing\&.
 
149
\- If use is XIMasterPointer, the device is a master pointer and
 
150
  attachment specifies the deviceid of the paired master
 
151
  keyboard\&.
 
152
\- If use is XIMasterKeyboard, the device is a master keyboard,
 
153
  and the attachment field specifies the paired master pointer\&.
 
154
\- If use is XISlavePointer, the device is a slave device and
 
155
  currently attached to the master pointer specified in
 
156
  attachement\&.
 
157
\- If use is XISlaveKeyboard, the device is a slave device an
 
158
  currently attached to the master keyboard specified in
 
159
  attachment\&.
 
160
\- If use is XIFloatingSlave, the device is a slave device
 
161
  currently not attached to any master device\&. The value of the
 
162
  attachment field for floating slave devices is undefined\&.
 
163
.fi
 
164
.if n \{\
 
165
.RE
 
166
.\}
 
167
.sp
 
168
.if n \{\
 
169
.RS 4
 
170
.\}
 
171
.nf
 
172
The enabled field specifies if the device is currently enabled
 
173
and can send events\&. Disabled devices will not send events\&.
 
174
.fi
 
175
.if n \{\
 
176
.RE
 
177
.\}
 
178
.sp
 
179
.if n \{\
 
180
.RS 4
 
181
.\}
 
182
.nf
 
183
The num_classes field specifies the number of input classes
 
184
pointed to by classes\&. The first two fields of all input
 
185
classes are identical\&.
 
186
.fi
 
187
.if n \{\
 
188
.RE
 
189
.\}
 
190
.sp
 
191
.if n \{\
 
192
.RS 4
 
193
.\}
 
194
.nf
 
195
typedef struct
 
196
{
 
197
    int         type;
 
198
    int         sourceid;
 
199
} XIAnyClassInfo;
 
200
.fi
 
201
.if n \{\
 
202
.RE
 
203
.\}
 
204
.sp
 
205
.if n \{\
 
206
.RS 4
 
207
.\}
 
208
.nf
 
209
The type field specifies the type of the input class\&.
 
210
Currently, the following types are defined:
 
211
    XIKeyClass, XIButtonClass, XIValuatorClass
 
212
.fi
 
213
.if n \{\
 
214
.RE
 
215
.\}
 
216
.sp
 
217
.if n \{\
 
218
.RS 4
 
219
.\}
 
220
.nf
 
221
In the future, additional types may be added\&. Clients are
 
222
required to ignore unknown input classes\&.
 
223
.fi
 
224
.if n \{\
 
225
.RE
 
226
.\}
 
227
.sp
 
228
.if n \{\
 
229
.RS 4
 
230
.\}
 
231
.nf
 
232
The sourceid is the deviceid this class originated from\&. For
 
233
master devices, the sourceid is typically the id of the slave
 
234
device currently sending events\&. For slave devices, the
 
235
sourceid is typically the device\'s id\&.
 
236
.fi
 
237
.if n \{\
 
238
.RE
 
239
.\}
 
240
.sp
 
241
.if n \{\
 
242
.RS 4
 
243
.\}
 
244
.nf
 
245
A device may have zero or one XIButtonClass, denoting the
 
246
device\'s capability to send button events\&.
 
247
.fi
 
248
.if n \{\
 
249
.RE
 
250
.\}
 
251
.sp
 
252
.if n \{\
 
253
.RS 4
 
254
.\}
 
255
.nf
 
256
typedef struct {
 
257
    int           mask_len;
 
258
    unsigned char *mask;
 
259
} XIButtonState;
 
260
.fi
 
261
.if n \{\
 
262
.RE
 
263
.\}
 
264
.sp
 
265
.if n \{\
 
266
.RS 4
 
267
.\}
 
268
.nf
 
269
typedef struct
 
270
{
 
271
    int         type;
 
272
    int         sourceid;
 
273
    int         num_buttons;
 
274
    Atom        *labels;
 
275
    XIButtonState state;
 
276
} XIButtonClassInfo;
 
277
.fi
 
278
.if n \{\
 
279
.RE
 
280
.\}
 
281
.sp
 
282
.if n \{\
 
283
.RS 4
 
284
.\}
 
285
.nf
 
286
The num_buttons field specifies the number of buttons available
 
287
on this device\&. A device that has an XIButtonClass must have at
 
288
least one button\&.
 
289
.fi
 
290
.if n \{\
 
291
.RE
 
292
.\}
 
293
.sp
 
294
.if n \{\
 
295
.RS 4
 
296
.\}
 
297
.nf
 
298
labels is a list of num_buttons Atoms specifying the button
 
299
labels for this device\&. If the label is not None, then the
 
300
label specifies the type of button in physical device order
 
301
(i\&.e\&. as the buttons are numbered on the physical input
 
302
device)\&.
 
303
.fi
 
304
.if n \{\
 
305
.RE
 
306
.\}
 
307
.sp
 
308
.if n \{\
 
309
.RS 4
 
310
.\}
 
311
.nf
 
312
The state is the current button state as seen by clients (i\&.e\&.
 
313
after button mapping is applied)\&. The mask_len field specifies
 
314
the length of mask in bytes\&. For each button on the device, the
 
315
respective bit in mask is set if the button is currently
 
316
logically down\&.
 
317
.fi
 
318
.if n \{\
 
319
.RE
 
320
.\}
 
321
.sp
 
322
.if n \{\
 
323
.RS 4
 
324
.\}
 
325
.nf
 
326
A device may have zero or one XIKeyClass, denoting the device\'s
 
327
capability to send key events\&.
 
328
.fi
 
329
.if n \{\
 
330
.RE
 
331
.\}
 
332
.sp
 
333
.if n \{\
 
334
.RS 4
 
335
.\}
 
336
.nf
 
337
typedef struct
 
338
{
 
339
    int         type;
 
340
    int         sourceid;
 
341
    int         num_keycodes;
 
342
    int         *keycodes;
 
343
} XIKeyClassInfo;
 
344
.fi
 
345
.if n \{\
 
346
.RE
 
347
.\}
 
348
.sp
 
349
.if n \{\
 
350
.RS 4
 
351
.\}
 
352
.nf
 
353
The num_keycodes field specifies the number of keycodes
 
354
available on this device\&. A device that has an XIKeyClass must
 
355
have at least one keycode\&.
 
356
.fi
 
357
.if n \{\
 
358
.RE
 
359
.\}
 
360
.sp
 
361
.if n \{\
 
362
.RS 4
 
363
.\}
 
364
.nf
 
365
keycodes is a list of num_keycodes keycodes the device may
 
366
send\&.
 
367
.fi
 
368
.if n \{\
 
369
.RE
 
370
.\}
 
371
.sp
 
372
.if n \{\
 
373
.RS 4
 
374
.\}
 
375
.nf
 
376
A device may have zero or more XIValuatorClass, denoting the
 
377
device\'s capability to send coordinates\&.
 
378
.fi
 
379
.if n \{\
 
380
.RE
 
381
.\}
 
382
.sp
 
383
.if n \{\
 
384
.RS 4
 
385
.\}
 
386
.nf
 
387
typedef struct
 
388
{
 
389
    int         type;
 
390
    int         sourceid;
 
391
    int         number;
 
392
    Atom        label;
 
393
    double      min;
 
394
    double      max;
 
395
    double      value;
 
396
    int         resolution;
 
397
    int         mode;
 
398
} XIValuatorInfo;
 
399
.fi
 
400
.if n \{\
 
401
.RE
 
402
.\}
 
403
.sp
 
404
.if n \{\
 
405
.RS 4
 
406
.\}
 
407
.nf
 
408
The number field specifies the number of the axis on the
 
409
physical device\&.
 
410
.fi
 
411
.if n \{\
 
412
.RE
 
413
.\}
 
414
.sp
 
415
.if n \{\
 
416
.RS 4
 
417
.\}
 
418
.nf
 
419
If the label field is not None, the value of label is an Atom
 
420
describing the axis\&.
 
421
.fi
 
422
.if n \{\
 
423
.RE
 
424
.\}
 
425
.sp
 
426
.if n \{\
 
427
.RS 4
 
428
.\}
 
429
.nf
 
430
min and max are the minimum and maximum values allowed on this
 
431
axis\&. If both are zero, no minumum or maximum values are set on
 
432
this device\&. value is the current value of this axis\&.
 
433
.fi
 
434
.if n \{\
 
435
.RE
 
436
.\}
 
437
.sp
 
438
.if n \{\
 
439
.RS 4
 
440
.\}
 
441
.nf
 
442
The resolution field specifies the resolution of the device in
 
443
units/m\&.
 
444
.fi
 
445
.if n \{\
 
446
.RE
 
447
.\}
 
448
.sp
 
449
.if n \{\
 
450
.RS 4
 
451
.\}
 
452
.nf
 
453
The mode specifies the mode of this axis\&. If the mode is
 
454
XIModeAbsolute this axis sends absolute coordinates\&. If the
 
455
mode is XIModeRelative, this device sends relative coordinates\&.
 
456
.fi
 
457
.if n \{\
 
458
.RE
 
459
.\}
 
460
.sp
 
461
.if n \{\
 
462
.RS 4
 
463
.\}
 
464
.nf
 
465
XIQueryDevice can generate a BadDevice error\&.
 
466
.fi
 
467
.if n \{\
 
468
.RE
 
469
.\}
 
470
.sp
 
471
.if n \{\
 
472
.RS 4
 
473
.\}
 
474
.nf
 
475
XIFreeDeviceInfo frees the information returned by
 
476
XIQueryDevice\&.
 
477
.fi
 
478
.if n \{\
 
479
.RE
 
480
.\}
 
481
.SH "DIAGNOSTICS"
 
482
.sp
 
483
.if n \{\
 
484
.RS 4
 
485
.\}
 
486
.nf
 
487
BadDevice
 
488
       An invalid device was specified\&. The device does not
 
489
       exist or is not a pointer device\&.
 
490
.fi
 
491
.if n \{\
 
492
.RE
 
493
.\}