summaryrefslogtreecommitdiff
path: root/man/XI.xml
blob: 8466621e21d462ed1c1aeeb3a65736c7a96af77c (plain)
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
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
            "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" >
<!--

    Copyright &copyright; by Hewlett-Packard Company, Ardent Computer,

    Permission to use, copy, modify, distribute, and sell this documentation
    for any purpose and without fee is hereby granted, provided that the above
    copyright notice and this permission notice appear in all copies.
    Ardent, and Hewlett-Packard make no representations about the
    suitability for any purpose of the information in this document.  It is
    provided &quot;as is&quot; without express or implied warranty.


    Copyright © 2008 Peter Hutterer

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice (including the next
    paragraph) shall be included in all copies or substantial portions of the
    Software.

    THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.

    Author: Peter Hutterer, UniSA, NICTA

    -->
<reference>
<title>X Input Extension Library</title>

<refentry id="XAllowDeviceEvents.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XAllowDeviceEvents</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
	<refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XAllowDeviceEvents</refname>
        <refpurpose>release queued events</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XAllowDeviceEvents</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>int <parameter>event_mode</parameter></paramdef>
                <paramdef>Time <parameter>time</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device from which events are to be allowed.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_mode</parameter></term>
                    <listitem><para>Specifies the event mode.You can pass <constant>AsyncThisDevice</constant>, <constant>SyncThisDevice</constant>, <constant>ReplayThisDevice</constant>, <constant>AsyncOtherDevices</constant>, <constant>SyncAll</constant>,or <constant>AsyncAll</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>time</parameter></term>
                    <listitem><para>Specifies the time.You can pass either a timestamp or <constant>CurrentTime</constant>.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
    <para>The <constant>XAllowDeviceEvents</constant> function releases some queued events if the client has caused a device to freeze. It has no effect if the specified time is earlier than the last-grab time of the most recent active grab for the client and device, or if the specified time is later than the current X server time.</para>
    <para>
      The following describes the processing that occurs depending on what constant you pass to the event_mode argument.</para>
    <para>
      <constant>AsyncThisDevice</constant> If the specified device is frozen by the client, event processing for that device continues as usual. If the device is frozen multiple times by the client on behalf of multiple separate grabs, <constant>AsyncThisDevice</constant> thaws for all.<constant>AsyncThisDevice</constant> has no effect if the specified device is not frozen by the client, but the device need not be grabbed by the client.</para>
    <para>
      <constant>SyncThisDevice</constant> If the specified device is frozen and actively grabbed by the client, event processing for that device continues normally until the next key or button event is reported to the client. At this time, the specified device again appears to freeze. However, if the reported event causes the grab to be released, the specified device does not freeze.  <constant>SyncThisDevice</constant> has no effect if the specified device is not frozen by the client or is not grabbed by the client.</para>
    <para>
      <constant>ReplayThisDevice</constant> If the specified device is actively grabbed by the client and is frozen as the result of an event having been sent to the client (either from the activation of a GrabDeviceButton or from a previous AllowDeviceEvents with mode SyncThisDevice, but not from a GrabDevice), the grab is released and that event is completely reprocessed. This time, however, the request ignores any passive grabs at or above (toward the root) that the grab-window of the grab just released. The request has no effect if the specified device is not grabbed by the client or if it is not frozen as the result of an event.</para>
    <para>
      <constant>AsyncOtherDevices</constant> If the remaining devices are frozen by the client, event processing for them continues as usual. If the other devices are frozen multiple times by the client on behalf of multiple grabs, <constant>AsyncOtherDevices</constant> &quot;thaws&quot; for all.  <constant>AsyncOtherDevices</constant> has no effect if the devices are not frozen by the client.</para>
    <para>
      <constant>SyncAll</constant> If all devices are frozen by the client, event processing (for all devices) continues normally until the next button or key event is reported to the client for a grabbed device, at which time all devices again appear to freeze. However, if the reported event causes the grab to be released, then the devices do not freeze. If any device is still grabbed, then a subsequent event for it will still cause all devices to freeze.  <constant>SyncAll</constant> has no effect unless all devices are frozen by the client. If any device is frozen twice by the client on behalf of two separate grabs, <constant>SyncAll</constant> thaws for both. A subsequent freeze for <constant>SyncAll</constant> will only freeze each device once.</para>
    <para>
      <constant>AsyncAll</constant> If all devices are frozen by the client, event processing for all devices continues normally. If any device is frozen multiple times by the client on behalf of multiple separate grabs, <constant>AsyncAll</constant> thaws for all.  <constant>AsyncAll</constant> has no effect unless all devices are frozen by the client.</para>
    <para>
      <constant>AsyncThisDevice</constant>, <constant>SyncThisDevice</constant>, and <constant>ReplayThisDevice</constant> have no effect on the processing of events from the remaining devices.<constant>AsyncOtherDevices</constant> has no effect on the processing of events from the specified device. When the event_mode is <constant>SyncAll</constant> or <constant>AsyncAll</constant>, the device parameter is ignored.</para>
    <para>
      It is possible for several grabs of different devices by the same or different clients to be active simultaneously. If a device is frozen on behalf of any grab, no event processing is performed for the device. It is possible for a single device to be frozen because of several grabs. In this case, the freeze must be released on behalf of each grab before events can again be processed.</para>
    <para>
      <constant>XAllowDeviceEvents</constant> can generate a <constant>BadDevice</constant> or <constant>BadValue</constant> error.</para>
  </refsect1>

  <refsect1><title>Diagnostics</title><para>
      <variablelist>
        <varlistentry>
          <term><errorname>BadDevice</errorname></term>
          <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term><errorname>BadValue</errorname></term>
          <listitem><para>An invalid mode was specified on the request.</para>
          </listitem>
        </varlistentry>
      </variablelist>
    </para>
  </refsect1>

  <refsect1><title>See also</title>
    <para>XGrabDevice(3)</para>
  </refsect1>
</refentry>

<refentry id="XChangeDeviceDontPropagateList.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XChangeDeviceDontPropagateList</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XChangeDeviceDontPropagateList</refname>
	<refname>XGetDeviceDontPropagateList</refname>
        <refpurpose>query or change the dont-propagate-list for extension devices</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XChangeDeviceDontPropagateList</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window*<parameter>window</parameter></paramdef>
                <paramdef>int *<parameter>count</parameter></paramdef>
                <paramdef>XEventClass *<parameter>event_list</parameter></paramdef>
                <paramdef>int<parameter>mode</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>XEventClass* <function>XGetDeviceDontPropagateList</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window *<parameter>window</parameter></paramdef>
                <paramdef>int *<parameter>count</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>window</parameter></term>
                    <listitem><para>Specifies the window whose dont-propagate-list is to be queried or modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_list</parameter></term>
                    <listitem><para>Specifies a pointer to a list of event classes.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>mode</parameter></term>
                    <listitem><para>Specifies the mode.You can pass <constant>AddToList</constant>, or <constant>DeleteFromList</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>count</parameter></term>
                    <listitem><para>Specifies the number of event classes in the list.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XChangeDeviceDontPropagateList</constant> request modifies the list of events that should not be propagated to ancestors of the event window. This request allows extension events to be added to or deleted from that list. By default, all events are propagated to ancestor windows. Once modified, the list remains modified for the life of the window. Events are not removed from the list because the client that added them has terminated.</para>
        <para>
            Suppression of event propagation is not allowed for all input extension events. If a specified event class is one that cannot be suppressed, a <constant>BadClass</constant> error will result. Events that can be suppressed include <constant>DeviceKeyPress</constant>, <constant>DeviceKeyRelease</constant>, <constant>DeviceButtonPress</constant>, <constant>DeviceButtonRelease</constant>, <constant>DeviceMotionNotify</constant>, <constant>ProximityIn</constant>, and <constant>ProximityOut</constant>.</para>
        <para>
            <constant>XChangeDeviceDontPropagateList</constant> can generate a <constant>BadDevice</constant>, <constant>BadClass</constant>, or <constant>BadValue</constant> error.</para>
        <para>
            The <constant>XGetDeviceDontPropagateList</constant> request queries the list of events that should not be propagated to ancestors of the event window.</para>
        <para>
            <constant>XGetDeviceDontPropagateList</constant> can generate a <constant>BadClass</constant>  or <constant>BadWindow</constant> error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the <constant>XChangeKeyboardDevice</constant> or <constant>XChangePointerDevice</constant> requests.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>An invalid window id was specified.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadClass</errorname></term>
                    <listitem><para>An invalid event class was specified.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>

<refentry id="XChangeKeyboardDevice.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XChangeKeyboardDevice</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XChangeKeyboardDevice</refname>
        <refpurpose>change which device is used as the X keyboard</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XChangeKeyboardDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice*<parameter>device</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device to be used as the X keyboard.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XChangeKeyboardDevice</constant> request causes the server to use the specified device as the X keyboard. The device must have been previously opened by the requesting client via <constant>XOpenDevice</constant> or a <constant>BadDevice</constant> error will result. The device must support input class <constant>Keys</constant>, or a <constant>BadMatch</constant> error will result. If the server implementation does not support using the requested device as the X keyboard, a <constant>BadDevice</constant> error will result.</para>
        <para>
            If the specified device is grabbed by another client, <constant>AlreadyGrabbed</constant> is returned. If the specified device is frozen by a grab on another device, <constant>GrabFrozen</constant> is returned. If the request is successful, <constant>Success</constant> is returned.</para>
        <para>
            If the request succeeds, a <constant>ChangeDeviceNotify</constant> event is sent to all clients that have selected that event. A <constant>MappingNotify</constant> event with request = <constant>MappingKeyboard</constant> is sent to all clients. The specified device becomes the X keyboard and the old X keyboard becomes accessible through the input extension protocol requests.</para>
        <para>
            <constant>XChangeKeyboardDevice</constant> can generate a <constant>BadDevice</constant> or a <constant>BadMatch</constant> error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist, has not been opened by this client via <constant>XOpenInputDevice</constant>, or is already one of the core X device (pointer or keyboard). This error may also occur if the server implementation does not support using the specified device as the X keyboard.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XChangeKeyboardDevice</constant> request was made specifying a device that has no keys.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para>XChangePointerDevice</para>
    </refsect1>
</refentry>

<refentry id="XChangePointerDevice.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XChangePointerDevice</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XChangePointerDevice</refname>
        <refpurpose>change which device is the X pointer</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XChangePointerDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>int <parameter>xaxis</parameter></paramdef>
                <paramdef>int <parameter>yaxis</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device to be used as the X pointer.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>xaxis</parameter></term>
                    <listitem><para>Specifies the axis of the device to be used as the X pointer x-axis.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>yaxis</parameter></term>
                    <listitem><para>Specifies the axis of the device to be used as the X pointer y-axis.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XChangePointerDevice</constant> request causes the server to use the specified device as the X pointer. The device must have been opened by the client via <constant>XOpenDevice</constant> or a <constant>BadDevice</constant> error will result. The device must support input class <constant>Valuators</constant> or a <constant>BadMatch</constant> error will result. If the implementation does not support use of the specified device as the X pointer, a <constant>BadDevice</constant> error will result.</para>
        <para>
            If the specified device is grabbed by another client, <constant>AlreadyGrabbed</constant> is returned. If the specified device is frozen by a grab on another device, <constant>GrabFrozen</constant> is returned. If the request is successful, <constant>Success</constant> is returned.</para>
        <para>
            If the request succeeds, a <constant>ChangeDeviceNotify</constant> event is sent to all clients that have selected that event. A <constant>MappingNotify</constant> event with request = <constant>MappingPointer</constant> is sent to all clients. The specified device becomes the X pointer, and the old X pointer becomes accessible through the input extension protocol requests.</para>
        <para>
            <constant>XChangePointerDevice</constant> can generate a <constant>BadDevice</constant> or a <constant>BadMatch</constant> error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist, has not been opened by this client via <constant>XOpenInputDevice</constant>, or is already one of the core X input devices (pointer or keyboard). This error may also occur if the server implementation does not support using the specified device as the X pointer.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XChangePointerDevice</constant> request was made specifying a device that has less than two valuators, or specifying a valuator index beyond the range supported by the device.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XChangeKeyboardDevice</para>
    </refsect1>
</refentry>

<refentry id="XDeviceBell.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XDeviceBell</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XDeviceBell</refname>
        <refpurpose>ring a bell on a device supported through the input extension</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XDeviceBell</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>XID *<parameter>feedbackclass</parameter></paramdef>
                <paramdef>XID *<parameter>feedbackid</parameter></paramdef>
                <paramdef>int *<parameter>percent</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device with which the bell is associated.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>feedbackclass</parameter></term>
                    <listitem><para>Specifies the class of the feedback with which the bell is associated.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>feedbackid</parameter></term>
                    <listitem><para>Specifies the id of the feedback with which the bell is associated.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>percent</parameter></term>
                    <listitem><para>Specifies the volume in the range -100 to 100 at which the bell should be rung.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XDeviceBell</constant> request causes the server to ring a bell on the specified feedback of the specified device, if possible. The specified volume is relative to the base volume for the bell. If an invalid device is specified, a <constant>BadDevice</constant> error will be returned. The feedbackclass and feedbackid parameters contain values returned by an <constant>XGetFeedbackControl</constant> request and uniquely identify the bell to ring. If a feedbackclass is specified that does not support a bell, or if a nonexistent feedbackid is specified, or a percent value is specified that is not in the range -100 to 100, a <constant>BadValue</constant> error will be returned.</para>
        <para>
            The volume at which the bell is rung when the percent argument is nonnegative is: base \- [(base * percent) / 100] + percent </para>
        <para>
            The volume at which the bell rings when the percent argument is negative is: base + [(base * percent) / 100] </para>
        <para>
            To change the base volume of the bell, use <constant>XChangeFeedbackControl</constant>.</para>
        <para>
            <constant>XDeviceBell</constant> can generate a <constant>BadDevice</constant> or a <constant>BadValue</constant> error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist, or has not been opened by this client via <constant>XOpenInputDevice</constant>.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>An invalid feedbackclass, feedbackid, or percent value was specified.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XChangeFeedbackControl(3), XBell(3)</para>
    </refsect1>
</refentry>

<refentry id="XGetDeviceControl.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGetDeviceControl</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGetDeviceControl</refname>
	<refname>XChangeDeviceControl</refname>
        <refpurpose>query and change input device controls</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>XDeviceControl *<function>XGetDeviceControl</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice*<parameter>device</parameter></paramdef>
                <paramdef>int *<parameter>controlType</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XChangeDeviceControl</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice*<parameter>device</parameter></paramdef>
                <paramdef>int <parameter>controlType</parameter></paramdef>
                <paramdef>XDeviceControl *<parameter>control</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose control is to be interrogated or modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>controlType</parameter></term>
                    <listitem><para>Specifies the type of control to be interrogated or changed.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>control</parameter></term>
                    <listitem><para>Specifies the address of an <constant>XDeviceControl</constant> structure that containsthe new values for the Device.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>These requests are provided to manipulate those input devices that support device control. A <constant>BadMatch</constant> error will be generated if the requested device does not support any device controls.</para>
        <para>
            Valid device control types that can be used with these requests include the following: </para>
        <para>
            DEVICE_RESOLUTION Queries or changes the resolution of valuators on input devices.</para>
        <para>
            The <constant>XGetDeviceControl</constant> request returns a pointer to an <constant>XDeviceControl</constant> structure.</para>
        <para>
            <constant>XGetDeviceControl</constant> can generate a <constant>BadDevice</constant> or <constant>BadMatch</constant> error.</para>
        <para>
            The <constant>XChangeDeviceControl</constant> request modifies the values of one control on the specified device. The control is identified by the id field of the <constant>XDeviceControl</constant> structure that is passed with the request.</para>
        <para>
            <constant>XChangeDeviceControl</constant> can generate a <constant>BadDevice</constant>, <constant>BadMatch</constant>, or <constant>BadValue</constant>  error..SH STRUCTURES Each control is described by a structure specific to that control. These structures are defined in the file <constant>XInput.h</constant>.</para>
        <para>
            <constant>XDeviceControl</constant> is a generic structure that contains two fields that are at the beginning of each class of control: </para>
        <para>
            <synopsis>
                typedef struct { 
                    XID <structfield>class</structfield>; 
                    int <structfield>length</structfield>; 
                } <structname>XDeviceControl</structname>; 
            </synopsis>
        </para>
        <para>
            The <constant>XDeviceResolutionState</constant> structure defines the information that is returned for device resolution for devices with valuators.</para>
        <para>
            <synopsis>
                typedef struct { 
                    XID <structfield>control</structfield>; 
                    int <structfield>length</structfield>; 
                    int <structfield>num_valuators</structfield>; 
                    int* <structfield>resolutions</structfield>; 
                    int* <structfield>min_resolutions</structfield>; 
                    int* <structfield>max_resolutions</structfield>; 
                } <structname>XDeviceResolutionState</structname>; 
            </synopsis>
        </para>
        <para>
            The <constant>XDeviceResolutionControl</constant> structure defines the attributes that can be controlled for keyboard Devices.</para>
        <para>
            <synopsis>
                typedef struct { 
                    XID <structfield>control</structfield>; 
                    int <structfield>length</structfield>; 
                    int <structfield>first_valuator</structfield>; 
                    int <structfield>num_valuators</structfield>; 
                    int* <structfield>resolutions</structfield>; 
                } <structname>XDeviceResolutionControl</structname>; 
            </synopsis>
        </para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the <constant>XChangeKeyboardDevice</constant> or <constant>XChangePointerDevice</constant> requests.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XGetDeviceControl</constant> request was made specifying a device that has no controls or an <constant>XChangeDeviceControl</constant> request was made with an <constant>XDeviceControl</constant> structure that contains an invalid Device type. It may also occur if an invalid combination of mask bits is specified ( <constant>DvKey</constant> but no <constant>DvAutoRepeatMode</constant> for keyboard Devices), or if an invalid KeySym is specified for a string Device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the <constant>XChangeDeviceControl</constant> request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para></para>
    </refsect1>
</refentry>

<refentry id="XGetDeviceKeyMapping.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGetDeviceKeyMapping</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGetDeviceKeyMapping</refname>
	<refname>XChangeDeviceKeyMapping</refname>
        <refpurpose>query or change device key mappings</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>KeySym *<function>XGetDeviceKeyMapping</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>KeyCode <parameter>first_keycode</parameter></paramdef>
                <paramdef>int <parameter>keycode_count</parameter></paramdef>
                <paramdef>int *<parameter>keysyms_per_keycode_return</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose key mapping is to be queried or modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>first_keycode</parameter></term>
                    <listitem><para>Specifies the first KeyCode to be returned.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>keycode_count</parameter></term>
                    <listitem><para>Specifies the number of KeyCodes to be returned or modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>keysyms_per_keycode</parameter></term>
                    <listitem><para>Specifies the number of KeySyms per KeyCode.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>keysyms_per_keycode_return</parameter></term>
                    <listitem><para>Specifies the address of a variable into which the number of KeySyms per KeyCodewill be returned.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>keysyms</parameter></term>
                    <listitem><para>Specifies the address of an array of KeySyms.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>For the specified device, the <constant>XGetDeviceKeyMapping</constant> request returns the symbols for the specified number of KeyCodes starting with first_keycode. The value specified in first_keycode must be greater than or equal to min_keycode as returned by <constant>XListInputDevices</constant>, or a <constant>BadValue</constant> error results. In addition, the following expression must be less than or equal to max_keycode as returned by <constant>XListInputDevices</constant>: </para>
        <para>
            first_keycode + keycode_count - 1  
        </para>
        <para>
            If this is not the case, a <constant>BadValue</constant> error results. The number of elements in the KeySyms list is: </para>
        <para>
            keycode_count * keysyms_per_keycode_return 
        </para>
        <para>
            KeySym number N, counting from zero, for KeyCode K has the following index in the list, counting from zero: (K - first_code) * keysyms_per_code_return + N </para>
        <para>
            The X server arbitrarily chooses the keysyms_per_keycode_return value to be large enough to report all requested symbols. A special KeySym value of <constant>NoSymbol</constant> is used to fill in unused elements for individual KeyCodes. To free the storage returned by <constant>XGetDeviceKeyMapping</constant>, use <constant>XFree</constant>.</para>
        <para>
            If the specified device does not support input class keys, a <constant>BadMatch</constant> error will result.</para>
        <para>
            <constant>XGetDeviceKeyMapping</constant> can generate a <constant>BadDevice</constant>, <constant>BadMatch</constant>, or <constant>BadValue</constant> error.</para>
        <para>
            For the specified device, the <constant>XChangeDeviceKeyMapping</constant> request defines the symbols for the specified number of KeyCodes starting with first_keycode. The symbols for KeyCodes outside this range remain unchanged. The number of elements in keysyms must be: </para>
        <para>
            num_codes * keysyms_per_keycode </para>
        <para>
            The specified first_keycode must be greater than or equal to min_keycode returned by <constant>XListInputDevices</constant>, or a <constant>BadValue</constant> error results. In addition, the following expression must be less than or equal to max_keycode as returned by <constant>XListInputDevices</constant>, or a <constant>BadValue</constant> error results: </para>
        <para>
            first_keycode + num_codes - 1</para>
        <para>
            KeySym number N, counting from zero, for KeyCode K has the following index in keysyms, counting from zero: </para>
        <para>
            (K - first_keycode) * keysyms_per_keycode + N</para>
        <para>
            The specified keysyms_per_keycode can be chosen arbitrarily by the client to be large enough to hold all desired symbols. A special KeySym value of <constant>NoSymbol</constant> should be used to fill in unused elements for individual KeyCodes. It is legal for <constant>NoSymbol</constant> to appear in nontrailing positions of the effective list for a KeyCode.<constant>XChangeDeviceKeyMapping</constant> generates a <constant>DeviceMappingNotify</constant> event that is sent to all clients that have selected that type of event.</para>
        <para>
            There is no requirement that the X server interpret this mapping. It is merely stored for reading and writing by clients.</para>
        <para>
            If the specified device does not support input class keys, a <constant>BadMatch</constant> error results.</para>
        <para>
            <constant>XChangeDeviceKeyMapping</constant> can generate a <constant>BadDevice</constant>, <constant>BadMatch</constant>, <constant>BadAlloc</constant>, or <constant>BadValue</constant>  error.</para>
        <para>
        </para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XGetDeviceKeyMapping</constant> or <constant>XChangeDeviceKeyMapping</constant> request was made specifying a device that has no keys.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadAlloc</errorname></term>
                    <listitem><para>The server failed to allocate the requested resource or server memory.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XSetDeviceButtonMapping(3), XSetDeviceModifierMapping(3)</para>
    </refsect1>
</refentry>

<refentry id="XGetDeviceModifierMapping.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGetDeviceModifierMapping</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGetDeviceModifierMapping</refname>
	<refname>XSetDeviceModifierMapping</refname>
        <refpurpose>query or change device modifier mappings</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XSetDeviceModifierMapping</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>XModifierKeymap *<parameter>modmap</parameter></paramdef>
        </funcprototype>
        <funcprototype>
          <funcdef>XModifierKeymap *<function>XGetDeviceModifierMapping</function></funcdef>
          <paramdef>Display *<parameter>display</parameter></paramdef>
          <paramdef>XDevice *<parameter>device</parameter></paramdef>
        </funcprototype>
      </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose modifier mapping is to be queried or modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>modmap</parameter></term>
                    <listitem><para>Specifies a pointer to the <constant>XModifierKeymap</constant> structure.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XSetDeviceModifierMapping</constant> request specifies the KeyCodes of the keys (if any) that are to be used as modifiers for the specified device. If it succeeds, the X server generates a <constant>DeviceMappingNotify</constant> event, and <constant>XSetDeviceModifierMapping</constant> returns <constant>MappingSuccess</constant>. X permits at most eight modifier keys. If more than eight are specified in the <constant>XModifierKeymap</constant> structure, a <constant>BadLength</constant> error results.</para>
        <para>
            The modifiermap member of the <constant>XModifierKeymap</constant> structure contains eight sets of max_keypermod KeyCodes, one for each modifier in the order <constant>Shift</constant>, <constant>Lock</constant>, <constant>Control</constant>, <constant>Mod1</constant>, <constant>Mod2</constant>, <constant>Mod3</constant>, <constant>Mod4</constant>, and <constant>Mod5</constant>. Only nonzero KeyCodes have meaning in each set, and zero KeyCodes are ignored. In addition, all of the nonzero KeyCodes must be in the range specified by min_keycode and max_keycode as returned by <constant>XListInputDevices</constant>, or a <constant>BadValue</constant> error results. No KeyCode may appear twice in the entire map, or a <constant>BadValue</constant> error results.</para>
        <para>
            An X server can impose restrictions on how modifiers can be changed, for example, if certain keys do not generate up transitions in hardware, if auto-repeat cannot be disabled on certain keys, or if multiple modifier keys are not supported. If some such restriction is violated, the status reply is <constant>MappingFailed</constant>, and none of the modifiers are changed. If the new KeyCodes specified for a modifier differ from those currently defined and any (current or new) keys for that modifier are in the logically down state, <constant>XSetDeviceModifierMapping</constant> returns <constant>MappingBusy</constant>, and none of the modifiers is changed.</para>
        <para>
            <constant>XSetDeviceModifierMapping</constant> can generate
            <constant>BadLength</constant>, <constant>BadDevice</constant>, <constant>BadMatch</constant>, <constant>BadAlloc</constant>, and <constant>BadValue</constant> errors.</para>
        <para>
            The <constant>XGetDeviceModifierMapping</constant> request returns a pointer to a newly created <constant>XModifierKeymap</constant> structure that contains the keys being used as modifiers. The structure should be freed after use by calling <constant>XFreeModifierMapping </constant>. If only zero values appear in the set for any modifier, that modifier is disabled.</para>
        <para>
            <constant>XGetDeviceModifierMapping</constant> can generate <constant>BadDevice</constant> and <constant>BadMatch</constant> errors. 
        </para>
    </refsect1>
    <refsect1><title>Structures</title>
        <para>
            The <constant>XModifierKeymap</constant> structure contains:
        </para> 
        <para>
            <synopsis>
                typedef struct { 
                int <structfield>max_keypermod</structfield>; 
                KeyCode *<structfield>modifiermap</structfield>; 
                } <structname>XModifierKeymap</structname>; 
            </synopsis>
        </para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadLength</errorname></term>
                    <listitem><para>More than eight keys were specified in the <constant>XModifierKeymap</constant> structure.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadAlloc</errorname></term>
                    <listitem><para>The server failed to allocate the requested resource or server memory.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XGetDeviceModifierMapping</constant> or <constant>XChangeDeviceModifierMapping</constant> request was made specifying a device that has no keys.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XSetDeviceKeyMapping(3), XSetDeviceButtonMapping(3)</para>
    </refsect1>
</refentry>

<refentry id="XGetDeviceMotionEvents.man"> 
    <refentryinfo>
      <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
      <refentrytitle>XGetDeviceMotionEvents</refentrytitle>
      <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGetDeviceMotionEvents</refname>
	<refname>XDeviceTimeCoord</refname>
       <refpurpose>get device motion history</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
      <title>Syntax</title>
      <funcsynopsis>
        <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
        <funcprototype>
          <funcdef>XDeviceTimeCoord *<function>XGetDeviceMotionEvents</function></funcdef>
          <paramdef>Display *<parameter>display</parameter></paramdef>
          <paramdef>XDevice *<parameter>device</parameter></paramdef>
          <paramdef>Time <parameter>start</parameter></paramdef>
          <paramdef>Time <parameter>stop</parameter></paramdef>
          <paramdef>int *<parameter>nevents_return</parameter></paramdef>
          <paramdef>int *<parameter>mode_return</parameter></paramdef>
          <paramdef>int *<parameter>axis_count_return</parameter></paramdef>
        </funcprototype>
      </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
          <variablelist>
            <varlistentry><term><parameter>display</parameter></term>
              <listitem><para>Specifies the connection to the X server.</para></listitem>
            </varlistentry>
            <varlistentry><term><parameter>device</parameter></term>
              <listitem><para>Specifies the device whose motion history is to be queried.</para></listitem>
            </varlistentry>
            <varlistentry>
                <term><parameter>start</parameter></term>
                <term><parameter>stop</parameter></term>
                <listitem><para>Specify the time interval in which the events are returned from the motionhistory buffer.You can pass a timestamp or <constant>CurrentTime</constant>.</para></listitem>
            </varlistentry>
            <varlistentry><term><parameter>nevents_return</parameter></term>
              <listitem><para>Returns the number of events from the motion history buffer.</para></listitem>
            </varlistentry>
            <varlistentry><term><parameter>mode_return</parameter></term>
              <listitem><para>Returns the mode of the device (<constant>Absolute</constant> or <constant>Relative</constant>).</para></listitem>
            </varlistentry>
            <varlistentry><term><parameter>axis_count_return</parameter></term>
              <listitem><para>Returns the count of axes being reported.</para></listitem>
            </varlistentry>
          </variablelist>
        </para>
      </refsect1>

      <refsect1><title>Description</title>
        <para>The server may retain the recent history of the device motion and do so to a finer granularity than is reported by <constant>DeviceMotionNotify</constant> events. The <constant>XGetDeviceMotionEvents</constant> request makes this history available.</para>
        <para>
          The <constant>XGetDeviceMotionEvents</constant> request returns all events in the motion history buffer that fall between the specified start and stop times, inclusive. If the start time is later than the stop time or if the start time is in the future, no events are returned. If the stop time is in the future, it is equivalent to specifying <constant>CurrentTime</constant>.</para>
        <para>
          The <constant>mode</constant> indicates whether the device is reporting absolute positional data (mode= <constant>Absolute</constant> ) or relative motion data (mode= <constant>Relative</constant> ). Some devices allow their mode to be changed via the <constant>XSetDeviceMode</constant> request. These constants are defined in the file XI.h. The <constant>axis_count</constant> returns the number of axes or valuators being reported by the device.</para>
        <para>
            <constant>XGetDeviceMotionEvents</constant> can generate a <constant>BadDevice</constant>, or <constant>BadMatch</constant> error. 
    </para>
</refsect1>
    <refsect1><title>Structures</title>
        <para>
            The <constant>XDeviceTimeCoord</constant> structure contains: </para>
        <para>
            <synopsis>
                typedef struct { 
                    Time <structfield>time</structfield>; 
                    int *<structfield>data</structfield>; 
                } <structname>XDeviceTimeCoord</structname>; 
            </synopsis>
        </para>
        <para>
            The time member is set to the time, in milliseconds. The data member is a pointer to an array of integers. These integers are set to the values of each valuator or axis reported by the device. There is one element in the array per axis of motion reported by the device. The value of the array elements depends on the mode of the device. If the mode is <constant>Absolute</constant>, the values are the raw values generated by the device. These may be scaled by client programs using the maximum values that the device can generate. The maximum value for each axis of the device is reported in the max_val field of the <constant>XAxisInfo</constant> returned by the <constant>XListInputDevices</constant> request. If the mode is <constant>Relative</constant>, the data values are the relative values generated by the device.</para>
        <para>
            You should use <constant>XFreeDeviceMotionEvents</constant> to free the data returned by this request.</para>
        <para>
            Errors returned by this request: <constant>BadDevice</constant>, <constant>BadMatch</constant>.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XGetDeviceMotionEvents</constant> request is made specifying a device that has no valuators and reports no axes of motion.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>

<refentry id="XGetExtensionVersion.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGetExtensionVersion</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XQueryInputVersion</refname>
	<refname>XGetExtensionVersion</refname>
        <refpurpose>query the version of the input extension.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>XExtensionVersion *<function>XQueryInputVersion</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>int <parameter>major</parameter></paramdef>
                <paramdef>int <parameter>minor</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>XExtensionVersion *<function>XGetExtensionVersion</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>char *<parameter>name</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>name</parameter></term>
                    <listitem><para>Specifies the extension to be queried.  The input extension name is definedin the header file  <constant>XI.h</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>major</parameter></term>
                    <listitem><para>Specifies the major version as supported by the client.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>minor</parameter></term>
                    <listitem><para>Specifies the minor version as supported by the client.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The  <constant>XQueryInputVersion</constant>  request queries the version of the input extension and returns an  <constant>XExtensionVersion</constant>  structure. This structure contains a major_version and minor_version number which can be compared with constants defined in  <constant>XI.h</constant>. The client must specify the highest version numbers it can supports.</para>
        <para>
            The  <constant>XGetExtensionVersion</constant>  request is deprecated and should not be used. Clients issuing a  <constant>XgetExtensionVersion</constant>  request will not be able to use MPX features. The  <constant>XGetExtensionVersion</constant>  request queries the version of the input extension, and returns an  <constant>XExtensionVersion</constant>  structure.  This structure contains a major_version and minor_version number which can be compared with constants defined in  <constant>XI.h</constant>.  Support for additional protocol requests added to the input extension after its initial release is indicated by a version number corresponding to the added requests.  Each version contains all the protocol requests contained by previous versions.</para>
        <para>
            You should use  <constant>XFree</constant>  to free the  <constant>XExtensionVersion</constant>  structure. 
        </para>
    </refsect1>
    <refsect1><title>Structures</title>
        <para>
            This request returns an XExtensionVersion structure. 
        </para>
        <para>
            <synopsis> 
                typedef struct { 
                int <structfield>present</structfield>; 
                short <structfield>major_version</structfield>; 
                short <structfield>minor_version; </structfield> 
                } <structname>XExtensionVersion</structname>; 
            </synopsis>
        </para>

    </refsect1>
</refentry>

<refentry id="XGetFeedbackControl.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGetFeedbackControl</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGetFeedbackControl</refname>
	<refname>XChangeFeedbackControl</refname>
        <refpurpose>query and change input device feedbacks</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>XFeedbackState *<function>XGetFeedbackControl</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>int *<parameter>num_feedbacks</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XChangeFeedbackControl</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice* <parameter>device</parameter></paramdef>
                <paramdef>Mask <parameter>mask</parameter></paramdef>
                <paramdef>XFeedbackControl *<parameter>control</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose feedbacks are to be queried or modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>num_feedbacks</parameter></term>
                    <listitem><para>Specifies an address into which the number of feedbacks supported by thedevice is to be returned.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>mask</parameter></term>
                    <listitem><para>Specifies a mask specific to each type of feedback that describes howthe feedback is to be modified.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>control</parameter></term>
                    <listitem><para>Specifies the address of an  <constant>XFeedbackControl</constant> structure that containsthe new values for the feedback.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>These requests are provided to manipulate those input devices that support feedbacks.  A  <constant>BadMatch</constant>  error will be generated if the requested device does not support feedbacks.  Whether or not a given device supports feedbacks can be determined by examining the information returned by the  <constant>XOpenDevice</constant>  request.  For those devices that support feedbacks,  <constant>XOpenDevice</constant>  will return an  <constant>XInputClassInfo</constant>  structure with the input_class field equal to the constant  <constant>FeedbackClass</constant>  (defined in the file  <constant>XI.h</constant> ).</para>
        <para>
            The  <constant>XGetFeedbackControl</constant>  request returns a pointer to a list of  <constant>XFeedbackState</constant>  structures.  Each item in this list describes one of the feedbacks supported by the device.  The items are variable length, so each contains its length to allow traversal to the next item in the list.</para>
        <para>
            The feedback classes that are currently defined are:   <constant>KbdFeedbackClass</constant>,  <constant>PtrFeedbackClass</constant>,  <constant>StringFeedbackClass</constant>,  <constant>IntegerFeedbackClass</constant>,  <constant>LedFeedbackClass</constant>, and  <constant>BellFeedbackClass</constant>.  These constants are defined in the file  <constant>XI.h</constant>.  An input device may support zero or more classes of feedback, and may support multiple feedbacks of the same class.  Each feedback contains a class identifier and an id that is unique within that class for that input device.  The id is used to identify the feedback when making an  <constant>XChangeFeedbackControl</constant>  request.</para>
        <para>
            <constant>XGetFeedbackControl</constant>  can generate a  <constant>BadDevice</constant>  or  <constant>BadMatch</constant>  error.</para>
        <para>
            The  <constant>XChangeFeedbackControl</constant>  request modifies the values of one feedback on the specified device.  The feedback is identified by the id field of the  <constant>XFeedbackControl</constant>  structure that is passed with the request.  The fields of the feedback that are to be modified are identified by the bits of the mask that is passed with the request.</para>
        <para>
            <constant>XChangeFeedbackControl</constant>  can generate a  <constant>BadDevice</constant>,  <constant>BadMatch</constant>, or  <constant>BadValue</constant>   error. 

        </para>
    </refsect1>
    <refsect1><title>Structures</title>
        <para>

            Each class of feedback is described by a structure specific to that class. These structures are defined in the file  <constant>XInput.h</constant>.  <constant>XFeedbackState</constant>  and  <constant>XFeedbackControl</constant>  are generic structures that contain three fields that are at the beginning of each class of feedback: </para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>; 
                int <structfield>length</structfield>; 
                XID <structfield>id</structfield>; 
                } <structname>XFeedbackState</structname>,
                <structname>XFeedbackControl;</structname> 
            </synopsis>
        </para>
        <para>
            The  <constant>XKbdFeedbackState</constant>  structure defines the attributes that are returned for feedbacks equivalent to those on the X keyboard.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>click</structfield>;
                int <structfield>percent</structfield>;
                int <structfield>pitch</structfield>;
                int <structfield>duration</structfield>;
                int <structfield>led_mask</structfield>;
                int <structfield>global_auto_repeat</structfield>;
                char <structfield>auto_repeats[32]</structfield>;
                } <structname>XKbdFeedbackState</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XPtrFeedbackState</constant>  structure defines the attributes that are returned for feedbacks equivalent to those on the the X pointer.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>accelNum</structfield>;
                int <structfield>accelDenom</structfield>;
                int <structfield>threshold</structfield>;
                } <structname>XPtrFeedbackState</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XIntegerFeedbackState</constant>  structure defines attributes that are returned for integer feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>resolution</structfield>;
                int <structfield>minVal</structfield>;
                int <structfield>maxVal</structfield>;
                } <structname>XIntegerFeedbackState</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XStringFeedbackState</constant>  structure defines the attributes that are returned for string feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>max_symbols</structfield>;
                int <structfield>num_syms_supported</structfield>;
                KeySym *<structfield>syms_supported</structfield>;
                } <structname>XStringFeedbackState</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XBellFeedbackState</constant>  structure defines the attributes that are returned for bell feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>percent</structfield>;
                int <structfield>pitch</structfield>;
                int <structfield>duration</structfield>;
                } <structname>XBellFeedbackState</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XLedFeedbackState</constant>  structure defines the attributes that are returned for LED feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>led_values</structfield>;
                } <structname>XLedFeedbackState</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XPrtFeedbackControl</constant>  structure defines the attributes that can be controlled for pointer feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>accelNum</structfield>;
                int <structfield>accelDenom</structfield>;
                int <structfield>threshold</structfield>;
                } <structname>XPtrFeedbackControl</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XKbdFeedbackControl</constant>  structure defines the attributes that can be controlled for keyboard feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>click</structfield>;
                int <structfield>percent</structfield>;
                int <structfield>pitch</structfield>;
                int <structfield>duration</structfield>;
                int <structfield>led_mask</structfield>;
                int <structfield>led_value</structfield>;
                int <structfield>key</structfield>;
                int <structfield>auto_repeat_mode</structfield>;
                } <structname>XKbdFeedbackControl</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XStringFeedbackControl</constant>  structure defines the attributes that can be controlled for string feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>num_keysyms</structfield>;
                KeySym  *<structfield>syms_to_display</structfield>;
                } <structname>XStringFeedbackControl</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XIntegerFeedbackControl</constant>  structure defines the attributes that can be controlled for integer feedbacks.</para>
        <para>
            <synopsis>
                typedef struct {
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                XID <structfield>id</structfield>;
                int <structfield>int_to_display</structfield>;
                } <structname>XIntegerFeedbackControl</structname>;
            </synopsis>
        </para>
        <para>
            The  <constant>XBellFeedbackControl</constant>  structure defines the attributes that can be controlled for bell feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID     <structfield>class</structfield>; 
                int     <structfield>length</structfield>; 
                XID     <structfield>id</structfield>; 
                int     <structfield>percent</structfield>; 
                int     <structfield>pitch</structfield>; 
                int     <structfield>duration</structfield>; 
                } <structname>XBellFeedbackControl</structname>;  
            </synopsis>
        </para>
        <para>
            The  <constant>XLedFeedbackControl</constant>  structure defines the attributes that can be controlled for LED feedbacks.</para>
        <para>
            <synopsis>
                typedef struct { 
                XID     <structfield>class</structfield>; 
                int     <structfield>length</structfield>; 
                XID     <structfield>id</structfield>; 
                int     <structfield>led_mask</structfield>; 
                int     <structfield>led_values</structfield>; 
                } <structname>XLedFeedbackControl</structname>;  
            </synopsis>
        </para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified.  The specified device does not exist or has not been opened by this client via  <constant>XOpenInputDevice</constant>.  This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the  <constant>XChangeKeyboardDevice</constant>  or  <constant>XChangePointerDevice</constant>  requests.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an  <constant>XGetFeedbackControl</constant>  request was made specifying a device that has no feedbacks, or an  <constant>XChangeFeedbackControl</constant>  request was made with an  <constant>XFeedbackControl</constant>  structure that contains an invalid feedback type.  It may also occur if an invalid combination of mask bits is specified ( <constant>DvKey</constant>  but no  <constant>DvAutoRepeatMode</constant>  for keyboard feedbacks), or if an invalid KeySym is specified for a string feedback.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the  <constant>XChangeFeedbackControl</constant>  request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted.  Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>


<refentry id="XGrabDeviceButton.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGrabDeviceButton</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGrabDeviceButton</refname>
	<refname>XUngrabDeviceButton</refname>
        <refpurpose>grab/ungrab extension input device buttons</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XGrabDeviceButton</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>unsigned int <parameter>button</parameter></paramdef>
                <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
                <paramdef>XDevice*<parameter>modifier_device</parameter></paramdef>
                <paramdef>Window <parameter>grab_window</parameter></paramdef>
                <paramdef>Bool<parameter>owner_events</parameter></paramdef>
                <paramdef>unsigned int <parameter>event_count</parameter></paramdef>
                <paramdef>XEventClass*<parameter>event_list</parameter></paramdef>
                <paramdef>int <parameter>this_device_mode</parameter></paramdef>
                <paramdef>int<parameter>other_devices_mode</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XUngrabDeviceButton</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>unsigned int <parameter>button</parameter></paramdef>
                <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
                <paramdef>XDevice*<parameter>modifier_device</parameter></paramdef>
                <paramdef>Window <parameter>grab_window</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device that is to be
                            grabbed or released</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>button</parameter></term>
                    <listitem><para>Specifies the device button that is to
                            be grabbed or released or <constant>AnyButton</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>modifiers</parameter></term>
                    <listitem><para>Specifies the set of keymasks or
                            <constant>AnyModifier</constant>.The mask is
                            the bitwise inclusive OR of the valid keymask
                            bits. Valid bits are:
                            <constant>Shiftmask</constant>,
                            <constant>LockMask</constant>,
                            <constant>ControlMask</constant>,
                            <constant>Mod1Mask</constant>,
                            <constant>Mod2Mask,Mod3Mask</constant>,
                            <constant>Mod4Mask</constant>,
                            <constant>Mod5Mask</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>modifier_device</parameter></term>
                    <listitem><para>specifies the device whose modifiers are to be used.  If the modifier_devicespecified is NULL, the X keyboard will be used as the modifier_device.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>grab_window</parameter></term>
                    <listitem><para>Specifies the grab window.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>owner_events</parameter></term>
                    <listitem><para>Specifies a Boolean value that indicates whether the deviceevents are to be reported as usual or reported with respect to the grab windowif selected by the event list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_count</parameter></term>
                    <listitem><para>Specifies the number of event classes in the event list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_list</parameter></term>
                    <listitem><para>Specifies which events are reported to the client.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>this_device_mode</parameter></term>
                    <listitem><para>Specifies further processing of events from this device.You can pass  <constant>GrabModeSync</constant> or  <constant>GrabModeAsync</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>other_devices_mode</parameter></term>
                    <listitem><para>Specifies further processing of events from all other devices.You can pass  <constant>GrabModeSync</constant> or  <constant>GrabModeAsync</constant>.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The  <constant>XGrabDeviceButton</constant>  request establishes a passive grab. In the future, the device is actively grabbed (as for  <constant>XGrabDevice</constant>, the last-grab time is set to the time at which the button was pressed (as transmitted in the  <constant>DeviceButtonPress</constant>  event), and the  <constant>DeviceButtonPress</constant>  event is reported if all of the following conditions are true: 

            <itemizedlist>
                <listitem>
                    <para>
                        The device is not grabbed, and the specified button is
                        logically pressed when the specified modifier keys are
                        logically down on the specified modifier device and no
                        other buttons or modifier keys are logically down.</para>
                </listitem>
                <listitem>
                    <para>Either the grab window is an ancestor of (or is) the
                        focus window, OR the grab window is a descendent of the
                        focus window and contains the device.</para>
                </listitem>
                <listitem>
                    <para>
                        A passive grab on the same button/modifier combination
                        does not exist on any ancestor of grab_window.
                    </para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            The interpretation of the remaining arguments is as for  <constant>XGrabDevice</constant>. The active grab is terminated automatically when the logical state of the device has all buttons released (independent of the logical state of the modifier keys).</para>
        <para>
            Note that the logical state of a device (as seen by client applications) may lag the physical state if device event processing is frozen.</para>
        <para>
            This request overrides all previous grabs by the same client on the same button/modifier combinations on the same window. A modifiers of  <constant>AnyModifier</constant>  is equivalent to issuing the grab request for all possible modifier combinations (including the combination of no modifiers). It is not required that all modifiers specified have currently assigned KeyCodes. A button of  <constant>AnyButton</constant>  is equivalent to issuing the request for all possible buttons. Otherwise, it is not required that the specified button currently be assigned to a physical button.</para>
        <para>
            A modifier_device of NULL indicates that the X keyboard is to be used as the modifier_device.</para>
        <para>
            If some other client has already issued a  <constant>XGrabDeviceButton</constant>  with the same button/modifier combination on the same window, a  <constant>BadAccess</constant>  error results. When using  <constant>AnyModifier</constant>  or  <constant>AnyButton</constant> , the request fails completely, and a  <constant>BadAccess</constant>  error results (no grabs are established) if there is a conflicting grab for any combination.  <constant>XGrabDeviceButton</constant>  has no effect on an active grab.</para>
        <para>
            <constant>XGrabDeviceButton</constant>  can generate  <constant>BadClass</constant>,  <constant>BadDevice</constant>,  <constant>BadMatch</constant>,  <constant>BadValue</constant>, and  <constant>BadWindow</constant>  errors..P The  <constant>XUngrabDeviceButton</constant>  request releases the passive grab for a button/modifier combination on the specified window if it was grabbed by this client. A modifier of  <constant>AnyModifier</constant>  is equivalent to issuing the ungrab request for all possible modifier combinations, including the combination of no modifiers. A button of  <constant>AnyButton</constant>  is equivalent to issuing the request for all possible buttons.  <constant>XUngrabDeviceButton</constant>  has no effect on an active grab.</para>
        <para>
            A modifier_device of NULL indicates that the X keyboard should be used as the modifier_device.</para>
        <para>
            <constant>XUngrabDeviceButton</constant>  can generate  <constant>BadDevice</constant>,  <constant>BadMatch</constant>,  <constant>BadValue</constant>  and  <constant>BadWindow</constant>  errors.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified.  The specified device does not exist or has not been opened by this client via  <constant>XOpenInputDevice</constant>.  This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an  <constant>XGrabDeviceButton</constant>  request was made specifying a device that has no buttons, or specifying a modifier device that has no keys.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted.  Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not name a defined Window.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XAllowDeviceEvents(3), XGrabDevice(3), XGrabDeviceKey(3)</para>
    </refsect1>
</refentry>

<refentry id="XGrabDeviceKey.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGrabDeviceKey</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGrabDeviceKey</refname>
	<refname>XUngrabDeviceKey</refname>
        <refpurpose>grab/ungrab extension input device Keys</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XGrabDeviceKey</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>unsigned int <parameter>Key</parameter></paramdef>
                <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
                <paramdef>XDevice *<parameter>modifier_device</parameter></paramdef>
                <paramdef>Window <parameter>grab_window</parameter></paramdef>
                <paramdef>Bool <parameter>owner_events</parameter></paramdef>
                <paramdef>unsigned int <parameter>event_count</parameter></paramdef>
                <paramdef>XEventClass <parameter>event_list</parameter></paramdef>
                <paramdef>int <parameter>this_device_mode</parameter></paramdef>
                <paramdef>int <parameter>other_devices_mode</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XUngrabDeviceKey</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>unsigned int <parameter>Key</parameter></paramdef>
                <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
                <paramdef>XDevice *<parameter>modifier_device</parameter></paramdef>
                <paramdef>Window <parameter>grab_window</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device that is to be
                            grabbed or released.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>Key</parameter></term>
                    <listitem><para>Specifies the device Key that is to be
                            grabbed released or <constant>AnyKey</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>modifiers</parameter></term>
                    <listitem><para>Specifies the set of keymasks or <constant>AnyModifier</constant>.The mask is the bitwise inclusive OR of the valid keymask bits.Valid bits are: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask,Mod3Mask, Mod4Mask, Mod5Mask.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>modifier_device</parameter></term>
                    <listitem><para>Specifies the device whose modifiers are to be used. If a modifier_device ofNULL is specified, the X keyboard will be used as the modifier_device.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>grab_window</parameter></term>
                    <listitem><para>Specifies the grab window.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>owner_events</parameter></term>
                    <listitem><para>Specifies a Boolean value that indicates whether the deviceevents are to be reported as usual or reported with respect to the grab windowif selected by the event list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_count</parameter></term>
                    <listitem><para>Specifies the number of event classes in the event list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_list</parameter></term>
                    <listitem><para>Specifies which device events are reported to the client.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>this_device_mode</parameter></term>
                    <listitem><para>Specifies further processing of events from this device.You can pass <constant>GrabModeSync</constant> or <constant>GrabModeAsync</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>other_devices_mode</parameter></term>
                    <listitem><para>Specifies further processing of events from other devices.You can pass <constant>GrabModeSync</constant>or <constant>GrabModeAsync</constant>.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XGrabDeviceKey</constant> request establishes a passive grab. In the future, the device is actively grabbed (as for <constant>XGrabDevice</constant>, the last-device-grab time is set to the time at which the Key was pressed (as transmitted in the <constant>DeviceKeyPress</constant> event), and the <constant>DeviceKeyPress</constant> event is reported if all of the following conditions are true: 

            <itemizedlist>
                <listitem>
                    <para>The device is not grabbed, and the specified key is logically pressed when the specified modifier keys are logically down, and no other keys or modifier keys are logically down.</para>
                </listitem>
                <listitem>
                    <para>The grab_window is an ancestor (or is) the focus window OR the grab window is a descendant of the focus window and contains the device.</para>
                </listitem>
                <listitem>
                    <para>The confine_to window (if any) is
                        viewable.</para>
                </listitem>
                <listitem>
                    <para>A passive grab on the same key/modifier combination does not exist on any ancestor of grab_window.</para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            The interpretation of the remaining arguments is as for <constant>XGrabDevice</constant>. The active grab is terminated automatically when the logical state of the device has the specified key released.</para>
        <para>
            Note that the logical state of a device (as seen by means of the X protocol ) may lag the physical state if device event processing is frozen.</para>
        <para>
            If the key is not <constant>AnyKey</constant>, it must be in the range specified by min_keycode and max_keycode as returned by the <constant>XListInputDevices</constant> request. Otherwise, a <constant>BadValue</constant> error results.</para>
        <para>
            This request overrides all previous grabs by the same client on the same Key/modifier combinations on the same window. A modifier of <constant>AnyModifier</constant> is equivalent to issuing the grab request for all possible modifier combinations (including the combination of no modifiers). It is not required that all modifiers specified have currently assigned KeyCodes. A key of <constant>AnyKey</constant> is equivalent to issuing the request for all possible keys. Otherwise, it is not required that the specified key currently be assigned to a physical Key.</para>
        <para>
            If a modifier_device of NULL is specified, the X keyboard will be used as the modifier_device.</para>
        <para>
            If some other client has already issued a <constant>XGrabDeviceKey</constant> with the same Key/modifier combination on the same window, a <constant>BadAccess</constant> error results. When using <constant>AnyModifier</constant> or <constant>AnyKey</constant>, the request fails completely, and a <constant>BadAccess</constant> error results (no grabs are established) if there is a conflicting grab for any combination.<constant>XGrabDeviceKey</constant> has no effect on an active grab.</para>
        <para>
            <constant>XGrabDeviceKey</constant> can generate <constant>BadAccess</constant>, <constant>BadClass</constant>, <constant>BadDevice</constant>, <constant>BadMatch</constant>, <constant>BadValue</constant>, and <constant>BadWindow</constant> errors. It returns <constant>Success</constant> on successful completion of the request. 
        </para>
        <para>
            The <constant>XUngrabDeviceKey</constant> request releases the passive grab for a key/modifier combination on the specified window if it was grabbed by this client. A modifier of <constant>AnyModifier</constant> is equivalent to issuing the ungrab request for all possible modifier combinations, including the combination of no modifiers. A Key of <constant>AnyKey</constant> is equivalent to issuing the request for all possible Keys.<constant>XUngrabDeviceKey</constant> has no effect on an active grab.</para>
        <para>
            If a modifier_device of NULL is specified, the X keyboard will be used as the modifier_device.</para>
        <para>
            <constant>XUngrabDeviceKey</constant> can generate <constant>BadDevice</constant>, <constant>BadMatch</constant>, <constant>BadValue</constant> and <constant>BadWindow</constant> errors.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XGrabDeviceKey</constant> request was made specifying a device that has no keys, or a modifier device that has no keys.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not name a defined Window.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XAllowDeviceEvents(3), XGrabDevice(3), XGrabDeviceButton(3)</para>
    </refsect1>
</refentry>

<refentry id="XGrabDevice.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XGrabDevice</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XGrabDevice</refname>
	<refname>XUngrabDevice</refname>
        <refpurpose>grab/release the specified extension device</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef> int <function>XGrabDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>grab_window</parameter></paramdef>
                <paramdef>Bool <parameter>owner_events</parameter></paramdef>
                <paramdef>int <parameter>event_count</parameter></paramdef>
                <paramdef>XEventClass *<parameter>event_list</parameter></paramdef>
                <paramdef>int <parameter>this_device_mode</parameter></paramdef>
                <paramdef>int <parameter>other_devices_mode</parameter></paramdef>
                <paramdef>Time <parameter>time</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XUngrabDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Time <parameter>time</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device to be grabbed or released.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>grab_window</parameter></term>
                    <listitem><para>Specifies the id of a window to be associated with the device.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>owner_events</parameter></term>
                    <listitem><para>Specifies a Boolean value that indicates whether theevents from the deviceare to be reported as usual or reported with respect to the grab windowif selected by the event list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_count</parameter></term>
                    <listitem><para>Specifies the number of elements in the event_list array.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_list</parameter></term>
                    <listitem><para>Specifies a pointer to a list of event classes that indicates which eventsthe client wishes to receive. These event classes must have beenobtained specifying the device being grabbed.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>this_device_mode</parameter></term>
                    <listitem><para>Specifies further processing of events from this device.You can pass <constant>GrabModeSync</constant>or <constant>GrabModeAsync</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>other_devices_mode</parameter></term>
                    <listitem><para>Specifies further processing of events from other devices.You can pass <constant>GrabModeSync</constant>or <constant>GrabModeAsync</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>time</parameter></term>
                    <listitem><para>Specifies the time.You can pass either a timestamp or <constant>CurrentTime</constant>.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XGrabDevice</constant> request actively grabs control of the device and generates <constant>DeviceFocusIn</constant> and <constant>DeviceFocusOut</constant> events. Further device events are reported only to the grabbing client.<constant>XGrabDevice</constant> overrides any active device grab by this client. event_list is a pointer to a list of event classes. This list indicates which events the client wishes to receive while the grab is active. If owner_events is <constant>False</constant>, all generated device events are reported with respect to grab_window if selected. If owner_events is <constant>True</constant> and if a generated device event would normally be reported to this client, it is reported normally; otherwise, the event is reported with respect to the grab_window, and is only reported if specified in the event_list.</para>
        <para>
            If the this_device_mode argument is <constant>GrabModeAsync</constant>, device event processing continues as usual. If the device is currently frozen by this client, then processing of device events is resumed. If the this_device_mode argument is <constant>GrabModeSync</constant>, the state of the device (as seen by client applications) appears to freeze, and the X server generates no further device events until the grabbing client issues a releasing <constant>XAllowDeviceEvents</constant> call or until the device grab is released. Actual device changes are not lost while the device is frozen; they are simply queued in the server for later processing.</para>
        <para>
            If other_devices_mode is <constant>GrabModeAsync</constant>, processing of events from other devices is unaffected by activation of the grab. If other_devices_mode is <constant>GrabModeSync</constant>, the state of all devices except the grabbed device (as seen by client applications) appears to freeze, and the X server generates no further events from those devices until the grabbing client issues a releasing <constant>XAllowDeviceEvents</constant> call or until the device grab is released. Actual events are not lost while the devices are frozen; they are simply queued in the server for later processing.</para>
        <para>
            If the device is actively grabbed by some other client, <constant>XGrabDevice</constant> fails and returns <constant>AlreadyGrabbed</constant>. If grab_window is not viewable, it fails and returns <constant>GrabNotViewable</constant>. If the device is frozen by an active grab of another client, it fails and returns <constant>GrabFrozen</constant>. If the specified time is earlier than the last-device-grab time or later than the current X server time, it fails and returns <constant>GrabInvalidTime</constant>. Otherwise, the last-device-grab time is set to the specified time <constant>( CurrentTime</constant> is replaced by the current X server time).</para>
        <para>
            If a grabbed device is closed by a client while an active grab by that client is in effect, the active grab is released. If the device is frozen only by an active grab of the requesting client, it is thawed.</para>
        <para>
            <constant>XGrabDevice</constant> can generate <constant>BadClass</constant>, <constant>BadDevice</constant>, <constant>BadValue</constant>, and <constant>BadWindow</constant> errors.</para>
        <para>
            The <constant>XUngrabDevice</constant> request releases the device and any queued events if this client has it actively grabbed from either <constant>XGrabDevice</constant> or <constant>XGrabDeviceKey</constant>. If other devices are frozen by the grab, <constant>XUngrabDevice</constant> thaws them.<constant>XUngrabDevice</constant> does not release the device and any queued events if the specified time is earlier than the last-device-grab time or is later than the current X server time. It also generates <constant>DeviceFocusIn</constant> and <constant>DeviceFocusOut</constant> events. The X server automatically performs an <constant>UngrabDevice</constant> request if the event window for an active device grab becomes not viewable.</para>
        <para>
            <constant>XUngrabDevice</constant> can generate a <constant>BadDevice</constant> error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not name a defined Window.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XAllowDeviceEvents(3),XGrabDeviceButton(3),XGrabDeviceKey(3)</para>
    </refsect1>
</refentry>

<refentry id="XListInputDevices.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XListInputDevices</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
	<refname>XListInputDevices</refname>
	<refname>XFreeDeviceList</refname>
        <refpurpose>list available input devices</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>XDeviceInfo *<function>XListInputDevices</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>int *<parameter>ndevices_return</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XFreeDeviceList</function></funcdef>
                <paramdef>XDeviceInfo *<parameter>list</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>ndevices_return</parameter></term>
                    <listitem><para>Specifies a pointer to a variable where the number of available devices canbe returned.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>list</parameter></term>
                    <listitem><para>Specifies the list of devices to free. The <constant>XFreeDeviceList</constant> functionfrees the list of available extension input devices.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XListInputDevices</constant> request lists the available input devices. This list includes all master pointers and master keyboards as well as the physical input devices 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.</para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            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: 

            <synopsis>
                typedef struct _XDeviceInfo { 
                XID     <structfield>id</structfield>; 
                Atom    <structfield>type</structfield>; 
                char    *<structfield>name</structfield>; 
                int	    <structfield>num_classes</structfield>; 
                int	    <structfield>use</structfield>; 
                XAnyClassPtr <structfield>inputclassinfo</structfield>; 
                } <structname>XDeviceInfo</structname>; 
            </synopsis>
        </para>

        <para>
            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.</para>
        <para>
            The type field is of type Atom and indicates the nature of the device.</para>
        <para>
            The name field contains a pointer to a null-terminated string that corresponds to one of the defined device types. The name will correspond to one of the following strings (defined in the header file <constant>XI.h</constant>:</para>
        <para>
            <constant>XI_MOUSE</constant> <constant>XI_TABLET</constant> <constant>XI_KEYBOARD</constant> <constant>XI_TOUCHSCREEN</constant> <constant>XI_TOUCHPAD</constant> <constant>XI_BUTTONBOX</constant> <constant>XI_BARCODE</constant> <constant>XI_TRACKBALL</constant> <constant>XI_QUADRATURE</constant> <constant>XI_ID_MODULE</constant> <constant>XI_ONE_KNOB</constant> <constant>XI_NINE_KNOB</constant> <constant>XI_KNOB_BOX</constant> <constant>XI_SPACEBALL</constant> <constant>XI_DATAGLOVE</constant> <constant>XI_EYETRACKER</constant> <constant>XI_CURSORKEYS</constant> <constant>XI_FOOTMOUSE</constant></para>
        <para>
            These names may be directly compared with the name field of the XDeviceInfo structure, or used in an XInternAtom request to return an atom that can be compared with the type field of the XDeviceInfo structure.</para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            The use field specifies how the device is currently being used. If the value is <constant>IsXKeyboard</constant>, the device is a master keyboard. If the value is <constant>IsXPointer</constant>, the device is a master pointer. If the value is <constant>IsXExtensionPointer</constant>, the device is a slave pointer. If the value is <constant>IsXExtensionKeyboard</constant>, the device is a slave keyboard. If the value is <constant>IsXExtensionDevice</constant>, the device is available for use as an extension device.</para>
        <para>
            The inputclassinfo field contains a pointer to the first input-class specific data. The first two fields are common to all classes.</para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            The XKeyInfo structure describes the characteristics of the keys on the device. It is defined as follows: </para>
        <para>
            <synopsis>
                typedef struct _XKeyInfo { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                unsigned short <structfield>min_keycode</structfield>;
                unsigned short <structfield>max_keycode</structfield>;
                unsigned short <structfield>num_keys</structfield>;
                } <structname>XKeyInfo</structname>;

            </synopsis>
        </para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            num_keys specifies the number of keys that the device has.</para>
        <para>
            The XButtonInfo structure defines the characteristics of the buttons on the device. It is defined as follows: </para>
        <para>
            <synopsis>
                typedef struct _XButtonInfo { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                short <structfield>num_buttons</structfield>;
                } <structname>XButtonInfo</structname>;
            </synopsis>
        </para>
        <para>
            num_buttons specifies the number of buttons that the device has.</para>
        <para>
            The XValuatorInfo structure defines the characteristics of the valuators on the device. It is defined as follows: </para>
        <para>
            <synopsis>
                typedef struct	_XValuatorInfo { 
                XID <structfield>class</structfield>;
                int <structfield>length</structfield>;
                unsigned char <structfield>num_axes</structfield>;
                unsigned char <structfield>mode</structfield>;
                unsigned long <structfield>motion_buffer</structfield>;
                XAxisInfoPtr <structfield>axes</structfield>;
                } <structname>XValuatorInfo</structname>;
            </synopsis>
        </para>
        <para>
            num_axes contains the number of axes the device supports.</para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            The axes field contains a pointer to an XAxisInfo structure.</para>
        <para>
            The XAxisInfo structure is defined as follows: </para>
        <para>
            <synopsis>
                typedef struct _XAxisInfo { 
                int <structfield>resolution</structfield>;
                int <structfield>min_value</structfield>;
                int <structfield>max_value</structfield>;
                } <structname>XAxisInfo</structname>;
            </synopsis>
        </para>
        <para>
            The resolution contains a number in counts/meter.</para>
        <para>
            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.</para>
        <para>
            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.</para>
        <para>
            The XAttachInfo structure is defined as follows: </para>
        <para>
            <synopsis>
                typedef struct _XAttachInfo { 
                int	<structfield>attached</structfield>; 
                } <structname>XAttachInfo</structname>; 
            </synopsis>
        </para>
        <para>
            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 <constant>Floating</constant>. If the device is a master device, attached specifies the device ID of the master device this device is paired with.</para>
        <para>
            To free the <constant>XDeviceInfo</constant> array created by <constant>XListInputDevices</constant>, use <constant>XFreeDeviceList</constant>.</para>
    </refsect1>
</refentry>

<refentry id="XOpenDevice.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XOpenDevice</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XOpenDevice</refname>
	<refname>XCloseDevice</refname>
        <refpurpose>open or close an extension input device</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>XDevice *<function>XOpenDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XID <parameter>device_id</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef><function>XCloseDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device_id</parameter></term>
                    <listitem><para>Specifies the id of the device to be opened</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device to be closed</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XOpenDevice</constant> request makes an input
            device accessible to a client through input extension protocol
            requests. If successful, it returns a pointer to an <constant>XDevice</constant> structure.</para>
        <para>
            The <constant>XCloseDevice</constant> request makes an input device inaccessible to a client through input extension protocol requests. Before terminating, and client that has opened input devices through the input extension should close them via <constant>CloseDevice</constant>.</para>
        <para>
            When a client makes an <constant>XCloseDevice</constant> request, any active grabs that the client has on the device are released. Any event selections that the client has are deleted, as well as any passive grabs. If the requesting client is the last client accessing the device, the server may disable all access by X to the device.</para>
        <para>
            <constant>XOpenDevice</constant> and <constant>XCloseDevice</constant> can generate a <constant>BadDevice</constant> error.

        </para>
    </refsect1>
    <refsect1><title>Structures</title>
        <para>
            The <constant>XDevice</constant> structure returned by <constant>XOpenDevice</constant> contains:

            <synopsis>
                typedef struct { 
                XID <structfield>device_id</structfield>; 
                int <structfield>num_classes</structfield>; 
                XInputClassInfo *<structfield>classes</structfield>; 
                } <structname>XDevice</structname>;
            </synopsis>
        </para>
        <para>
            The classes field is a pointer to an array of XInputClassInfo structures. Each element of this array contains an event type base for a class of input supported by the specified device. The num_classes field indicates the number of elements in the classes array.</para>
        <para>
            The <constant>XInputClassInfo</constant> structure contains: </para>
        <para>
            <synopsis>
                typedef struct { 
                unsigned char <structfield>input_class</structfield>; 
                unsigned char <structfield>event_type_base</structfield>; 
                } <structname>XInputClassInfo</structname>; 
            </synopsis>
        </para>
        <para>
            The input_class field identifies one class of input supported by the device. Defined types include <constant>KeyClass</constant>, <constant>ButtonClass</constant>, <constant>ValuatorClass</constant>, <constant>ProximityClass</constant>, <constant>FeedbackClass</constant>, <constant>FocusClass</constant>, and <constant>OtherClass</constant>. The event_type_base identifies the event type of the first event in that class.</para>
        <para>
            The information contained in the <constant>XInputClassInfo</constant> structure is used by macros to obtain the event classes that clients use in making <constant>XSelectExtensionEvent</constant> requests. Currently defined macros include <constant>DeviceKeyPress</constant>, <constant>DeviceKeyRelease</constant>, <constant>DeviceButtonPress</constant>, <constant>DeviceButtonRelese</constant>, <constant>DeviceMotionNotify</constant>, <constant>DeviceFocusIn</constant>, <constant>DeviceFocusOut</constant>, <constant>ProximityIn</constant>, <constant>ProximityOut</constant>, <constant>DeviceStateNotify</constant>, <constant>DeviceMappingNotify</constant>, <constant>ChangeDeviceNotify</constant>, <constant>DevicePointerMotionHint</constant>, <constant>DeviceButton1Motion</constant>, <constant>DeviceButton2Motion</constant>, <constant>DeviceButton3Motion</constant>, <constant>DeviceButton4Motion</constant>, <constant>DeviceButton5Motion</constant>, <constant>DeviceButtonMotion</constant>, <constant>DeviceOwnerGrabButton</constant>, <constant>DeviceButtonPressGrab</constant>, and <constant>NoExtensionEvent</constant>.</para>
        <para>
            To obtain the proper event class for a particular device, one of the above macros is invoked using the <constant>XDevice</constant> structure for that device. For example, </para>
        <para>
            <synopsis>
                DeviceKeyPress (*device, type, eventclass); 
            </synopsis>
        </para>
        <para>
            returns the <constant>DeviceKeyPress</constant> event type and the eventclass for <constant>DeviceKeyPress</constant> events from the specified device.</para>
        <para>
            This <constant>eventclass</constant> can then be used in an <constant>XSelectExtensionEvent</constant> request to ask the server to send <constant>DeviceKeyPress</constant> events from this device. When a selected event is received via <constant>XNextEvent</constant>, the <constant>type</constant> can be used for comparison with the type in the event.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist, or is the X keyboard or X pointer. This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the <constant>XChangeKeyboardDevice</constant> or <constant>XChangePointerDevice</constant> requests.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>

<refentry id="XQueryDeviceState.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XQueryDeviceState</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XQueryDeviceState</refname>
        <refpurpose>query the state of an extension input device.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XQueryDeviceState</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose state is to be queried.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XQueryDeviceState</constant> request queries the state of an input device. The current state of keys and buttons (up or down), and valuators (current value) on the device is reported by this request. Each key or button is represented by a bit in the <constant>XDeviceState</constant> structure that is returned. Valuators on the device report 0 if they are reporting relative information, and the current value if they are reporting absolute information.</para>
        <para>
            <constant>XQueryDeviceState</constant> can generate a <constant>BadDevice</constant> error.

        </para>
    </refsect1>
    <refsect1><title>Structures</title>
        <para>
            The <constant>XDeviceState</constant> structure contains: </para>
        <para>
            <synopsis>
                typedef struct { 
                XID <structfield>device_id</structfield>; 
                int <structfield>num_classes</structfield>; 
                XInputClass *<structfield>data</structfield>; 
                } <structname>XDeviceState</structname>;
            </synopsis>
        </para>
        <para>
            The <constant>XValuatorState</constant> structure contains: </para>
        <para>
            <synopsis>
                typedef struct { 
                unsigned char <structfield>class</structfield>;
                unsigned char <structfield>length</structfield>;
                unsigned char <structfield>num_valuators</structfield>;
                unsigned char <structfield>mode</structfield>;
                int *<structfield>valuators</structfield>;
                } <structname>XValuatorState</structname>;
            </synopsis>
        </para>
        <para>
            The <constant>XKeyState</constant> structure contains: </para>
        <para>
            <synopsis>
                typedef struct { 
                unsigned char <structfield>class</structfield>;
                unsigned char <structfield>length</structfield>;
                short     <structfield>num_keys</structfield>;
                char <structfield>keys</structfield>[32];
                } <structname>XKeyState</structname>;
            </synopsis>
        </para>
        <para>
            The <constant>XButtonState</constant> structure contains: </para>
        <para>
            <synopsis>
                typedef struct { 
                unsigned char <structfield>class</structfield>;
                unsigned char <structfield>length</structfield>;
                short     <structfield>num_buttons</structfield>;
                char <structfield>buttons</structfield>[32];
                } <structname>XButtonState</structname>;
            </synopsis>
        </para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the <constant>XChangeKeyboardDevice</constant> or <constant>XChangePointerDevice</constant> requests.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>


<refentry id="XSelectExtensionEvent.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XSelectExtensionEvent</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XSelectExtensionEvent</refname>
	<refname>XGetSelectedExtensionEvents</refname>
        <refpurpose>select extension events, get the list of currently selected extension events</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef><function>XSelectExtensionEvent</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>w</parameter></paramdef>
                <paramdef>XEventClass *<parameter>event_list</parameter></paramdef>
                <paramdef>int <parameter>event_count</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef><function>XGetSelectedExtensionEvents</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>w</parameter></paramdef>
                <paramdef>int <parameter>this_client_event_count_return</parameter></paramdef>
                <paramdef>XEventClass *<parameter>this_client_event_list_return</parameter></paramdef>
                <paramdef>int <parameter>all_clients_event_count_return</parameter></paramdef>
                <paramdef>XEventClass *<parameter>all_clients_event_list_return</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>w</parameter></term>
                    <listitem><para>Specifies the window whose events you
                            are interested in.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_list</parameter></term>
                    <listitem><para>Specifies the list of event classes
                            that describe the events you are interested
                            in.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>event_count</parameter></term>
                    <listitem><para>Specifies the count of event classes
                            in the event list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>this_client_event_count_return</parameter></term>
                    <listitem><para>Returns the count of event classes
                            selected by this client.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>this_client_event_list_return</parameter></term>
                    <listitem><para>Returns a pointer to the list of event classes
                            selected by this client.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>all_clients_event_count_return</parameter></term>
                    <listitem><para>Returns the count of event classes
                            selected by all clients.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>all_clients_event_list_return</parameter></term>
                    <listitem><para>Returns a pointer to the list of event classes
                            selected by all clients.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>Description</title>
        <para>
            The <constant>XSelectExtensionEvent</constant> request causes
            the X server to report the events associated with the
            specified list of event classes.  Initially, X will not report
            any of these events.  Events are reported relative to a
            window.  If a window is not interested in a device event, it
            usually propagates to the closest ancestor that is interested,
            unless the do_not_propagate mask prohibits it.  </para><para>

            Multiple clients can select for the same events on the same window
            with the following restrictions:
            <itemizedlist>
                <listitem>
                    <para>
                        Multiple clients can select events on the same
                        window because their event masks are disjoint.
                        When the X server generates an event, it reports
                        it to all interested clients.
                    </para>
                </listitem>
                <listitem>
                    <para>
                        Only one client at a time can select a
                        <constant>DeviceButtonPress</constant> event with
                        automatic passive grabbing enabled, which is
                        associated with the event class
                        <constant>DeviceButtonPressGrab</constant>.  To
                        receive <constant>DeviceButtonPress</constant>
                        events without automatic passive grabbing, use
                        event class <constant>DeviceButtonPress</constant>
                        but do not specify event class
                        <constant>DeviceButtonPressGrab</constant>.
                    </para>
                </listitem>
            </itemizedlist>
            The server reports the event to all interested clients.
            </para><para>

            Information contained in the <constant>XDevice</constant> structure returned by
            <constant>XOpenDevice</constant> is used
            by macros to obtain the event classes that clients use in making
            <constant>XSelectExtensionEvent</constant> requests.  Currently defined macros include
            <constant>DeviceKeyPress</constant>, <constant>DeviceKeyRelease</constant>, <constant>DeviceButtonPress</constant>, 
            <constant>DeviceButtonRelese</constant>, <constant>DeviceMotionNotify</constant>, <constant>DeviceFocusIn</constant>, 
            <constant>DeviceFocusOut</constant>, <constant>ProximityIn</constant>, <constant>ProximityOut</constant>, 
            <constant>DeviceStateNotify</constant>, <constant>DeviceMappiingNotify</constant>, 
            <constant>ChangeDeviceNotify</constant>, <constant>DevicePointerMotionHint</constant>, 
            <constant>DeviceButton1Motion</constant>, <constant>DeviceButton2Motion</constant>, <constant>DeviceButton3Motion</constant>,
            <constant>DeviceButton4Motion</constant>, <constant>DeviceButton5Motion</constant>, <constant>DeviceButtonMotion</constant>,
            <constant>DeviceOwnerGrabButton</constant>, <constant>DeviceButtonPressGrab</constant>, and
            <constant>NoExtensionEvent</constant>.
            </para><para>

            To obtain the proper event class for a particular device, one of the above
            macros is invoked using the <constant>XDevice</constant> structure for that device.  For
            example, 
            </para><para>
            <synopsis>
                DeviceKeyPress (*device, type, eventclass);
            </synopsis>
            </para><para>

            returns the <constant>DeviceKeyPress</constant> event type and the eventclass for selecting
            <constant>DeviceKeyPress</constant> events from this device.
            </para><para>

            <constant>XSelectExtensionEvent</constant>
            can generate a <constant>BadWindow</constant> or <constant>BadClass</constant> error.
            The <constant>XGetSelectedExtensionEvents</constant>
            request reports the extension events selected by this client and all clients
            for the specified window.  This request returns pointers to two 
            <constant>XEventClass</constant>
            arrays.  One lists the input extension events selected by this client from
            the specified window.  The other lists the event classes selected by all
            clients from the specified window.  You should use <constant>XFree</constant> to free these
            two arrays.
            </para><para>

            <constant>XGetSelectedExtensionEvents</constant>
            can generate a <constant>BadWindow</constant> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadClass</errorname></term><listitem>
                        <para>
                            A value for an <constant>XEventClass</constant> is
                            invalid.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

</refentry>


<refentry id="XSendExtensionEvent.man"> 
        <refentryinfo>
            <productname>__vendorversion__</productname>
        </refentryinfo>

        <refmeta>
            <refentrytitle>XSendExtensionEvent</refentrytitle>
            <manvolnum>__libmansuffix__</manvolnum>
        <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
        <refnamediv>
             <refname>XSendExtensionEvent</refname>
             <refpurpose>send input extension events to a client</refpurpose>
        </refnamediv>
        <refsynopsisdiv>
            <title>Syntax</title>
            <funcsynopsis>
                <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
                <funcprototype>
                    <funcdef>Status <function>XSendExtensionEvent</function></funcdef>
                    <paramdef>Display *<parameter>display</parameter></paramdef>
                    <paramdef>XDevice *<parameter>device</parameter></paramdef>
                    <paramdef>Window <parameter>destination</parameter></paramdef>
                    <paramdef>Bool <parameter>propagate</parameter></paramdef>
                    <paramdef>int <parameter>event_count</parameter></paramdef>
                    <paramdef>XEventClass *<parameter>event_list</parameter></paramdef>
                    <paramdef>XEvent *<parameter>event_send</parameter></paramdef>
                </funcprototype>
            </funcsynopsis>
        </refsynopsisdiv>
        <refsect1><title>Arguments</title>

            <para>
                <variablelist>
                    <varlistentry><term><parameter>display</parameter></term>
                        <listitem><para>Specifies the connection to the X server.</para></listitem>
                    </varlistentry>
                    <varlistentry><term><parameter>device</parameter></term>
                        <listitem><para>Specifies the device from which the events are to be sent.</para></listitem>
                    </varlistentry>
                    <varlistentry><term><parameter>destination</parameter></term>
                        <listitem><para>Specifies the window the event is to be sent to.  You can pass window id, <constant>PointerWindow</constant>,or <constant>InputFocus</constant>.</para></listitem>
                    </varlistentry>
                    <varlistentry><term><parameter>propagate</parameter></term>
                        <listitem><para>Specifies a Boolean value that is either True or False.</para></listitem>
                    </varlistentry>
                    <varlistentry><term><parameter>event_count</parameter></term>
                        <listitem><para>Specifies the count of XEventClasses in event_list.</para></listitem>
                    </varlistentry>
                    <varlistentry><term><parameter>event_list</parameter></term>
                        <listitem><para>Specifies the list of event selections to be used.</para></listitem>
                    </varlistentry>
                    <varlistentry><term><parameter>event_send</parameter></term>
                        <listitem><para>Specifies a pointer to the event that is to be sent.</para></listitem>
                    </varlistentry>
                </variablelist>
            </para>
        </refsect1>
        <refsect1><title>Description</title>
            <para>
                The <constant>XSendExtensionEvent</constant> request identifies the destination
            window, determines which clients should receive the specified
            events, and ignores any active grabs.  This request requires you
            to pass an event class list.  For a discussion of the valid event
            class names, see <constant>XOpenDevice(3)</constant>
            This request uses the w argument to identify the destination window as follows:
            <itemizedlist>
                <listitem>
                    <para>
                        If w is <constant>PointerWindow</constant>,the destination window is the window that contains the pointer.
                    </para>
                </listitem>
                <listitem>
                    <para>If w is <constant>InputFocus</constant>and if the focus window contains the pointer,the destination window is the window that contains the pointer; otherwise, the destination window is the focus window.
                    </para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            To determine which clients should receive the specified events, <constant>XSendExtensionEvent</constant>uses the propagate argument as follows:
            <itemizedlist>
                <listitem>
                    <para> If event_list is the empty set,the event is sent to the client that created the destination window. If that client no longer exists,no event is sent.
                    </para>
                </listitem>
                <listitem>
                    <para>If propagate is <constant>False</constant>,the event is sent to every client selecting on destination any of the eventtypes specified by the event_list array.
                    </para>
                </listitem>
                <listitem>
                    <para>If propagate is <constant>True</constant>and no clients have selected on destination any ofthe events specified by the event_list array,the destination is replaced with theclosest ancestor of destination for which some client has selected atype specified by the event-list array and for which no interveningwindow has that type in itsdo-not-propagate-mask. If no such window exists or if the window isan ancestor of the focus window and <constant>InputFocus</constant>was originally specifiedas the destination, the event is not sent to any clients. Otherwise, the event is reported to every client selecting on the finaldestination any of the events specified in the event_list array.
                    </para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            The event in the <constant>XEvent</constant>structure must be one of the events defined by the input extension (or a <constant>BadValue</constant>error results) so that the X server can correctly byte-swapthe contents as necessary. The contents of the event areotherwise unaltered and unchecked by the X server except to force send_event to <constant>True</constant>in the forwarded event and to set the serial number in the event correctly.
        </para>
        <para>
            <constant>XSendExtensionEvent</constant>returns zero if the conversion to wire protocol format failedand returns nonzero otherwise.<constant>XSendExtensionEvent</constant>can generate <constant>BadClass</constant>, <constant>BadDevice</constant>, <constant>BadValue</constant>, and <constant>BadWindow</constant> errors.
        </para>
    </refsect1>
    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The
                            specified device does not exist or has not been
                            opened by this client via
                            <constant>XOpenInputDevice</constant>. This error
                            may also occur if the specified device is the X
                            keyboard or X pointer device.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem>
                        <para>
                            Some numeric value falls outside the range of
                            values accepted by the request.  Unless a specific
                            range is specified for an argument, the full range
                            defined by the argument's type is accepted.  Any
                            argument defined as a set of alternatives can
                            generate this error.
                        </para>
                        </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>

<refentry id="XSetDeviceButtonMapping.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XSetDeviceButtonMapping</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XSetDeviceButtonMapping</refname>
	<refname>XGetDeviceButtonMapping</refname>
        <refpurpose>query or change device button mappings</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XSetDeviceButtonMapping</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>unsigned char <parameter>map</parameter>[]</paramdef>
                <paramdef>int <parameter>nmap</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XGetDeviceButtonMapping</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>unsigned char <parameter>map_return</parameter>[]</paramdef>
                <paramdef>int <parameter>nmap</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose button mapping is to be queried or changed.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>map</parameter></term>
                    <listitem><para>Specifies the mapping list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>map_return</parameter></term>
                    <listitem><para>Returns the mapping list.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>nmap</parameter></term>
                    <listitem><para>Specifies the number of items in the mapping list.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The <constant>XSetDeviceButtonMapping</constant> request sets the mapping of the specified device. If it succeeds, the X server generates a <constant>DeviceMappingNotify</constant> event, and <constant>XSetDeviceButtonMapping</constant> returns <constant>MappingSuccess</constant>. Element map[i] defines the logical button number for the physical button i+1. The length of the list must be the same as <constant>XGetDeviceButtonMapping</constant> would return, or a <constant>BadValue</constant> error results. A zero element disables a button, and elements are not restricted in value by the number of physical buttons. However, no two elements can have the same nonzero value, or a <constant>BadValue</constant> error results. If any of the buttons to be altered are logically in the down state, <constant>XSetDeviceButtonMapping</constant> returns <constant>MappingBusy</constant>, and the mapping is not changed.</para>
        <para>
            <constant>XSetDeviceButtonMapping</constant> can generate <constant>BadDevice</constant>, <constant>BadMatch</constant>, and  <constant>BadValue</constant> errors.</para>
        <para>
            The <constant>XGetDeviceButtonMapping</constant> request returns the current mapping of the specified device. Buttons are numbered starting from one.<constant>XGetDeviceButtonMapping</constant> returns the number of physical buttons actually on the device. The nominal mapping for a device is map[i]=i+1. The nmap argument specifies the length of the array where the device mapping is returned, and only the first nmap elements are returned in map_return.</para>
        <para>
            <constant>XGetDeviceButtonMapping</constant> can generate <constant>BadDevice</constant> or <constant>BadMatch</constant> errors.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The specified device does not exist or has not been opened by this client via <constant>XOpenInputDevice</constant>. This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an <constant>XGetDeviceButtonMapping</constant> or <constant>XSetDeviceButtonMapping</constant> request was made specifying a device that has no buttons.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>XChangeDeviceKeyboardControl(3), XChangeDeviceKeyMapping(3), XChangeDeviceModifierMapping(3)</para>
    </refsect1>
</refentry>


<refentry id="XSetDeviceFocus.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XSetDeviceFocus</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XSetDeviceFocus</refname>
	<refname>XGetDeviceFocus</refname>
        <refpurpose>control extension input device focus</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef><function>XSetDeviceFocus</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>focus</parameter></paramdef>
                <paramdef>int  <parameter>revert_to</parameter></paramdef>
                <paramdef>Time <parameter>time</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef><function>XGetDeviceFocus</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window *<parameter>focus_return</parameter></paramdef>
                <paramdef>int *<parameter>revert_to_return</parameter></paramdef>
                <paramdef>int * <parameter>time_return</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose focus is to be queried or changed.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>focus</parameter></term>
                    <listitem><para>Specifies the window, <constant>PointerRoot</constant>, <constant>FollowKeyboard</constant>,or <constant>None</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>focus_return</parameter></term>
                    <listitem><para>Returns the focus window, <constant>PointerRoot</constant>, <constant>FollowKeyboard</constant>,or <constant>None</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>revert_to</parameter></term>
                    <listitem><para>Specifies where the input focus reverts to if the window becomes notviewable.You can pass <constant>RevertToParent</constant>, <constant>RevertToPointerRoot</constant>, <constant>RevertToFollowKeyboard</constant>,or <constant>RevertToNone</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>revert_to_return</parameter></term>
                    <listitem><para>Returns the current focus state <constant>RevertToParent</constant>, <constant>RevertToPointerRoot</constant>, <constant>RevertToFollowKeyboard</constant>,or <constant>RevertToNone</constant>.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>time_return</parameter></term>
                    <listitem><para>Returns the last_focus_time for the device.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>time</parameter></term>
                    <listitem><para>Specifies the time.You can pass either a timestamp or <constant>CurrentTime</constant>.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The  <constant>XSetDeviceFocus</constant>  request changes the focus of the specified device and its last-focus-change time. It has no effect if the specified time is earlier than the current last-focus-change time or is later than the current X server time. Otherwise, the last-focus-change time is set to the specified time  <constant>CurrentTime</constant>  is replaced by the current X server time).  <constant>XSetDeviceFocus</constant>  causes the X server to generate  <constant>DeviceFocusIn</constant>  and  <constant>DeviceFocusOut</constant>  events.</para>
        <para>
            Depending on the focus argument, the following occurs:

            <itemizedlist>
                <listitem><para> If focus is  <constant>None</constant> , all device events are discarded until a new focus window is set, and the revert_to argument is ignored. 
                </para></listitem>
                <listitem><para>If focus is a window, it becomes the device's focus window. If a generated device event would normally be reported to this window or one of its inferiors, the event is reported as usual. Otherwise, the event is reported relative to the focus window. 
                </para></listitem>
                <listitem><para>
                        If focus is  <constant>PointerRoot</constant>, the focus window is dynamically taken to be the root window of whatever screen the pointer is on at each event from the specified device. In this case, the revert_to argument is ignored. 
                </para></listitem>
                <listitem><para>
                        If focus is  <constant>FollowKeyboard</constant>, the focus window is dynamically taken to be the window to which the X keyboard focus is set at each input event.</para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            The specified focus window must be viewable at the time  <constant>XSetDeviceFocus</constant>  is called, or a  <constant>BadMatch</constant>  error results. If the focus window later becomes not viewable, the X server evaluates the revert_to argument to determine the new focus window as follows: 

            <itemizedlist>
                <listitem><para>If revert_to is  <constant>RevertToParent</constant>, the focus reverts to the parent (or the closest viewable ancestor), and the new revert_to value is taken to be  <constant>RevertToNone</constant>.</para></listitem>
                <listitem><para>
                        If revert_to is  <constant>RevertToPointerRoot</constant>,  <constant>RevertToFollowKeyboard</constant>, or  <constant>RevertToNone</constant>, the focus reverts to  <constant>PointerRoot</constant>,  <constant>FollowKeyboard</constant>, or  <constant>None</constant>, respectively.</para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            When the focus reverts, the X server generates
            <constant>DeviceFocusIn</constant>  and
            <constant>DeviceFocusOut</constant>  events, but the
            last-focus-change time is not affected.</para> <para> Input
            extension devices are not required to support the ability to be
            focused. Attempting to set the focus of a device that does not
            support this request will result in a
            <constant>BadMatch</constant>  error.  Whether or not given
            device can support this request can be determined by the
            information returned by  <constant>XOpenDevice</constant>. For
            those devices that support focus,
            <constant>XOpenDevice</constant>  will return an
            <constant>XInputClassInfo</constant>  structure with the
            input_class field equal to the constant
            <constant>FocusClass</constant>  (defined in the file
            <constant>XI.h</constant>). 
        </para> 
        <para>
            <constant>XSetDeviceFocus</constant>  can generate
            <constant>BadDevice</constant>, <constant>BadMatch</constant>,
            <constant>BadValue</constant>, and
            <constant>BadWindow</constant> errors. 
        </para>
        <para>
            The  <constant>XGetDeviceFocus</constant>  request returns the focus window and the current focus state.</para>
        <para>
            Not all input extension devices can be focused.  Attempting to query the focus state of a device that can't be focused results in a  <constant>BadMatch</constant>  error.  A device that can be focused returns information for input Class Focus when an  <constant>XOpenDevice</constant>  request is made.</para>
        <para>
            <constant>XGetDeviceFocus</constant>  can generate  <constant>BadDevice</constant>, and  <constant>BadMatch</constant>  errors.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified.  The specified device does not exist or has not been opened by this client via  <constant>XOpenInputDevice</constant>.  This error may also occur if the specified device is the X keyboard or X pointer device.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted.  Any argument defined as a set of alternatives can generate this error.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not name a defined Window.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an  <constant>XGetDeviceFocus</constant>  or  <constant>XSetDeviceFocus</constant>  request was made specifying a device that the server implementation does not allow to be focused.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>


<refentry id="XSetDeviceMode.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XSetDeviceMode</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XSetDeviceMode</refname>
        <refpurpose>change the mode of a device</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef><function>XSetDeviceMode</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>int  <parameter>mode</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose mode is to be changed.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>mode</parameter></term>
                    <listitem><para>Specifies the mode.You can pass <constant>Absolute</constant>,or <constant>Relative</constant>.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The  <constant>XSetDeviceMode</constant>  request changes the mode of an input device that is capable of reporting either absolute positional information or relative motion information. Not all input devices are capable of reporting motion data, and not all are capable of changing modes from  <constant>Absolute</constant>  to  <constant>Relative</constant>.</para>
        <para>
            <constant>XSetDeviceMode</constant>  can generate a  <constant>BadDevice</constant>  or  <constant>BadMode</constant>  error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified.  The specified device does not exist or has not been opened by this client via  <constant>XOpenInputDevice</constant>.  This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the  <constant>XChangeKeyboardDevice</constant>  or  <constant>XChangePointerDevice</constant>  requests.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an  <constant>XSetDeviceMode</constant>  request is made specifying a device that has no valuators and reports no axes of motion.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMode</errorname></term>
                    <listitem><para>An invalid mode was specified.  This error will also be returned if the specified device is not capable of supporting the  <constant>XSetDeviceMode</constant>  request.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>


<refentry id="XSetDeviceValuators.man"> 
    <refentryinfo>
        <productname>__vendorversion__</productname>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XSetDeviceValuators</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XSetDeviceValuators</refname>
        <refpurpose>initialize the valuators on an extension input device</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef><function>XSetDeviceValuators</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>int *<parameter>valuators</parameter></paramdef>
                <paramdef>int <parameter>first_valuator</parameter></paramdef>
                <paramdef>int <parameter>num_valuators</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1><title>Arguments</title>

        <para>
            <variablelist>
                <varlistentry><term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose valuators are to be initialized.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>valuators</parameter></term>
                    <listitem><para>Specifies a pointer to an array of integer values to be used to initialize thedevice valuators.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>first_valuator</parameter></term>
                    <listitem><para>Specifies the first valuator to be set.  Valuators are numbered beginning withzero.</para></listitem>
                </varlistentry>
                <varlistentry><term><parameter>num_valuators</parameter></term>
                    <listitem><para>Specifies the number of valuators to be set.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>The  <constant>XSetDeviceValuators</constant>  request sets the current values of the valuators of an input device. The valuators in the range first_valuator to (first_valuator + num_valuators) are set to the specified values.  Valuators are numbered beginning with 0. Not all input devices support initialization of valuator values.  If this request is made to a device that does not support valuators initialization, a  <constant>BadMatch</constant>  error will occur.</para>
        <para>
            If the request succeeds, a status of Success is returned.  If another client has the device grabbed, a status of AlreadyGrabbed is returned.</para>
        <para>
            <constant>XSetDeviceValuators</constant>  can generate a  <constant>BadLength</constant>,  <constant>BadDevice</constant> ,  <constant>BadMatch</constant>, or  <constant>BadValue</constant>  error.</para>
    </refsect1>

    <refsect1><title>Diagnostics</title><para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified.  The specified device does not exist or has not been opened by this client via  <constant>XOpenInputDevice</constant>.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadMatch</errorname></term>
                    <listitem><para>This error may occur if an  <constant>XSetDeviceValuators</constant>  request is made specifying a device that has no valuators and reports no axes of motion, or if such a request is made specifying a device that does not support valuator initialization.</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>An invalid first_valuator or num_valuators values was specified.</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

</refentry>

<!--- MPX -->
<refentry id="XSetClientPointer.man">
  <refentryinfo>
    <productname>__vendorversion__</productname>
    <pubdate>February 14, 2008</pubdate>
    <authorgroup>
      <author>
        <firstname>Peter</firstname><surname>Hutterer</surname>
        <contrib>Specification and implementation.</contrib>
      </author>
    </authorgroup>
  </refentryinfo>

  <refmeta>
    <refentrytitle>XSetClientPointer, XGetClientPointer</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XSetClientPointer</refname>
	<refname>XGetClientPointer</refname>
	<refpurpose>set or get the ClientPointer setting.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
	<title>Syntax</title>
	<funcsynopsis>
	    <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
	    <funcprototype>
		<funcdef><function>XSetClientPointer</function></funcdef>
		<paramdef>Display *<parameter>display</parameter></paramdef>
		<paramdef>Window <parameter>win</parameter></paramdef>
		<paramdef>XDevice *<parameter>device</parameter></paramdef>
	    </funcprototype>
	    <funcprototype>
		<funcdef>Bool <function>XGetClientPointer</function></funcdef>
		<paramdef>Display *<parameter>display</parameter></paramdef>
		<paramdef>Window <parameter>win</parameter></paramdef>
		<paramdef>XID *<parameter>device</parameter></paramdef>
	    </funcprototype>
	</funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
	<para>
	    <variablelist>
		<varlistentry>
		    <term><parameter>display</parameter></term>
		    <listitem><para>Specifies the connection to the X server.</para></listitem>
		</varlistentry>
		<varlistentry>
		    <term><parameter>win</parameter></term>
		    <listitem><para>Specifies a window belonging to the
			    client. May be <constant>None</constant>.</para></listitem>
		</varlistentry>
		<varlistentry>
		    <term><parameter>device</parameter></term>
		    <listitem><para>Specifies the device to set as
			    ClientPointer.</para></listitem>
		</varlistentry>
	    </variablelist>
	</para>
    </refsect1>

    <refsect1><title>Description</title>
	<para>
	    The ClientPointer is the device that is percieved to be the core
	    pointer for non-XI protocol requests and replies.  Each  time  a
	    protocol message needs device-dependent data and the  device  is
	    not explicitly  given,  the ClientPointer device is used to obtain
            the data. For example, a <function>XQueryPointer</function>
            request will return the coordinates of the ClientPointer. 
        </para>
        <para>
            <function>XSetClientPointer</function> request sets the
            ClientPointer device for the client that owns the given window. If
            <parameter>win</parameter> is <constant>None</constant>, the
            requesting client's ClientPointer is set to the
            <constant>device</constant>. Only master pointer devices can be
            set as ClientPointer.
        </para>
        <para>
            <function>XSetClientPointer</function>  and can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadWindow</errorname> error.
        </para>
        <para>
            The <function>XGetClientPointer</function> request returns the
            ClientPointer's device ID for the client that owns the given
            window. If <parameter>win</parameter> is
            <constant>None</constant>, the requesting client's ClientPointer
            is returned.  
        </para>
        <para>
            <parameter>win</parameter> may be a client ID instead
            of a window.
        </para>
        <para>
            <function>XGetClientPointer</function> can generate a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term><listitem>
                        <para>
                            An invalid device was specified. The device does
                            not exist or is not a master pointer device.
                    </para>
                </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>

<refentry id="XQueryDevicePointer.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XQueryDevicePointer</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XQueryDevicePointer</refname>
        <refpurpose> get device pointer coordinates.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Bool <function>XQueryDevicePointer</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>Window *<parameter>root_return</parameter></paramdef>
                <paramdef>Window *<parameter>child_return</parameter></paramdef>
                <paramdef>int *<parameter>root_x_return</parameter></paramdef>
                <paramdef>int *<parameter>root_y_return</parameter></paramdef>
                <paramdef>int *<parameter>win_x_return</parameter></paramdef>
                <paramdef>int *<parameter>win_y_return</parameter></paramdef>
                <paramdef>unsigned int *<parameter>mask_return</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>child_return</parameter></term>
                    <listitem>
                        <para>
                            Returns the child window that the pointer is located in, if any.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device to query.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>mask_return</parameter></term>
                    <listitem>
                        <para>
                          Returns the current state of the modifier keys and pointer buttons.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>root_return</parameter></term>
                    <listitem>
                        <para>
                          Returns the root window that the pointer is in.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>root_x_return</parameter></term>
                    <term><parameter>root_y_return</parameter></term>
                    <listitem>
                        <para>
                          Return the pointer coordinates relative to the root
                          window's origin.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>win</parameter></term>
                    <listitem>
                        <para>
                          Specifies the window.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>win_x_return</parameter></term>
                    <term><parameter>win_y_return</parameter></term>
                    <listitem><para>
                            Return the pointer coordinates relative to the
                            specified window.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
        The <function>XQueryDevicePointer</function> function returns the root
        window the device's pointer is logically on and the pointer
        coordinates relative to the root window's origin.  If
        <function>XQueryDevicePointer</function> returns
        <constant>False</constant>, the pointer is not on the same screen as
        the specified window, and
        <function>XQueryDevicePointer</function> returns
        <constant>None</constant> to <parameter>child_return</parameter> and
        zero to <parameter>win_x_return</parameter> and
        <parameter>win_y_return</parameter>.  If
        <function>XQueryDevicePointer</function> returns
        <constant>True</constant>, the pointer coordinates returned to
        <parameter>win_x_return</parameter> and
        <parameter>win_y_return</parameter> are relative to the origin of the
        specified window.  In this case,
        <function>XQueryDevicePointer</function> returns the child that
        contains the pointer, if any, or else <constant>None</constant> to
        <parameter>child_return</parameter>.
        </para>
        <para>
            <function>XQueryDevicePointer</function> returns the current
            logical state of the keyboard buttons and the modifier keys in
            <parameter>mask_return</parameter>. The keyboard paired with the
            master pointer is selected to obtain this data. It sets
            <parameter>mask_return</parameter> to the bitwise inclusive OR of
            one or more of the button or modifier key bitmasks to match the
            current state of the mouse buttons and the modifier keys.
        </para>
        <para>
            <function>XQueryDevicePointer</function> is identical to
            <function>XQueryPointer</function> but specifies the device
            explicitly.
        </para>
        <para>
            <function>XQueryDevicePointer</function> can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem>
                        <para>
                            An invalid device was specified. The device does
                            not exist or is not a pointer device.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para>
            <function>XQueryPointer</function>
        </para>
    </refsect1>

</refentry>

<refentry id="XDefineDeviceCursor.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XDefineDeviceCursor, XUndefineDeviceCursor</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XDefineDeviceCursor</refname>
	<refname>XUndefineDeviceCursor</refname>
        <refpurpose>define device cursors.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>int <function>XDefineCursor</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>Cursor <parameter>cursor</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>int <function>XUndefineCursor</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>cursor</parameter> </term><listitem>
                        <para>
                            Specifies the cursor that is to be displayed or
                            <constant>None</constant>.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device whose cursor is to
                            change.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>win</parameter></term>
                    <listitem><para>Specifies the window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            If a cursor is set, it will be used when the device's pointer is in the
            window. If the cursor is <constant>None</constant>, it is equivalent to
            <function>XUndefineDefineCursor</function>.
        </para>
        <para>
            <function>XDefineDeviceCursor</function> can generate
            <errorname>BadCursor</errorname> and
            <errorname>BadWindow</errorname>.
        </para>
        <para>
            The <function>XUndefineDeviceCursor</function> function undoes the
            effect of a previous <function>XDefineDeviceCursor</function> for
            this window. When the pointer is in the window, the window's
            default cursor will now be used. If no default cursor is defined,
            the parent's cursor for this device will be used (if defined) or
            the parent's default cursor will be used.
        </para>
        <para>
            <function>XDefineDeviceCursor</function> and
            <function>XUndefineDeviceCursor</function> are identical to
            <function>XDefineCursor</function> and
            <function>XUndefineCursor</function> but specify the device
            explicitly.
        </para>
        <para>
            <function>XUndefineDevicePointer</function> can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The
                            device does not exist or is not a pointer
                            device.</para></listitem>
    
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1> <title>See also</title>
        <para><function>XDefineCursor</function>, <function>XUndefineCursor</function></para>
    </refsect1>
</refentry>

<refentry id="XWarpDevicePointer.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XWarpDevicePointer</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XWarpDevicePointer</refname>
        <refpurpose>move device pointer.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Bool <function>XWarpDevicePointer</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>src_w</parameter></paramdef>
                <paramdef>Window <parameter>dest_w</parameter></paramdef>
                <paramdef>int <parameter>src_x</parameter></paramdef>
                <paramdef>int <parameter>src_y</parameter></paramdef>
                <paramdef>int <parameter>src_width</parameter></paramdef>
                <paramdef>int <parameter>src_height</parameter></paramdef>
                <paramdef>int <parameter>dest_x</parameter></paramdef>
                <paramdef>int <parameter>dest_y</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>dest_w</parameter></term>
                    <listitem>
                        <para>
                            Specifies the destination window or <constant>None</constant>.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>dest_x</parameter></term>
                    <term><parameter>dest_y</parameter></term>
                    <listitem>
                        <para>
                            Specify the x and y coordinates within the
                            destination window.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>device</parameter></term>
                    <listitem><para>Specifies the device to move.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>src_x</parameter></term>
                    <term><parameter>src_y</parameter></term>
                    <term><parameter>src_width</parameter></term>
                    <term><parameter>src_height</parameter></term>
                    <listitem>
                        <para>
                          Specify a rectangle in the source window.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>src_w</parameter></term>
                    <listitem>
                        <para>
                            Specifies the source window or
                            <constant>None</constant>.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
             If <parameter>dest_w</parameter> is <constant>None</constant>, <function>XWarpDevicePointer</function> moves the pointer by the offsets
             (<parameter>dest_x</parameter>, <parameter>dest_y</parameter>) relative to the current position of the pointer.  If
             <parameter>dest_w</parameter> is a window, <function>XWarpDevicePointer</function> moves the pointer to the offsets
             (<parameter>dest_x</parameter>, <parameter>dest_y</parameter>)
             relative to the origin of <parameter>dest_w</parameter>.
             However, if <parameter>src_w</parameter> is a window, the move
             only takes place if the window <parameter>src_w</parameter>
             contains the pointer and if the specified rectangle of
             <parameter>src_w</parameter> contains the pointer.
        </para>
        <para>
            The <parameter>src_x</parameter> and <parameter>src_y</parameter> coordinates are relative to the origin of <parameter>src_w</parameter>.
            If <parameter>src_height</parameter> is zero, it is replaced with the current height of <parameter>src_w</parameter>
            minus <parameter>src_y</parameter>.  If <parameter>src_w</parameter>idth is zero, it is replaced with the current
            width of <parameter>src_w</parameter> minus <parameter>src_x</parameter>.
        </para>
        <para>
            There is seldom any reason for calling this function.  The pointer
            should normally be left to the user.  If you do use this function,
            however, it generates events just as if the user had
            instantaneously moved the pointer from one position to another.
            Note that you cannot use <function>XWarpDevicePointer</function> to move the pointer outside
            the confine_to window of an active pointer grab.  An attempt to do
            so will only move the pointer as far as the closest edge of the
            confine_to window.
        </para>
        <para>
            <function>XWarpDevicePointer</function> is identical to
            <function>XWarpPointer</function> but specifies the device
            explicitly.
        </para>
        <para>
            <function>XWarpDevicePointer</function> can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The
                            device does not exist or is not a pointer
                            device.</para></listitem>
    
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para><function>XWarpPointer</function></para>
    </refsect1>
</refentry>

<refentry id="XChangeDeviceHierarchy.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XChangeDeviceHierarchy</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XChangeDeviceHierarchy</refname>
        <refpurpose>change the device hierarchy.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XChangeDeviceHierarchy</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XAnyHierarchyChangeInfo *<parameter>changes</parameter></paramdef>
                <paramdef>int <parameter>num_changes</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>num_changes</parameter></term>
                    <listitem>
                        <para>
                            Specifies the number of elements in changes.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>changes</parameter></term>
                    <listitem>
                        <para>
                            Specifies the changes to be made.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            <function>XChangeDeviceHierarchy</function> modifies the device
            hierarchy by creating or removing master devices or changing the
            attachment of slave devices. If <parameter>num_changes</parameter>
            is non-zero, <parameter>changes</parameter> is an array of
            <type>XAnyHierarchyChangeInfo</type> structures. 
        </para>
        <para>
            <function>XChangeDeviceHierarchy</function> processes
            <parameter>changes</parameter> in order, effective immediately. If
            an error occurs, processing is aborted and the error is reported
            to the client. Changes already made remain effective.
        </para>
        <para>
            The list of <parameter>changes</parameter> is any combination of
            <structname>XAnyHierarchyChangeInfo</structname>. The
            <structfield>type</structfield> of a hierarchy change can be
            <constant>CH_CreateMasterDevice</constant>,
            <constant>CH_RemoveMasterDevice</constant> or
            <constant>CH_ChangeAttachment</constant>.
        </para>
        <para>
            <synopsis>
typedef union {
    int <structfield>type</structfield>;
    <structfield>XCreateMasterInfo</structfield> create;
    <structfield>XRemoveMasterInfo</structfield> remove;
    <structfield>XChangeAttachmentInfo</structfield> change;
} <structname>XAnyHierarchyChangeInfo</structname>;
            </synopsis>
        </para>
        <para>
            <synopsis>
typedef struct {
    int <structfield>type</structfield>; /* <constant>CH_CreateMasterDevice</constant> */
    char* <structfield>name</structfield>;
    Bool <structfield>sendCore</structfield>;
    Bool <structfield>enable</structfield>;
} <structname>XCreateMasterInfo</structname>;
            </synopsis>
        </para>
        <para>
            <synopsis>
typedef struct {
    int <structfield>type</structfield>; /* <constant>CH_RemoveMasterDevice</constant> */
    XDevice* <structfield>device</structfield>;
    int <structfield>returnMode</structfield>;
    XDevice* <structfield>returnPointer</structfield>;
    XDevice* <structfield>returnKeyboard</structfield>;
} <structname>XRemoveMasterInfo</structname>;
            </synopsis>
        </para>
        <para>
            <synopsis>
typedef struct {
    int <structfield>type</structfield>; /* <constant>CH_ChangeAttachment</constant> */
    XDevice* <structfield>device</structfield>;
    int <structfield>changeMode</structfield>;
    XDevice* <structfield>newMaster</structfield>;
} <structname>XChangeAttachmentInfo</structname>;
            </synopsis>
        </para>
        <para>
            <structname>XCreateMasterInfo</structname> creates a new master
            pointer and a new master keyboard labelled
            &quot;<structfield>name</structfield> pointer&quot; and
            &quot;<structfield>name</structfield> keyboard&quot; respectively. If
            <structfield>sendCore</structfield> is <constant>True</constant>, the
            devices will send core events. If <structfield>enable</structfield> is
            <constant>True</constant>, the device is enabled immediately. 
        </para>
        <para>
            <structname>XCreateMasterInfo</structname> can generate a
            <errorname>BadValue</errorname> error.
        </para>
        <para>
            <structname>XRemoveMasterInfo</structname> removes
            <structfield>device</structfield> and its paired master device. If
            <structfield>returnMode</structfield> is
            <constant>AttachToMaster</constant>, all pointers attached to
            <structfield>device</structfield> or its paired master device are
            attached to <structfield>returnPointer</structfield>. Likewise, all
            keyboards are attached to
            <structfield>returnKeyboard</structfield>.
            If <structfield>returnMode</structfield> is
            <constant>Floating</constant>, all attached devices are set to
            floating.
        </para>
        <para>
            <structname>XRemoveMasterInfo</structname> can generate a
            <errorname>BadValue</errorname> and a
            <errorname>BadDevice</errorname> error.  
        </para>
        <para>
            <structname>XChangeAttachmentInfo</structname> changes the
            attachment of <structfield>device</structfield> to
            <structfield>newMaster</structfield> if
            <structfield>changeMode</structfield> is
            <constant>AttachToMaster</constant>. Otherwise, if
            <structfield>changeMode</structfield> is
            <constant>Floating</constant>, <structfield>device</structfield>
            is set floating.
        </para>
        <para>
            <function>XChangeAttachmentInfo</function> can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadValue</errorname> error.
        </para>
    </refsect1>


    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem>
                        <para>
                            An invalid device was specified. The device does
                            not exist or is not a appropriate for the type of
                            change.
                        </para>
                    </listitem>
    
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem>
                        <para>
                            Some numeric value falls out of the allowed range.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
</refentry>

<refentry id="XPermitDevices.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XPermitDevices, XDenyDevices, XChangeAccessRule</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XPermitDevices</refname>
	<refname>XDenyDevices</refname>
	<refname>XChangeAccessRule</refname>
        <refpurpose>change access rules to the window.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XPermitDevices</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>XID* <parameter>deviceids</parameter></paramdef>
                <paramdef>int <parameter>num_devices</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>Status <function>XDenyDevices</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>XID* <parameter>deviceids</parameter></paramdef>
                <paramdef>int <parameter>num_devices</parameter></paramdef>
            </funcprototype>
            <funcprototype>
                <funcdef>Status <function>XChangeAccessRule</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>int <parameter>rule</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>deviceids</parameter></term>
                    <listitem><para>Specifies a list of device IDs to deny/restrict
                            access.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>num_devices</parameter></term>
                    <listitem><para>Specifies the number of elements in
                            <parameter>deviceids</parameter>.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>rule</parameter></term>
                    <listitem>
                        <para>Specifies the default access rule for <parameter>win</parameter>.</para>
                    </listitem>
                </varlistentry>

                <varlistentry>
                    <term><parameter>win</parameter></term>
                    <listitem>
                        <para>
                            Specifies the window.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            Each window features an Access Control List (ACL) to permit or deny
            devices from sending events from this window. This is intended to
            be used to restrict devices from accessing certain UI elements
            in a multi-user environment. It is not to be used as a security
            feature.  
        </para>
        <para>
            Access rules work hierarchically and if any parent window has an
            access rule defined, it applies to all child windows unless
            overridden in the child window. 
        </para>
        <para>
            Each window's default rule determines the default access mode. If
            the default rule is <constant>WindowAccessDenyAll</constant>, no
            device can send events to this window. If the default rule is
            <constant>WindowAccessNoRule</constant>, any device can access the
            window, unless a parent has
            <constant>WindowAccessDenyAll</constant> set. If the default rule
            is <constant>WindowAccessAllowAll</constant>, any device can
            access the window.
        </para>
        <para>
            If a device is specified in the window's deny list, it is denied
            access to this window, regardless of the access rule. 
            If a device is specified in the window's perm list, this
            device is allowed to access this window regardless of the parent
            window's settings, the deny list, and the default rule. 
        </para>
        <para>
            <function>XPermitDevices</function> and
            <function>XDenyDevices</function> set the window's perm list
            or deny list to the devices specified in
            <parameter>deviceids</parameter>. Any previous setting is
            overwritten.
        </para>
        <para>
            <function>XPermitDevices</function> and
            <function>XDenyDevices</function> can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadWindow</errorname> error.
        </para>
        <para>
            <function>XChangeAccessRule</function> sets the default acess rule
            for <parameter>window</parameter>. If <parameter>rule</parameter>
            is <constant>WindowAccessDenyAll</constant>, all devices are
            denied access to this window. If <parameter>rule</parameter> is
            <constant>WindowAccessAllowAll</constant>, all devices are
            permitted access to this window. Otherwise, if
            <constant>WindowAccessNoRule</constant> is given, the default rule
            is reset and all devices are able to send events to the window
            unless a parent window restricts access.
        </para>
        <para>
            <function>XChangeAccessRule</function> can generate a
            <errorname>BadDevice</errorname> and a
            <errorname>BadValue</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The
                            device does not exist.</para></listitem>
    
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>Some numeric value falls out of the
                            allowed range.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para>
            <function>XWindowClearAccess</function>,
            <function>XQueryWindowAccess</function>
        </para>
    </refsect1>
</refentry>

<refentry id="XWindowClearAccess.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XWindowClearAccess</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XWindowClearAccess</refname>
        <refpurpose>remove access rules for the window.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XWindowClearAccess</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>int <parameter>what</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>what</parameter></term>
                    <listitem><para>Specifies the access restrictions to
                            remove.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>win</parameter></term>
                    <listitem>
                        <para>
                            Specifies the window.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            <function>XWindowClearAccess</function> removes an access control
            restriction from <parameter>window</parameter>. The bitmask
            <parameter>what</parameter> defines which restrictions to remove. 
        </para>
        <para>
            If <constant>WindowAccessClearPerm</constant> is set, the
            perm list of <parameter>win</parameter> is removed. If
            <constant>WindowAccessClearDeny</constant> is set, the deny list
            of <parameter>win</parameter> is removed. If
            <constant>WindowAccessClearRule</constant> is set, the default
            rule of the window is set to
            <constant>WindowAccessNoRule</constant>. If
            <parameter>what</parameter> is equal to
            <constant>WindowAccessClearAll</constant>, the window is reset to
            the neutral state (neither explicitly permitting nor denying
            access).
        </para>
        <para>
            <function>XWindowClearAccess</function> can generate a
            <errorname>BadValue</errorname> and a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>A value is outside of the permitted range.</para></listitem>
    
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para>
            <function>XPermitDevices</function>,
            <function>XDenyDevices</function>,
            <function>XChangeAccessRule</function>,
            <function>XQueryWindowAccess</function>
        </para>
    </refsect1>
</refentry>

<refentry id="XQueryWindowAccess.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XQueryWindowAccess</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XQueryWindowAccess</refname>
        <refpurpose>query access rules of the window.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XQueryWindowAccess</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>int *<parameter>rule_return</parameter></paramdef>
                <paramdef>XID **<parameter>permdevices_return</parameter></paramdef>
                <paramdef>int *<parameter>nperm_return</parameter></paramdef>
                <paramdef>XID **<parameter>denydevices_return</parameter></paramdef>
                <paramdef>int *<parameter>ndeny_return</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>rule_return</parameter></term>
                    <listitem><para>The default rule of the window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>permdevices_return</parameter></term>
                    <listitem><para>List of devices explicitly allowed to access the
                            window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>denydevices_return</parameter></term>
                    <listitem><para>List of devices explicitly denied access the
                            window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>nperm_return</parameter></term>
                    <listitem><para>Number of elements in
                            <parameter>permdevices_return</parameter>.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>ndeny_return</parameter></term>
                    <listitem><para>Number of elements in
                            <parameter>denydevices_return</parameter>.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>win</parameter></term>
                    <listitem>
                        <para>
                            Specifies the window.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            <function>XQueryWindowAccess</function> queries
            <parameter>win</parameter> for its current access control
            restriction settings.
        </para>
        <para>
            The value of <parameter>rule_return</parameter> can be either
            <constant>WindowAccessNoRule</constant> or
            <constant>WindowAccessDenyAll</constant>.
        </para>
        <para>
            If <parameter>nperm_return</parameter> is non-zero,
            <parameter>permdevices_return</parameter> points to a list of
            device IDs that are permitted access to the window.
        </para>
        <para>
            If <parameter>ndeny_return</parameter> is non-zero,
            <parameter>denydevices_return</parameter> points to a list of
            device IDs that are denied access to the window.
        </para>
        <para>
            It is the caller's responsibility to free the memory returned in
            <parameter>permdevices_return</parameter> and
            <parameter>denydevices_return</parameter>.
        </para>
        <para>
            <function>XQueryWindowAccess</function> can generate a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para>
            <function>XPermitDevices</function>,
            <function>XDenyDevices</function>,
            <function>XChangeAccessRule</function>,
            <function>XWindowClearAcess</function>
        </para>
    </refsect1>
</refentry>

<refentry id="XiSelectEvent.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XiSelectEvent</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XiSelectEvent</refname>
        <refpurpose>select for generic events on the window.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XiSelectEvent</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>Window <parameter>win</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Mask <parameter>mask</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>device</parameter></term>
                    <listitem><para>The device to select
                            <parameter>mask</parameter> for. May be
                            <constant>NULL</constant>.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>mask</parameter></term>
                    <listitem><para>Generic event mask.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>win</parameter></term>
                    <listitem>
                        <para>
                            Specifies the window.
                        </para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            Events available through the X Generic Event extension (XGE)
            cannot be selected with <function>XSelectExtensionEvent</function>. 
            For these events, <function>XiSelectEvent</function> must be used.
        </para>
        <para>
            <function>XiSelectEvent</function> causes the X server to report
            the events defined by <parameter>mask</parameter> on
            <parameter>win</parameter>. The <parameter>mask</parameter>
            overrides the previously selected event mask. A
            <parameter>mask</parameter> of zero de-registers
            <parameter>win</parameter> from any generic
            events.  
        </para>
        <para>
            If <parameter>device</parameter> is a valid device, the event mask
            is selected only for this device. If
            <parameter>device</parameter> is <constant>NULL</constant>, the
            event mask is selected for all devices.
        </para>
        <para>
            A <parameter>mask</parameter> set for a device is stored
            seperately for the mask for all devices. Thus, if a mask is set
            for all devices, it cannot be unset for a single device. It has to
            be unset for all devices first by supplying
            <constant>NULL</constant> and then re-set one-by-one for all 
            devices.
        </para>
        <para>
            <function>XiSelectEvent</function> can generate a
            <errorname>BadValue</errorname>, a
            <errorname>BadDevice</errorname>, and a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>A value is outside of the permitted range.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The
                            device does not exist.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1><title>See also</title>
        <para>
            <function>XSelectExtensionEvent</function>
        </para>
    </refsect1>
</refentry>

<refentry id="XExtendedGrabDevice.man">
    <refentryinfo>
        <productname>__vendorversion__</productname>
        <pubdate>February 14, 2008</pubdate>
        <authorgroup>
            <author>
                <firstname>Peter</firstname><surname>Hutterer</surname>
                <contrib>Specification and implementation.</contrib>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>XExtendedGrabDevice</refentrytitle>
        <manvolnum>__libmansuffix__</manvolnum>
    <refmiscinfo class='source'>__xorgversion__</refmiscinfo>
        <refmiscinfo class='manual'>XINPUT FUNCTIONS</refmiscinfo>
</refmeta>
    <refnamediv>
        <refname>XExtendedGrabDevice</refname>
        <refpurpose>actively grab the device.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <funcsynopsis>
            <funcsynopsisinfo>#include &lt;X11/extensions/XInput.h&gt;</funcsynopsisinfo>
            <funcprototype>
                <funcdef>Status <function>XExtendedGrabDevice</function></funcdef>
                <paramdef>Display *<parameter>display</parameter></paramdef>
                <paramdef>XDevice *<parameter>device</parameter></paramdef>
                <paramdef>Window <parameter>grab_window</parameter></paramdef>
                <paramdef>int <parameter>device_mode</parameter></paramdef>
                <paramdef>Bool <parameter>owner_events</parameter></paramdef>
                <paramdef>Window <parameter>confine_to</parameter></paramdef>
                <paramdef>Cursor <parameter>cursor</parameter></paramdef>
                <paramdef>int <parameter>event_count</parameter></paramdef>
                <paramdef>XEventClass *<parameter>event_list</parameter></paramdef>
                <paramdef>int <parameter>generic_event_count</parameter></paramdef>
                <paramdef>XGenericEventMask *<parameter>generic_events</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsect1><title>Arguments</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><parameter>confine_to</parameter></term>
		    <listitem><para>Specifies the window to confine the pointer
		    in or <constant>None</constant>.</para></listitem>
		</varlistentry>
                <varlistentry>
                    <term><parameter>cursor</parameter></term>
		    <listitem><para>Specifies the cursor that is to be
		    displayed during the grab or <constant>None</constant>.</para></listitem>
		</varlistentry>
                <varlistentry>
                    <term><parameter>display</parameter></term>
                    <listitem><para>Specifies the connection to the X server.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>device</parameter></term>
                    <listitem><para>The device to grab.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>device_mode</parameter></term>
		    <listitem><para>Specifies further processing of device
		    events. You can pass <constant>GrabModeSync</constant> or
		    <constant>GrabModeAsync</constant>.</para></listitem> 
		</varlistentry>
                <varlistentry>
                    <term><parameter>event_count</parameter></term>
		    <listitem><para>Specifies the number of elements in the event_list array.</para></listitem>
		</varlistentry>
                <varlistentry>
                    <term><parameter>event_list</parameter></term>
		    <listitem><para>Specifies a pointer to a list of event
		    classes that indicates which events the client wishes to receive. These event
		    classes  must have been obtained specifying the device being grabbed.
		    </para></listitem>
		</varlistentry>
                <varlistentry>
                    <term><parameter>generic_event_count</parameter></term>
		    <listitem><para>Specifies the number of elements in the generic_event_list array.</para></listitem>
		</varlistentry>
                <varlistentry>
                    <term><parameter>generic_event_list</parameter></term>
		    <listitem><para>Specifies a pointer to a list of generic event masks
		    that indicates which generic events the client wishes to receive. 
		    </para></listitem>
		</varlistentry>
                <varlistentry>
                    <term><parameter>grab_window</parameter></term>
                    <listitem><para>Specifies the grab window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>time</parameter></term>
                    <listitem><para>Specifies the time. You can pass either a timestamp or <constant>CurrentTime</constant>.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>owner_events</parameter></term>
		    <listitem><para>Specifies a Boolean value that indicates
		    whether the pointer events are to be reported as usual or reported with respect
		    to the grab window if selected by the event mask.</para></listitem>
		    </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>Description</title>
        <para>
            The  <function>XExtendedGrabDevice</function> request  actively  grabs control
            of the device and generates <function>DeviceFocusIn</function> and
            <function>DeviceFocusOut</function> events if the device is a keyboard and
            <function>DeviceEnterNotify</function> and
            <function>DeviceLeaveNotify</function> if the device is a pointer.  Further
            device events are reported only to the grabbing client.
            <function>XExtendedGrabDevice</function> overrides any active device grab by
            this client.<parameter>event_list</parameter> is a pointer to a  list  of event
            classes.  This list indicates which events the client wishes to receive
            while the grab is active.  <parameter>generic_event_list</parameter> is
            a pointer to a list of generic event masks. These masks indicates which generic
            events the client wishes to receive while the grab is active.
            If <parameter>owner_events</parameter> is <constant>False</constant>, all generated device
            events are reported with respect to grab_window if selected.  If owner_events
            is <constant>True</constant> and if a generated device event would normally  be  reported
            to  this  client,  it is reported normally; otherwise, the event is
            reported with respect to the <parameter>grab_window</parameter>, and is only reported if specified in
            the <parameter>event_list</parameter> or <parameter>generic_event_list</parameter>.
        </para>
	<para>
            If the <parameter>device_mode</parameter> argument is
            <constant>GrabModeAsync</constant>, device event processing continues as
            usual.  If the device is currently frozen by this client, then  processing  of
            device  events  is  resumed.  If the <parameter>device_mode</parameter>
            argument is <constant>GrabModeSync</constant>, the state of the device (as
            seen by client applications) appears to freeze, and the X server generates no
            further device events until  the  grabbing  client  issues  a  releasing
            <function>XAllowDeviceEvents</function> call  or  until the device grab is
            released.  Actual device changes are not lost while the device is frozen; they
            are simply queued in the server for later processing.
	</para>
        <para>
            If a cursor is specified and the device is a master pointer, it is
            displayed regardless of what window the device's pointer is in.
            If <constant>None</constant> is specified, the normal cursor for that window is
            displayed when the pointer is in <parameter>grab_window</parameter> or one of its
            subwindows; otherwise, the cursor for <parameter>grab_window</parameter> is displayed.
        </para>
        <para>
            If a <parameter>confine_to</parameter> window is specified and the device is a master
            pointer, the device's pointer is restricted to stay contained in
            that window.  The <parameter>confine_to</parameter> window need have no
            relationship to the <parameter>grab_window</parameter>.  If the
            pointer is not initially in the <parameter>confine_to</parameter>
            window, it is warped automatically to the closest edge just before
            the grab activates and enter/leave events are generated as usual.
            If the <parameter>confine_to</parameter> window is subsequently
            reconfigured, the pointer is warped automatically, as
            necessary, to keep it contained in the window.
        </para>
        <para>
            The <parameter>time</parameter> argument allows you to avoid
            certain circumstances that come up if applications take a long
            time to respond or if there are long network delays.  Consider a
            situation where you have two applications, both of which normally
            grab the pointer when clicked on.  If both applications specify
            the timestamp from the event, the second application may wake up
            faster and successfully grab the pointer before the first
            application.  The first application then will get an indication
            that the other application grabbed the pointer before its request
            was processed.
        </para>
        <para>
            If  the  device  is actively grabbed by some other client,
            <function>XExtendedGrabDevice</function> fails and returns
            <constant>AlreadyGrabbed</constant>.  If
            <parameter>grab_window</parameter> is not viewable, it fails and
            returns <constant>GrabNotViewable</constant>.  If the device is
            frozen by an active grab of another client, it fails and returns
            <constant>GrabFrozen</constant>.  If the specified time is earlier
            than  the last-device-grab time or later than the current X server
            time, it fails and returns <constant>GrabInvalidTime</constant>.
            Otherwise, the last-device-grab time is set to the specified time
            (<constant>CurrentTime</constant> is replaced by the current X
            server time).
        </para>
        <para>
            <function>XExtendedGrabDevice</function> is mostly identical to
            <function>XGrabPointer</function> and
            <function>XGrabDevice</function> but enables a client to register
            for generic event masks.
        </para>
        <para>
            <function>XExtendedGrabDevice</function> can generate a
            <errorname>BadValue</errorname>, a
            <errorname>BadDevice</errorname>, and a
            <errorname>BadWindow</errorname> error.
        </para>
    </refsect1>

    <refsect1><title>Diagnosis</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term><errorname>BadValue</errorname></term>
                    <listitem><para>A value is outside of the permitted range.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadWindow</errorname></term>
                    <listitem><para>A value for a Window argument does not
                            name a defined window.</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><errorname>BadDevice</errorname></term>
                    <listitem><para>An invalid device was specified. The
                            device does not exist.</para></listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>

    <refsect1><title>See also</title>
        <para>
            <function>XGrabDevice</function>,
            <function>XUngrabDevice</function>, 
            <function>XGrabPointer</function>
        </para>
    </refsect1>
</refentry>
</reference>