File: XIQueryDevice.man

package info (click to toggle)
libxi 2%3A1.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,528 kB
  • sloc: xml: 9,446; ansic: 7,627; sh: 4,402; makefile: 244
file content (712 lines) | stat: -rw-r--r-- 13,005 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
'\" t
.\"     Title: xiquerydevice
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 09/05/2024
.\"    Manual: \ \&
.\"    Source: \ \&
.\"  Language: English
.\"
.TH "XIQUERYDEVICE" "libmansuffix" "09/05/2024" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
XIQueryDevice, XIFreeDeviceInfo \- get information about devices\&.
.SH "SYNOPSIS"
.sp
.nf
#include <X11/extensions/XInput2\&.h>
.fi
.sp
.nf
XIDeviceInfo* XIQueryDevice( Display *display,
                             int deviceid,
                             int *ndevices_return);
.fi
.sp
.nf
XIFreeDeviceInfo( XIDeviceInfo *info);
.fi
.sp
.nf
deviceid
       Specifies the device to query or XIAllDevices or
       XIAllMasterDevices\&.
.fi
.sp
.nf
display
       Specifies the connection to the X server\&.
.fi
.sp
.nf
ndevices_return
       Returns the number of devices returned\&.
.fi
.sp
.nf
info
       A list of device XIDeviceInfo structs to be freed\&.
.fi
.SH "DESCRIPTION"
.sp
.if n \{\
.RS 4
.\}
.nf
The XIQueryDevice returns information about one or more input
devices\&. If the deviceid specifies a device, ndevices_return is
1 and the returned information describes only the requested
device\&. If deviceid is XIAllDevices or XIAllMasterDevices,
ndevices_return is the number of devices or master devices,
respectively, and the returned information represents all
devices or all master devices, respectively\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
To free the XIDeviceInfo array returned by XIQueryDevice, use
XIFreeDeviceInfo\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
For each input device requested, the XIQueryDevice returns an
XIDeviceInfo structure\&. Each structure contains information
about the capabilities of one input device available to the
server\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int                 deviceid;
    char                *name;
    int                 use;
    int                 attachment;
    Bool                enabled;
    int                 num_classes;
    XIAnyClassInfo      **classes;
} XIDeviceInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The deviceid is the numeric unique id of the device\&. A deviceid
is unique for the life\-time of a device but a server may re\-use
the id once a device has been removed\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The name points to a null\-terminated string specifying the
identifier of the device\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The use and attachment fields specify the type of the device
and the current attachment or pairing\&.
\- If use is XIMasterPointer, the device is a master pointer and
  attachment specifies the deviceid of the paired master
  keyboard\&.
\- If use is XIMasterKeyboard, the device is a master keyboard,
  and the attachment field specifies the paired master pointer\&.
\- If use is XISlavePointer, the device is a slave device and
  currently attached to the master pointer specified in
  attachment\&.
\- If use is XISlaveKeyboard, the device is a slave device an
  currently attached to the master keyboard specified in
  attachment\&.
\- If use is XIFloatingSlave, the device is a slave device
  currently not attached to any master device\&. The value of the
  attachment field for floating slave devices is undefined\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The enabled field specifies if the device is currently enabled
and can send events\&. Disabled devices will not send events\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The num_classes field specifies the number of input classes
pointed to by classes\&. The first two fields of all input
classes are identical\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
} XIAnyClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The type field specifies the type of the input class\&.
Currently, the following types are defined:
    XIKeyClass, XIButtonClass, XIValuatorClass, XIScrollClass,
    XITouchClass, XIGestureClass\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
In the future, additional types may be added\&. Clients are
required to ignore unknown input classes\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The sourceid is the deviceid this class originated from\&. For
master devices, the sourceid is typically the id of the slave
device currently sending events\&. For slave devices, the
sourceid is typically the device\*(Aqs id\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
A device may have zero or one XIButtonClass, denoting the
device\*(Aqs capability to send button events\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct {
    int           mask_len;
    unsigned char *mask;
} XIButtonState;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
    int         num_buttons;
    Atom        *labels;
    XIButtonState state;
} XIButtonClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The num_buttons field specifies the number of buttons available
on this device\&. A device that has an XIButtonClass must have at
least one button\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
labels is a list of num_buttons Atoms specifying the button
labels for this device\&. If the label is not None, then the
label specifies the type of button in physical device order
(i\&.e\&. as the buttons are numbered on the physical input
device)\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The state is the current button state as seen by clients (i\&.e\&.
after button mapping is applied)\&. The mask_len field specifies
the length of mask in bytes\&. For each button on the device, the
respective bit in mask is set if the button is currently
logically down\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
A device may have zero or one XIKeyClass, denoting the device\*(Aqs
capability to send key events\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
    int         num_keycodes;
    int         *keycodes;
} XIKeyClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The num_keycodes field specifies the number of keycodes
available on this device\&. A device that has an XIKeyClass must
have at least one keycode\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
keycodes is a list of num_keycodes keycodes the device may
send\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
A device may have zero or more XIValuatorClass, denoting the
device\*(Aqs capability to send coordinates\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
    int         number;
    Atom        label;
    double      min;
    double      max;
    double      value;
    int         resolution;
    int         mode;
} XIValuatorClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The number field specifies the number of the axis on the
physical device\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
If the label field is not None, the value of label is an Atom
describing the axis\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
min and max are the minimum and maximum values allowed on this
axis\&. If both are zero, no minimum or maximum values are set on
this device\&. value is the current value of this axis\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The resolution field specifies the resolution of the device in
units/m\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The mode specifies the mode of this axis\&. If the mode is
XIModeAbsolute this axis sends absolute coordinates\&. If the
mode is XIModeRelative, this device sends relative coordinates\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
    int         number;
    int         scroll_type;
    double      increment;
    int         flags;
} XIScrollClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
This class describes scrolling capability on a valuator\&. For
each XIScrollClassInfo, an XIValuatorClassInfo with the same
number is present on the device\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The number field specifies the valuator number on the physical
device that this scroll information applies to\&. See the
respective XIValuatorClassInfo for detailed information on this
valuator\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The scroll_type field specifies the type of scrolling, either
XIScrollTypeVertical or XIScrollTypeHorizontal\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The increment specifies the value change considered one unit of
scrolling down\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The flags field specifies flags that apply to this scrolling
information:
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
If XIScrollFlagNoEmulation is set, the server will not
emulate legacy button events for valuator changes on this
valuator\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
If XIScrollFlagPreferred is set, this axis is the
preferred axis for this scroll type and will be used for
the emulation of XI_Motion events when the driver submits
legacy scroll button events\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
    int         mode;
    int         num_touches;
} XITouchClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
A device may have zero or one XITouchClassInfo, denoting
multi\-touch capability on the device\&. A device with a XITouchClassInfo
may send TouchBegin, TouchUpdate, TouchEnd and TouchOwnership events\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The mode field is either XIDirectTouch for direct\-input touch devices
such as touchscreens or XIDependentTouch for indirect input devices such
as touchpads\&. For XIDirectTouch devices, touch events are sent to window
at the position the touch occurred\&. For XIDependentTouch devices, touch
events are sent to the window at the position of the device\*(Aqs sprite\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The num_touches field defines the maximum number of simultaneous touches
the device supports\&. A num_touches of 0 means the maximum number of
simultaneous touches is undefined or unspecified\&. This field should be
used as a guide only, devices will lie about their capabilities\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
A device with an XITouchClassInfo may still send pointer events\&. The
valuators must be defined with the respective XIValuatorClass
classes\&. A valuator may send both pointer and touch\-events\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct
{
    int         type;
    int         sourceid;
    int         num_touches;
} XIGestureClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
A device may have zero or one XIGestureClassInfo, denoting
touchpad gesture capability on the device\&. A device with a XIGestureClassInfo
may send GestureSwipeBegin, GestureSwipeUpdate, GestureSwipeEnd,
GesturePinchBegin, GesturePinchUpdate, GesturePinchEnd\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The num_touches field defines the maximum number of simultaneous touches
the device supports\&. A num_touches of 0 means the maximum number of
simultaneous touches is undefined or unspecified\&. This field should be
used as a guide only, devices will lie about their capabilities\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
XIQueryDevice can generate a BadDevice error\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
XIFreeDeviceInfo frees the information returned by
XIQueryDevice\&.
.fi
.if n \{\
.RE
.\}
.SH "DIAGNOSTICS"
.sp
.if n \{\
.RS 4
.\}
.nf
BadDevice
       An invalid device was specified\&. The device does not
       exist or is not a pointer device\&.
.fi
.if n \{\
.RE
.\}