This file is indexed.

/usr/share/doc/x11proto-input-dev/XI2proto.html is in x11proto-input-dev 2.3.2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.9" />
<title>The X Input Extension 2.x</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */

/* Default font. */
body {
  font-family: Georgia,serif;
}

/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
  font-family: Arial,Helvetica,sans-serif;
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}
h5 {
  font-size: 1.0em;
}

div.sectionbody {
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

.monospaced, code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
  padding: 0;
  margin: 0;
}
pre {
  white-space: pre-wrap;
}

#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}

#footer {
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid #dddddd;
  border-left: 4px solid #f0f0f0;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid #dddddd;
  border-left: 5px solid #f0f0f0;
  background: #f8f8f8;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #f0f0f0;
  color: #888;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > pre.content {
  font-family: inherit;
  font-size: inherit;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}

div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}

div.colist td {
  padding-right: 0.5em;
  padding-bottom: 0.3em;
  vertical-align: top;
}
div.colist td img {
  margin-top: 0.3em;
}

@media print {
  #footer-badges { display: none; }
}

#toc {
  margin-bottom: 2.5em;
}

#toctitle {
  color: #527bbd;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}

span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }

span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }

span.big { font-size: 2em; }
span.small { font-size: 0.6em; }

span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }

div.unbreakable { page-break-inside: avoid; }


/*
 * xhtml11 specific
 *
 * */

div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-weight: bold;
  color: #527bbd;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


/*
 * html5 specific
 *
 * */

table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;
}
p.tableblock {
  margin-top: 0;
}
table.tableblock {
  border-width: 3px;
  border-spacing: 0px;
  border-style: solid;
  border-color: #527bbd;
  border-collapse: collapse;
}
th.tableblock, td.tableblock {
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #527bbd;
}

table.tableblock.frame-topbot {
  border-left-style: hidden;
  border-right-style: hidden;
}
table.tableblock.frame-sides {
  border-top-style: hidden;
  border-bottom-style: hidden;
}
table.tableblock.frame-none {
  border-style: hidden;
}

th.tableblock.halign-left, td.tableblock.halign-left {
  text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
  text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
  text-align: right;
}

th.tableblock.valign-top, td.tableblock.valign-top {
  vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
  vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  vertical-align: bottom;
}


/*
 * manpage specific
 *
 * */

body.manpage h1 {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-top: 2px solid silver;
  border-bottom: 2px solid silver;
}
body.manpage h2 {
  border-style: none;
}
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


</style>
<script type="text/javascript">
/*<![CDATA[*/
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  if (!toc) {
    return;
  }

  // Delete existing TOC entries in case we're reloading the TOC.
  var tocEntriesToRemove = [];
  var i;
  for (i = 0; i < toc.childNodes.length; i++) {
    var entry = toc.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div'
     && entry.getAttribute("class")
     && entry.getAttribute("class").match(/^toclevel/))
      tocEntriesToRemove.push(entry);
  }
  for (i = 0; i < tocEntriesToRemove.length; i++) {
    toc.removeChild(tocEntriesToRemove[i]);
  }

  // Rebuild TOC entries.
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  // Delete existing footnote entries in case we're reloading the footnodes.
  var i;
  var noteholder = document.getElementById("footnotes");
  if (!noteholder) {
    return;
  }
  var entriesToRemove = [];
  for (i = 0; i < noteholder.childNodes.length; i++) {
    var entry = noteholder.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
      entriesToRemove.push(entry);
  }
  for (i = 0; i < entriesToRemove.length; i++) {
    noteholder.removeChild(entriesToRemove[i]);
  }

  // Rebuild footnote entries.
  var cont = document.getElementById("content");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      var note = spans[i].getAttribute("data-note");
      if (!note) {
        // Use [\s\S] in place of . so multi-line matches work.
        // Because JavaScript has no s (dotall) regex flag.
        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
        spans[i].innerHTML =
          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
        spans[i].setAttribute("data-note", note);
      }
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
},

install: function(toclevels) {
  var timerId;

  function reinstall() {
    asciidoc.footnotes();
    if (toclevels) {
      asciidoc.toc(toclevels);
    }
  }

  function reinstallAndRemoveTimer() {
    clearInterval(timerId);
    reinstall();
  }

  timerId = setInterval(reinstall, 500);
  if (document.addEventListener)
    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  else
    window.onload = reinstallAndRemoveTimer;
}

}
asciidoc.install(3);
/*]]>*/
</script>
</head>
<body class="article">
<div id="header">
<h1>The X Input Extension 2.x</h1>
<div id="toc">
  <div id="toctitle">Table of Contents</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Authors:</p></div>
<div class="ulist"><ul>
<li>
<p>
Peter Hutterer (Red Hat) &lt;<a href="mailto:peter.hutterer@redhat.com">peter.hutterer@redhat.com</a>&gt;
</p>
</li>
<li>
<p>
Daniel Stone (Collabora Ltd.) &lt;<a href="mailto:daniel@fooishbar.org">daniel@fooishbar.org</a>&gt;
</p>
</li>
<li>
<p>
Chase Douglas (Canonical, Ltd.) &lt;<a href="mailto:chase.douglas@canonical.com">chase.douglas@canonical.com</a>&gt;
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="history">1. History</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
v2.3, December 2012: Pointer barrier events added
</p>
</li>
<li>
<p>
v2.2, March 2012: Multitouch support added
</p>
</li>
<li>
<p>
v2.1, December 2011: new raw event behaviour, smooth scrolling support
  added
</p>
</li>
<li>
<p>
v2.0, October 2009: Initial release of XI2 protocol
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="intro-xi20">2. Introduction</h2>
<div class="sectionbody">
<div class="paragraph"><p>The X Input Extension version 2.0 (XI2) is the second major release of the X
Input Extension.</p></div>
<div class="paragraph"><p>XI2 provides a number of enhancements over version 1.5, including:</p></div>
<div class="ulist"><ul>
<li>
<p>
use of XGE and GenericEvents. GenericEvents are of flexible length with a
  minimum length of 32 bytes.
</p>
</li>
<li>
<p>
explicit device hierarchy of master and slave devices. See Section
<a href="#hierarchy">The Master/Slave device hierarchy</a>.
</p>
</li>
<li>
<p>
use of multiple independent master devices (Multi-Pointer X or MPX).
</p>
</li>
<li>
<p>
the ability for devices to change capabilities at runtime.
</p>
</li>
<li>
<p>
raw device events
</p>
</li>
</ul></div>
<div class="paragraph"><p>XI2&#8217;s intent is to replace both core input processing and prior versions of
the X Input Extension. Historically, the majority of applications employed the
core protocol requests and events to handle user input. The core protocol does
not provide information about which device generated the event. The X Input
Extension version up to 1.5 requires the differentiation between core and
extended devices. Extended devices may not be core devices and thus cannot be
used on applications employing the core protocol. XI2 addresses both of these
issues by enabling devices to be both extended and core devices and providing
device information in each event (with the exception of core events).</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_changes_in_version_2_1">3. Changes in version 2.1</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
RawEvents are sent regardless of the grab state.
</p>
</li>
<li>
<p>
Addition of the ScrollClass for smooth scrolling
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_changes_in_version_2_2">4. Changes in version 2.2</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Multitouch support added
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_changes_in_version_2_3">5. Changes in version 2.3</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Pointer barrier events added
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_notations_used_in_this_document">6. Notations used in this document</h2>
<div class="sectionbody">
<div class="paragraph"><p>Notation for requests:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    Name of request
        name of request field:       type of request field
        name of request field:       type of request field
        ▶
        name of reply field:         type of reply field
└───</code></pre>
</div></div>
<div class="paragraph"><p>Notation for events:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    Name of event
        name of field:               type of field
        name of field:               type of field
└───</code></pre>
</div></div>
<div class="paragraph"><p>Complex fields are specified in the following notation:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>name of field:                  COMPLEXFIELDTYPE</code></pre>
</div></div>
<div class="paragraph"><p>or, if multiple of these fields exist:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>name of field:                  LISTofCOMPLEXFIELDTYPE</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>COMPLEXFIELDTYPE:  { name of subfield:   type of subfield,
                     name of subfield:   type of subfield }</code></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_interoperability_between_version_1_x_and_2_0">7. Interoperability between version 1.x and 2.0</h2>
<div class="sectionbody">
<div class="paragraph"><p>There is little interaction between 1.x and 2.x versions of the X Input
Extension. Clients are requested to avoid mixing XI1.x and XI2 code as much as
possible. Several direct incompatibilities are observable:</p></div>
<div class="sect2">
<h3 id="interop-xi1-limitations">7.1. Limitations resulting from different variable ranges</h3>
<div class="paragraph"><p>XI2 provides a larger range for some fields than XI1. As a result, XI1 clients
may not receive data an XI2 client receives.
These fields include:</p></div>
<div class="ulist"><ul>
<li>
<p>
devices with a deviceid of greater than 127 are invisible to XI1 clients.
</p>
</li>
<li>
<p>
key events and key grabs featuring larger than 255 can only be sent to XI2
  clients.
</p>
</li>
<li>
<p>
no subpixel information is available to XI1 clients. If motion events are in
  a subpixel range only, the server may omit these events and an XI 1.x client
  will not receive events until the pixel boundary is crossed.
</p>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="interop-xi1-grabs">7.2. Blocking of grabs</h3>
<div class="paragraph"><p>XI1 grabs are different to XI2 grab and a device may not be grabbed through an
XI2 grab if an XI1 grab is currently active on this device or vice versa.
Likewise, a keycode or button already grabbed by an XI 1.x or XI2 client may
not be grabbed with the same modifier combination by an XI2 or XI 1.x client,
respectively.</p></div>
</div>
<div class="sect2">
<h3 id="interop-xi1-device-list">7.3. Invisibility of Master Devices</h3>
<div class="paragraph"><p>XI 1.x was not designed with support for multiple master devices. As a
result, only the first master pointer and master keyboard are visible to XI
1.x clients; all other master devices are invisible and cannot be accessed
from XI 1.x calls.</p></div>
</div>
<div class="sect2">
<h3 id="_smooth_scrolling">7.4. Smooth scrolling</h3>
<div class="paragraph"><p>Historically, X implemented scrolling events by using button press events:
button 4 was one “click” of the scroll wheel upwards, button 5 was downwards,
button 6 was one unit of scrolling left, and button 7 was one unit of scrolling
right.  This is insufficient for e.g. touchpads which are able to provide
scrolling events through multi-finger drag gestures, or simply dragging your
finger along a designated strip along the side of the touchpad.</p></div>
<div class="paragraph"><p>Newer X servers may provide scrolling information through valuators to
provide clients with more precision than the legacy button events. This
scrolling information is part of the valuator data in device events.
Scrolling events do not have a specific event type.</p></div>
<div class="paragraph"><p>Valuators for axes sending scrolling information must have one
ScrollClass for each scrolling axis. If scrolling valuators are present on a
device, the server must provide two-way emulation between these valuators
and the legacy button events for each delta unit of scrolling.</p></div>
<div class="paragraph"><p>One unit of scrolling in either direction is considered to be equivalent to
one button event, e.g. for a unit size of 1.0, -2.0 on an valuator type
Vertical sends two button press/release events for button 4. Likewise, a
button press event for button 7 generates an event on the Horizontal
valuator with a value of +1.0. The server may accumulate deltas of less than
one unit of scrolling.</p></div>
<div class="paragraph"><p>Any server providing this behaviour marks emulated button or valuator events
with the XIPointerEmulated flag for DeviceEvents, and the XIRawEmulated flag
for raw events, to hint at applications which event is a hardware event.</p></div>
<div class="paragraph"><p>If more than one scroll valuator of the same type is present on a device,
the valuator marked with Preferred for the same scroll direction is used to
convert legacy button events into scroll valuator events. If no valuator is
marked Preferred or more than one valuator is marked with Preferred for this
scroll direction, this should be considered a driver bug and the behaviour
is implementation-dependent.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="hierarchy">8. The Master/Slave device hierarchy</h2>
<div class="sectionbody">
<div class="paragraph"><p>XI2 introduces a device hierarchy split up into so-called Master Devices (MD)
and Slave Devices (SD).</p></div>
<div class="sect2">
<h3 id="hierarchy-master">8.1. Master devices</h3>
<div class="paragraph"><p>An MD is a virtual device created and managed by the server. MDs may send core
events and XI events. However, an MD does not represent a physical device and
relies on SDs for event generation. MDs come in two forms: as master pointers
or as master keyboards. A master pointer is represented by a visible cursor on
the screen. A master keyboard is represented by a keyboard focus.</p></div>
<div class="paragraph"><p>Each master pointer is paired with the respective master keyboard and vice
versa, and this pairing is constant for the lifetime of both input devices.
Clients can use this pairing behaviour to implement input paradigms that
require pointer and keyboard interation (e.g. SHIFT + Click).</p></div>
</div>
<div class="sect2">
<h3 id="hierarchy-slave">8.2. Slave devices</h3>
<div class="paragraph"><p>An SD is usually a physical device configured in the server. SDs are not
represented by a cursor or keyboard focus and may be attached to a master
pointer or master keyboard. SDs can only be attached to any master of the same
type (e.g. a physical pointer device can be attached to any master pointer).</p></div>
<div class="paragraph"><p>If an event is generated by an SD</p></div>
<div class="ulist"><ul>
<li>
<p>
if the SD is attached to a master pointer, it changes the position and/or
  button state of the master pointer.
</p>
</li>
<li>
<p>
if the SD has a keyboard focus other than None, the key event is sent to
  the focus window.
</p>
</li>
<li>
<p>
if the SD is attached to a master keyboard, it sends events to this
  keyboard&#8217;s focus window (if applicable) and/or changes the modifier state of
  this keyboard.
</p>
</li>
<li>
<p>
if the SD is not attached to an MD ("floating"), it does not change
  any master device. The SD has its own (invisible) sprite and its own focus.
  Both the sprite and the focus must be managed explicitly by the client
  program.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Note: the keyboard focus of an attached slave device is independent to that
of the master device. Two keyboard events are generated, once with deviceid
and sourceid set to the slave device. This keyboard event is sent to the
slave device&#8217;s focus window. The second event has a deviceid of the master
and a sourceid of the slave device. This second event is delivered to the
master keyboard&#8217;s focus window.</p></div>
</div>
<div class="sect2">
<h3 id="hierarchy-dcce">8.3. Event processing for attached slave devices</h3>
<div class="paragraph"><p>Whenever an SD changes its logical state,</p></div>
<div class="ulist"><ul>
<li>
<p>
the event is delivered as an XI event to any interested clients. If the
  device is floating, event processing stops.
  Otherwise, if the device is attached,
</p>
</li>
<li>
<p>
the master device changes its classes to reflect the SD&#8217;s capabilities. All
  interested clients are notified of this device change.
</p>
</li>
<li>
<p>
then, the event is delivered as an XI event from the MD to any interested
  clients. If the event has been delivered, event processing stops.
  Otherwise,
</p>
</li>
<li>
<p>
the event is delivered as a core event to any interested clients.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Given that W is the event window, and P the parent window of W, event delivery
to P is only attempted if neither the XI event, nor the core event has been
delivered on W. Once an event has been delivered as either XI or core event,
event processing stops.</p></div>
</div>
<div class="sect2">
<h3 id="clientpointer">8.4. The ClientPointer principle</h3>
<div class="paragraph"><p>Many core protocol and some extension requests are ambiguous when multiple
master devices are available (e.g. QueryPointer does not specify which pointer).
The X server does not have the knowledge to chose the contextually correct
master device. For each client, one master pointer is designated as this
clients&#8217;s "ClientPointer". Whenever a client sends an ambiguous request (e.g.
QueryPointer), the ClientPointer or the keyboard paired with the ClientPointer
is chosen to provide the data for this request.</p></div>
<div class="paragraph"><p>This ClientPointer may be explicitly assigned to a client with the
SetClientPointer call. If no ClientPointer is set when a client issues an
ambiguous request, the server choses one device as the ClientPointer. The
method of chosing a ClientPointer from the available master pointers is
implementation-specific.</p></div>
<div class="paragraph"><p>If the master pointer currently set as ClientPointer for one or more clients is
removed, the server may either unset the ClientPointer setting or change the
ClientPointer to a different master pointer.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="multitouch">9. Touch device support</h2>
<div class="sectionbody">
<div class="paragraph"><p>XI 2.2 introduces support for multi-touch devices. The traditional
pointer/keyboard approach enforced by XI 2.0 with the master/slave device
hierarchy is not always suitable for multi-touch devices that can provide a
dynamic number of touchpoints per physical device; it is not known without
client-specific interpretation whether the touchpoints must be considered
separately or grouped together.</p></div>
<div class="paragraph"><p>The additions in XI 2.2 aim to:</p></div>
<div class="ulist"><ul>
<li>
<p>
support a dynamic number of simultaneous touch points,
</p>
</li>
<li>
<p>
support devices that are both multi-touch and traditional pointer devices,
</p>
</li>
<li>
<p>
allow touchpoints to be either grouped together or handled separately,
</p>
</li>
<li>
<p>
be backwards-compatible to pre-XI 2.2 clients through emulation of XI 2.x/XI 1.x and core
  pointer events.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Touch events are only available to clients supporting version 2.2 or later of
the X Input Extension. Clients must use the XIQueryVersion request to announce
support for this version. Touch devices may generate emulated pointer events
alongside XI 2.2 touch events to support older clients; see Section
<a href="#multitouch-processing">Touch event delivery</a>.</p></div>
<div class="paragraph"><p>Touch event processing differs from normal event processing in a few ways.
The most notable differences are that touch events are processed partially
out-of-band from pointer and keyboard events, and that touch events may be
sent to multiple clients simultaneously. For more details see Section
<a href="#multitouch-processing">Touch event delivery</a>.</p></div>
<div class="sect2">
<h3 id="multitouch-lifecycle">9.1. Touch event sequences</h3>
<div class="paragraph"><p>Touch input follows a three-stage cycle:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>begin - update - update - ... - end</code></pre>
</div></div>
<div class="paragraph"><p>i.e. “begin” the sequence by touching the device, “update” the current
touch location or properties any number of times, and finally “end” the
sequence by ceasing to touch the device.  Within this document, the term
"touch sequence" is used to describe the above sequence of events.
In the protocol, the three stages are represented with the event
types TouchBegin, TouchUpdate, and TouchEnd, respectively. A touch sequence
always generates TouchBegin and TouchEnd events, and may also generate
TouchUpdate events.  Clients must select for all three of these events
simultaneously.</p></div>
<div class="paragraph"><p>When a touch starts, clients are sent a TouchBegin event
detailing the position of the touchpoint, as well as the
initial properties of the touchpoint.  Note that the logical state of the
device (as seen through the input protocol) may lag the physical state if event
processing is affected by grabs.  Multiple touchpoints may be active on the
same device at any time, potentially owned by and/or delivered to a different
set of clients.</p></div>
<div class="paragraph"><p>Whenever the touch position or any other property of the touchpoint changes,
a TouchUpdate event is sent to all clients listening
to events for that touchpoint with the updated information.</p></div>
<div class="paragraph"><p>When the touch has physically ended, or a client will otherwise not receive
any more events for a given touchpoint, a TouchEnd event will be sent to
that client.</p></div>
<div class="paragraph"><p>Passive touch grabs are similar to standard input event grabs in that they
take precedence over event selections and are searched from the root window
to the child window (as opposed to selections, which start their search at the
child window and continue up to the root window).  When a touch grab activates,
the client whose grab activates becomes the “owner” of this touch sequence,
and must decide what to do with it, as per Section
<a href="#multitouch-ownership">Ownership of touch sequences</a>.  See the
<a href="#requests-passivegrabdevice">XIPassiveGrabDevice</a> request
documentation for more information on passive grab activation.</p></div>
<div class="paragraph"><p>Only one client may select for touch events from a given device on a window.</p></div>
<div class="sect3">
<h4 id="multitouch-ownership">9.1.1. Ownership of touch sequences</h4>
<div class="paragraph"><p>Once a grabbing client becomes the owner of a touch, it must either “accept” or
"reject" the touch sequence using the XIAllowEvents request. If a touch sequence
is rejected, a TouchEnd event is sent to the rejecting client, and it will not
receive any more events for this touch.  The server then looks to the next
window in the stack for another passive grab, and attempts to pass ownership
on to the next candidate for a passive grab (i.e. the next window towards
the final child window with a matching grab), or to the first applicable
event selection if there are no more grabs.</p></div>
<div class="paragraph"><p>If a touch sequence is accepted by its owner, all other clients receive
TouchEnd events, and the touch sequence is exclusively delivered to the
owner from that point on.</p></div>
<div class="paragraph"><p>If the touch sequence physically ends while the owner of the touch sequence
has not yet accepted or rejected ownership, the owner receives a TouchEnd
event and all other clients receive a TouchUpdate event with the
TouchPendingEnd flag set. The owner must still accept or reject the sequence
nonetheless. If the owner rejects the touch sequence, the server will still
attempt to exhaust all other passive grabs and/or event selections looking
for a final owner.</p></div>
<div class="paragraph"><p>If the touch sequence has not physically ended yet and the owner of the
touch sequence rejects, the owner receives a TouchEnd event and ownership is
passed to the next client.</p></div>
<div class="paragraph"><p>Clients may opt for touch events to be delivered before they become the
owner of the touch sequence. In this case, the logical state of the device (as
seen by means of the protocol) always matches the physical state of the device.
Clients must use caution if they opt for this feature; any action taken must be
undone if the touch sequence ends without the client becoming the owner.</p></div>
<div class="paragraph"><p>To select for touch events regardless of ownership, a client must set the
TouchOwnership event mask in addition to the
TouchBegin, TouchUpdate and TouchEnd mask. When selected, a client will receive
touch events as they occur on the device. If and when the client
becomes the owner of a touch sequence, a TouchOwnership event is sent to the
client. If the client is the initial owner of the sequence, the TouchBegin is
immediately followed by the TouchOwnership event. Otherwise, TouchUpdate events
may preceed a TouchOwnership event. A client is not guaranteed to become the
owner of any given touch sequence.</p></div>
<div class="paragraph"><p>The server delivers touch events to all clients that have selected for
TouchOwnership and to the current owner of the sequence in parallel.</p></div>
<div class="paragraph"><p>If a client has selected for TouchOwnership and is not the current owner of
the sequence and the current owner accepts the sequence, the client receives
a TouchEnd event and no further events from this sequence are sent to this
client.</p></div>
<div class="paragraph"><p>If a client has selected for TouchOwnership and the physical touch ends
before the current owner has accepted or rejected the sequence, the client
receives a TouchUpdate event with the TouchPendingEnd flag set. No further
TouchUpdate events will be sent for this sequence. If the current owner
accepts the sequence, the client receives a TouchEnd event. Otherwise, if
the current owner rejects the sequence, the client may become
the owner of the touch sequence and receive a TouchOwnership event and a
TouchEnd event.</p></div>
</div>
</div>
<div class="sect2">
<h3 id="multitouch-device-modes">9.2. Touch device modes</h3>
<div class="paragraph"><p>Touch devices come in many different forms with varying capabilities. The
following device modes are defined for this protocol:</p></div>
<div class="paragraph"><p><em>DirectTouch</em>:
    These devices map their input region to a subset of the screen region. Touch
    events are delivered to window at the location of the touch. "direct"
    here refers to the user manipulating objects at their screen location.
    An example of a DirectTouch device is a touchscreen.</p></div>
<div class="paragraph"><p><em>DependentTouch</em>:
    These devices do not have a direct correlation between a touch location and
    a position on the screen. Touch events are delivered according to the
    location of the device&#8217;s cursor and often need to be interpreted
    relative to the current position of that cursor. Such interactions are
    usually the result of a gesture performed on the device, rather than
    direct manipulation. An example of a DependentTouch device is a
    trackpad.</p></div>
<div class="paragraph"><p>A device is identified as only one of the device modes above at any time, and
the touch mode may change at any time. If a device&#8217;s touch mode changes, an
XIDeviceChangedEvent is generated.</p></div>
</div>
<div class="sect2">
<h3 id="multitouch-processing">9.3. Touch event delivery</h3>
<div class="paragraph"><p>For direct touch devices, the window set for event propagation is the set of
windows from the root window to the topmost window lying at the co-ordinates
of the touch.</p></div>
<div class="paragraph"><p>For dependent devices, the window set for event propagation is the set of
windows from the root window to the window that contains the device&#8217;s
pointer. A dependent device may only have one window set at a time, for all
touches. Any future touch sequence will use the same window set. The window set
is cleared when all touch sequences on the device end.</p></div>
<div class="paragraph"><p>A window set is calculated on TouchBegin and remains constant until the end
of the sequence. Modifications to the window hierarchy, new grabs or changed
event selection do not affect the window set.</p></div>
<div class="sect3">
<h4 id="_pointer_control_of_dependent_devices">9.3.1. Pointer control of dependent devices</h4>
<div class="paragraph"><p>On a dependent device, the device may differ between a pointer-controlling
touch and a non-pointer-controlling touch. For example, on a touchpad the
first touch is pointer-controlling (i.e. serves only to move the visible
pointer). Multi-finger gestures on a touchpad cause all touches to be
non-pointer-controlling.</p></div>
<div class="paragraph"><p>For pointer-controlling touches, no touch events are sent; the touch
generates regular pointer events instead. Non-pointer-controlling touches
send touch events. A touch may change from pointer-controlling to
non-pointer-controlling, or vice versa.</p></div>
<div class="ulist"><ul>
<li>
<p>
If a touch changes from pointer-controlling to non-pointer-controlling,
 a new touch ID is assigned and a TouchBegin is sent for the last known
 position of the touch. Further events are sent as TouchUpdate events, or as
 TouchEnd event if the touch terminates.
</p>
</li>
<li>
<p>
If a touch changes from non-pointer-controlling to pointer-controlling, a
  TouchEnd is sent for that touch at the last known position of the touch.
  Further events are sent as pointer events.
</p>
</li>
</ul></div>
<div class="paragraph"><p>The conditions to switch from pointer-controlling to non-pointer-controlling
touch is implementation-dependent. A device may support touches that are
both pointer-controlling and a touch event.</p></div>
<div class="paragraph"><p>In the dependent touch example event sequence below, touches are marked when
switching to pointer-controlling (pc) or to non-pointer-controlling (np).</p></div>
<div class="tableblock">
<table rules="all"
width="50%"
frame="border"
cellspacing="0" cellpadding="4">
<caption class="title">Table 1. Dependent touch example event sequence on a touchpad</caption>
<col width="33%" />
<col width="33%" />
<col width="33%" />
<thead>
<tr>
<th align="left" valign="top"> Finger 1 </th>
<th align="left" valign="top"> Finger 2 </th>
<th align="left" valign="top"> Event generated(touchid)</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">down</p></td>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">(np)</p></td>
<td align="left" valign="top"><p class="table">down</p></td>
<td align="left" valign="top"><p class="table">TouchBegin(0), TouchBegin(1)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table">&#8201;&#8212;&#8201;</p></td>
<td align="left" valign="top"><p class="table">TouchUpdate(0)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">&#8201;&#8212;&#8201;</p></td>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table">TouchUpdate(1)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">up</p></td>
<td align="left" valign="top"><p class="table">(pc)</p></td>
<td align="left" valign="top"><p class="table">TouchEnd(0), TouchEnd(1)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">down</p></td>
<td align="left" valign="top"><p class="table">(np)</p></td>
<td align="left" valign="top"><p class="table">TouchBegin(2), TouchBegin(3)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table">&#8201;&#8212;&#8201;</p></td>
<td align="left" valign="top"><p class="table">TouchUpdate(2)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">up</p></td>
<td align="left" valign="top"><p class="table">(pc)</p></td>
<td align="left" valign="top"><p class="table">TouchEnd(2), TouchEnd(3)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">up</p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">down</p></td>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">(np)</p></td>
<td align="left" valign="top"><p class="table">down</p></td>
<td align="left" valign="top"><p class="table">TouchBegin(4), TouchBegin(5)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">(pc)</p></td>
<td align="left" valign="top"><p class="table">up</p></td>
<td align="left" valign="top"><p class="table">TouchEnd(4), TouchEnd(5)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">move</p></td>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">up</p></td>
<td align="left" valign="top"><p class="table"></p></td>
<td align="left" valign="top"><p class="table">Motion</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect3">
<h4 id="multitouch-emulation">9.3.2. Pointer emulation from multitouch events</h4>
<div class="paragraph"><p>Touch sequences from direct touch devices may emulate pointer events. Only one
touch sequence from a device may emulate pointer events at a time; which touch
sequence emulates pointer events is implementation-dependent.</p></div>
<div class="paragraph"><p>Pointer events are emulated as follows:</p></div>
<div class="ulist"><ul>
<li>
<p>
A TouchBegin event generates a pointer motion event to the location of the
  touch with the same axis values of the touch event, followed by a button press
  event for button 1.
</p>
</li>
<li>
<p>
A TouchUpdate event generates a pointer motion event to the location of the
  touch and/or to update axis values of the pointer device. The button state
  as seen from the protocol includes button 1 set.
</p>
</li>
<li>
<p>
A TouchEnd event generates a pointer motion event to the location of the touch
  and/or to update the axis values if either have changed, followed by a button
  release event for button 1. The button state as seen from the protocol
  includes button 1 set.
</p>
</li>
</ul></div>
<div class="paragraph"><p>If a touch sequence emulates pointer events and an emulated pointer event
triggers the activation of a passive grab, the grabbing client becomes the
owner of the touch sequence.</p></div>
<div class="paragraph"><p>The touch sequence is considered to have been accepted if</p></div>
<div class="ulist"><ul>
<li>
<p>
the grab mode is asynchronous, or
</p>
</li>
<li>
<p>
the grab mode is synchronous and the device is thawed as a result of
  AllowEvents with AsyncPointer or AsyncDevice
</p>
</li>
</ul></div>
<div class="paragraph"><p>Otherwise, if the button press is replayed by the client, the touch sequence
is considered to be rejected.</p></div>
<div class="paragraph"><p>Touch event delivery precedes pointer event delivery. A touch event emulating
pointer events is delivered:</p></div>
<div class="ulist"><ul>
<li>
<p>
as a touch event to the top-most window of the current window set if a
  client has a touch grab on this window,
</p>
</li>
<li>
<p>
otherwise, as a pointer event to the top-most window of the current window
  set if a client has a pointer grab on this window,
</p>
</li>
<li>
<p>
otherwise, to the next child window in the window set until a grab has been
  found.
</p>
</li>
</ul></div>
<div class="paragraph"><p>If no touch or pointer grab on any window is active and the last window in the
window set has been reached, the event is delivered:</p></div>
<div class="ulist"><ul>
<li>
<p>
as a touch event to the window if a client has selected for touch events
  on this window
</p>
</li>
<li>
<p>
otherwise, as a pointer event to the window if a client has selected for
  pointer events.
</p>
</li>
<li>
<p>
otherwise, to the next parent window in the window set until a selection has
  been found.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Emulated pointer events will have the PointerEmulated flag set. A touch
event that emulates pointer events has the TouchEmulatingPointer flag set.</p></div>
</div>
<div class="sect3">
<h4 id="barrier-events">9.3.3. Pointer barrier events</h4>
<div class="paragraph"><p>If a master pointer moves against a pointer barrier blocking movement in
that pointer&#8217;s direction, the movement of the pointer is clamped to the x or
y coordinate of the barrier, whichever applies. For a description of pointer
barriers and barrier creation and destruction see the XFixes protocol
specification v 5.0 or later.
<a href="http://cgit.freedesktop.org/xorg/proto/fixesproto/plain/fixesproto.txt">http://cgit.freedesktop.org/xorg/proto/fixesproto/plain/fixesproto.txt</a></p></div>
<div class="paragraph"><p>A pointer hitting a blocking barrier creates a new barrier event sequence,
identified by a unique event ID. A new event ID is assigned when the pointer
first hits a barrier. Subsequent movements against or along the pointer
barrier are assigned the same event ID. The event generated by the pointer
leaving the barrier, or being released by a client request, is the last
event with this event ID. Any future movements of this device blocked by
this barrier will be assigned a new event ID.</p></div>
<div class="paragraph"><p>Pointer barrier events are delivered exclusively to the client that created
the barrier, and to the window specified in the CreatePointerBarrier
request (the "barrier window"). A pointer barrier blocks pointer movement
regardless of whether its window is mapped and/or viewable. If the pointer
barrier window is destroyed, the pointer barrier remains blocking but a
client will not receive further events.</p></div>
<div class="paragraph"><p>If a device is actively grabbed by a client or a passive grab activated
for this client, and the pointer moves against a pointer barrier created by
this client and the grab-window is the barrier window, that client will
receive pointer barrier events if:
- owner-events is true or false and the grab&#8217;s event mask includes
  pointer barrier events, or
- owner-events is true and the client has selected for barrier events on the
  barrier window.</p></div>
<div class="paragraph"><p>If the grab-window is not the barrier window, the client will receive events
if:
- the client has selected for barrier events on the barrier window.</p></div>
<div class="paragraph"><p>If the barrier is not owned by this client, no barrier events are sent to
this client. The client owning the barrier will receive events if:
- the client has pointer barrier events selected on the window associated
  with the pointer barrier</p></div>
<div class="paragraph"><p>The BarrierDeviceIsGrabbed flag is set whenever a pointer barrier event is
generated while the device is actively grabbed by any client or a passive
grab has activated for this device prior to the event.</p></div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="glossary-notations">10. Notations used in this document</h2>
<div class="sectionbody">
<div class="paragraph"><p>Notation for requests:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    Name of request
        name of request field:       type of request field
        name of request field:       type of request field
        ▶
        name of reply field:         type of reply field
└───</code></pre>
</div></div>
<div class="paragraph"><p>Notation for events:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    Name of event
        name of field:               type of field
        name of field:               type of field
└───</code></pre>
</div></div>
<div class="paragraph"><p>Complex fields are specified in the following notation:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>name of field:                  COMPLEXFIELDTYPE</code></pre>
</div></div>
<div class="paragraph"><p>or, if multiple of these fields exist:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>name of field:                  LISTofCOMPLEXFIELDTYPE</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>COMPLEXFIELDTYPE:  { name of subfield:   type of subfield,
                     name of subfield:   type of subfield }</code></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="glossary-datatypes">11. Data types</h2>
<div class="sectionbody">
<div class="literalblock">
<div class="content">
<pre><code>BUTTONMASK
        A binary mask defined as (1 &lt;&lt; button number).
        A SETofBUTTONMASK is a binary OR of zero or more BUTTONMASK.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>DEVICE { DEVICEID, AllDevices, AllMasterDevices }
        A DEVICE specifies either a DEVICEID or AllDevices or
        AllMasterDevices.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>DEVICEID { CARD16 }
        A DEVICEID is a numerical ID for a device currently available in the
        server. The server may re-use a device ID after a device's removal.
        The device IDs 0 and 1 are reserved.
        AllDevices ........ 0
        AllMasterDevices .. 1</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>DEVICEUSE { MasterPointer, MasterKeyboard, SlavePointer,
            SlaveKeyboard, FloatingSlave }
        A DEVICEUSE field specifies the current use of a device in the MD/SD
        device hierarchy. See Section "The Master/Slave device hierarchy"
        for more information.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>EVTYPEMASK
        An EVTYPEMASK is a binary mask defined as (1 &lt;&lt; event type).
        A SETofEVTYPEMASK is a binary OR of zero or more EVTYPEMASK.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>FP1616
        Fixed point decimal in 16.16 format as one INT16 and one CARD16.
        The INT16 contains the integral part, the CARD16 the decimal fraction
        shifted by 16.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>FP3232
        Fixed point decimal in 32.32 format as one INT32 and one CARD32.
        The INT32 contains the integral part, the CARD32 the decimal fraction
        shifted by 32.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>MODIFIERMASK
        A MODIFIERMASK is a binary mask defined as (1 &lt;&lt; modifier map index).
        A SETofMODIFIERMASK is a binary OR of zero or more MODIFIERMASK or
        GrabAnyModifier.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>VALUATORMASK
        A binary mask defined as (1 &lt;&lt; valuator number).
        A SETofVALUATORMASK is a binary OR of zero or more VALUATORMASK.</code></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="errors">12. Errors</h2>
<div class="sectionbody">
<div class="paragraph"><p>Errors are sent using core X error reports.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>Device
        A value for a DEVICE argument does not specify a valid DEVICE.</code></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="requests">13. Requests</h2>
<div class="sectionbody">
<div class="paragraph"><p>The server does not guarantee that the length of a reply remains constant in
future revisions of XI2. A client must always retrieve the exact length of the
protocol reply from the connection, even if the reply is longer than defined
for the XI2 version supported by the client.
Additional bytes in a request may include data supported in later versions of
XI2. Clients should ignore this data. Padding bytes in XI2 protocol requests
are required to be 0.</p></div>
<div class="sect2">
<h3 id="requests-xi20">13.1. Requests introduced in version 2.0</h3>
<div class="sect3">
<h4 id="requests-queryversion">13.1.1. XIQueryVersion</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIQueryVersion
    major_version:          CARD16
    minor_version:          CARD16
    ▶
    major_version:          CARD16
    minor_version:          CARD16
└───</code></pre>
</div></div>
<div class="paragraph"><p>The client sends the highest supported version to the server and the
server sends the highest version it supports, but no higher than the
requested version. Major versions changes can introduce incompatibilities
in existing functionality, minor version changes introduce only backward
compatible changes.  It is the client&#8217;s responsibility to ensure that the
server supports a version which is compatible with its expectations.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>major_version
    Major XI2 version.
minor_version
    Minor XI2 version.</code></pre>
</div></div>
<div class="paragraph"><p>If major_version is less than 2, a BadValue error occurs.</p></div>
</div>
<div class="sect3">
<h4 id="requests-querydevice">13.1.2. XIQueryDevice</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIQueryDevice
    DEVICE                  deviceid
    ▶
    num_devices:            CARD16
    deviceinfo:             LISTofDEVICEINFO
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>DEVICEINFO { deviceid:              DEVICEID
             use:                   DEVICEUSE
             attachment:            DEVICEID
             enabled:               BOOL
             num_classes:           CARD16
             name_len:              CARD16
             name:                  LISTofCHAR8
             classes:               LISTofCLASS }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>CLASS { BUTTONCLASS, KEYCLASS, VALUATORCLASS, SCROLLCLASS, TOUCHCLASS }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>BUTTONCLASS   { type:                 ButtonClass
                length:               CARD16
                sourceid:             CARD16
                num_buttons:          CARD16
                state:                SETofBUTTONMASK
                labels:               LISTofATOM }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>KEYCLASS      { type:                 KeyClass
                length:               CARD16
                sourceid:             CARD16
                num_keys:             CARD16
                keys:                 LISTofCARD32 }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>VALUATORCLASS { type:                 ValuatorClass
                length:               CARD16
                sourceid:             CARD16
                number:               CARD16
                label:                ATOM
                min:                  FP3232
                max:                  FP3232
                value:                FP3232
                resolution:           CARD32
                mode:                 CARD8 }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>SCROLLCLASS¹  { type:                 ScrollClass
                length:               CARD16
                sourceid:             CARD16
                number:               CARD16
                scroll_type:          SCROLLTYPE
                flags:                SETofSCROLLFLAGS
                increment:            FP3232 }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>SCROLLTYPE { Vertical, Horizontal }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>SCROLLFLAGS { NoEmulation, Preferred }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>TOUCHCLASS² { type:                 TouchClass
              length:               CARD16
              sourceid:             CARD16
              mode:                 TOUCHMODE
              num_touches:          CARD16 }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>TOUCHMODE { DirectTouch, DependentTouch }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>¹ since XI 2.1
² since XI 2.2</code></pre>
</div></div>
<div class="paragraph"><p>XIQueryDevice details information about the requested input devices.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>devices
    The device to list. If devices is AllDevices, all enabled and
    disabled devices are listed. If devices is AllMasterDevices, all
    enabled and disabled master devices are listed. If devices is a
    valid DEVICE, only this DEVICE is listed and num_devices is 1.
num_devices
    The number of deviceinfos returned.</code></pre>
</div></div>
<div class="paragraph"><p>Each deviceinfo is detailed as follows:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The unique ID of the device. Device IDs may get re-used when a device
    is removed.
use
    If the device is a master pointer, use is MasterPointer.
    If the device is a master keyboard, use is MasterKeyboard.
    If the device is a slave pointer, use is SlavePointer.
    If the device is a slave keyboard, use is SlaveKeyboard.
    If the device is a floating slave, use is FloatingSlave.
attachment
    If the device is a master pointer or a master keyboard, attachment
    specifies the paired master keyboard, or the paired master pointer,
    respectively.  If the device is a non-floating slave device
    attachment specifies the master device this device is attached to.
    If the device is a floating slave, attachment is undefined.
enabled
    Zero if the device is disabled, non-zero otherwise.
num_classes
    Number of classes provided.
name_len
    Length of the name in bytes not including padding.
classes
    Details the available classes provided by the device in an undefined
    order.
name
    The device's name. padded to a multiple of 4 bytes.</code></pre>
</div></div>
<div class="paragraph"><p>For all classes, type specifies the device class. Clients are required
to ignore unknown device classes. The length field specifies the length
of the class in 4 byte units.
The following classes may occur only once: ButtonClass, KeyClass</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ButtonClass:
type
    Always ButtonClass.
length
    Length in 4 byte units.
sourceid
    The device this class originates from.
num_buttons
    Number of buttons provided by the device.
labels
    List of Atoms specifying the label for each button. An Atom of None
    specifies an unlabeled button. Buttons are listed in the device-native
    order regardless of the current button mapping.
state
    The current button mask for this device after button mapping is
    applied. Each bit representing a button is 1 if this button is
    logically down, or 0 otherwise. State is a multiple of 4-byte units
    and always contains at least num_buttons bits.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>KeyClass:
type
    Always KeyClass.
length
    Length in 4 byte units.
sourceid
    The device this class originates from.
num_keys
    Number of keycodes provided by the device.
keys
    List of keycodes provided.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>ValuatorClass:
type
    Always ValuatorClass.
length
    Length in 4 byte units.
sourceid
    The device this class originates from.
number
    Valuator number of this axis. The valuator number is in device-native
    order and potential axis mappings are ignored.
label
    Atom specifying the axis name. An Atom of None specifies an unlabeled
    axis.
min
    Minimum value.
max
    Minimum value.
resolution
    Resolution in counts/meter.
mode
    Relative or Absolute.
value
    Last published axis value (if mode is absolute).</code></pre>
</div></div>
<div class="paragraph"><p>An axis in Relative mode may specify min and max as a hint to the
client. If no min and max information is available, both must be 0.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ScrollClass:
type
    Always ScrollClass.
number
    Valuator number that is referred to. This valuator number must be listed in
    the ValuatorClassInfo.
scroll_type:
    Vertical for a vertical scrolling axis, Horizontal for a horizontal
    scrolling axis.
flags:
    A set of flags that apply to this scroll axis.
    NoEmulation: no legacy scroll button events are generated for events
                 on this scrolling axis.
    Preferred: This axis is the preferred axis for emulating valuator
               events from legacy scroll button events.
increment:
    The valuator delta equivalent to one positive unit of scrolling.</code></pre>
</div></div>
<div class="paragraph"><p>A ScrollClass may only exist if the device has at least one ValuatorClass
and each valuator number listed in any ScrollClass. Only one ScrollClass may
exist per ValuatorClass.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>TouchClass:
type
    Always TouchClass.
length
    Length in 4 byte units.
sourceid
    The device this class originates from.
mode
    The device type of the touch device.  This mode may change at runtime.
num_touches
    The maximum number of simultaneous touchpoints the device may send.
    If num_touches is 0, the number of supported touches is unknown or
    unlimited.</code></pre>
</div></div>
<div class="paragraph"><p>Devices with a TouchClass emit touch events with the same axes as pointer
events.</p></div>
</div>
<div class="sect3">
<h4 id="requests-selectevents">13.1.3. XISelectEvents</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XISelectEvents
        window:         Window
        num_masks:      CARD16
        masks:          LISTofEVENTMASK</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>EVENTMASK { deviceid:          DEVICE,
            mask_len:          CARD16,
            mask:              SETofEVTYPEMASK }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>window
    The window to select the events on.
num_masks
    Number of items in masks.
deviceid
    Numerical deviceid, or AllDevices, or AllMasterDevices.
mask_len
    Length of mask in 4 byte units.
mask
    Event mask. An event mask for an event type T is defined as (1 &lt;&lt; T).</code></pre>
</div></div>
<div class="paragraph"><p>XISelectEvents selects for XI2 events on window.</p></div>
<div class="paragraph"><p>If num_masks is 0, a BadValue error occurs.</p></div>
<div class="paragraph"><p>Each mask sets the (and overwrites a previous) event mask for the DEVICE
specified through deviceid. The device AllDevices or
AllMasterDevices is treated as a separate device by server. A client&#8217;s
event mask is the union of AllDevices, AllMasterDevices and the
per-device event mask.
The removal of device from the server unsets the event masks for the
device. If an event mask is set for AllDevices or AllMasterDevices, the
event mask is not cleared on device removal and affects all future
devices.</p></div>
<div class="paragraph"><p>If mask_len is 0, the event mask for the given device is cleared.</p></div>
<div class="paragraph"><p>The mask for XIHierarchyEvents may only be selected for XIAllDevices.
Setting it for any other device results in a BadValue error.</p></div>
<div class="paragraph"><p>A client selecting for any of XI_TouchBegin, XI_TouchUpdate, or XI_TouchEnd
must select for all three events at the same time, else a BadValue error
will be generated. A client selecting for XI_TouchOwnership must select for
all three of the other touch events. If the selection for these touch events
overlaps a current selection by another client (e.g. selecting for a
specific device when another client has a selection for XIAllDevices), a
BadAccess error occurs.</p></div>
</div>
<div class="sect3">
<h4 id="requests-getselectedevents">13.1.4. XIGetSelectedEvents</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIGetSelectedEvents
        window:         Window
        ▶
        num_masks:      CARD16
        masks:          LISTofEVENTMASK
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>window
    The window to select the events on.
num_masks
    Number of items in masks.
masks
    Selected event masks by this client.</code></pre>
</div></div>
<div class="paragraph"><p>Masks are returned on a per-device basis, with masks for AllDevices and
AllMasterDevices returned separately. A client can calculate the
effective mask for a device with a bitwise OR of the AllDevices, the
AllMasterDevices and the device-specific mask.</p></div>
<div class="paragraph"><p>If num_masks is 0, no events have been selected by this client on the
given window.</p></div>
</div>
<div class="sect3">
<h4 id="requests-querypointer">13.1.5. XIQueryPointer</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIQueryPointer
        window:         Window
        deviceid:       DEVICEID
        ▶
        root:           Window
        child:          Window
        root_x:         FP1616
        root_y:         FP1616
        win_x:          FP1616
        win_y:          FP1616
        same_screen:    BOOL
        mods:           MODIFIERINFO
        group:          GROUPINFO
        buttons_len:    CARD16
        buttons:        SETofBUTTONMASK
└───</code></pre>
</div></div>
<div class="paragraph"><p>Query a master pointer device for its current position.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>root
    The root window the pointer is logically on.
child
    The child window of window that contains the pointer or None.
root_x
root_y
    Pointer position relative to the root window's origin.
win_x
win_y
    Pointer position relative to window or 0 if same_screen is false.
same_screen
    True if window is on the same screen as the pointer.
mods
    XKB modifier state on the paired device.
group
    XKB group state on the paired device.
buttons_len
    The length of buttons in 4 byte units.
buttons
    Button state.</code></pre>
</div></div>
<div class="paragraph"><p>If the device is not a master pointer device or not a floating slave
pointer, a BadDevice error results.</p></div>
</div>
<div class="sect3">
<h4 id="requests-warppointer">13.1.6. XIWarpPointer</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIWarpPointer
        src_win:         Window
        dst_win:         Window
        src_x:           FP1616
        src_y:           FP1616
        src_width:       INT16
        src_height:      INT16
        dst_x:           FP1616
        dst_y:           FP1616
        deviceid:        DEVICEID
└───</code></pre>
</div></div>
<div class="paragraph"><p>WarpPointer moves the pointer of deviceid as if the user had moved
the pointer. WarpPointer can only be called for MasterPointer and
FloatingSlave devices.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>src_win
   If src_window is not None, the move only takes place if src_window
   contains the pointer and the pointer is contained in the specified
   rectangle of src_window.
dst_win
   If dst_win is None, this request moves the pointer by offsets
   dst_x/dst_y relative to the current position of the pointer. If
    dst_window is a window, this request moves the pointer to
   dst_x/dst_y relative to dst_win's origin.
src_x
src_y
src_width
src_height
   Specifies the source window rectangle.
dst_x
dst_y
    The relative coordinates to move the pointer if dst_win is None, or
    the absolute coordinates if dst_win is a window.
deviceid
    The device to warp.</code></pre>
</div></div>
<div class="paragraph"><p>This request cannot be used to move the pointer outside the confine-to
window of an active pointer grab. An attempt will only move the pointer as
far as the closest edge of the confine-to window.</p></div>
<div class="paragraph"><p>This request will generate events just as if the user had instantaneously
moved the pointer.</p></div>
</div>
<div class="sect3">
<h4 id="requests-changecursor">13.1.7. XIChangeCursor</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIChangeCursor
        win:             Window
        cursor:          Cursor
        deviceid:        DEVICEID
└───</code></pre>
</div></div>
<div class="paragraph"><p>Change a master pointer&#8217;s cursor on the specified window.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>window
    The window.
cursor
    The new cursor or None.
deviceid
    The master pointer device.</code></pre>
</div></div>
<div class="paragraph"><p>Whenever device enters a window W, the cursor shape is selected in the
following order:</p></div>
<div class="ulist"><ul>
<li>
<p>
if the current window has a device cursor C(d) defined for device,
  display this cursor C(d).
</p>
</li>
<li>
<p>
otherwise, if the current window has a cursor C(w) defined in the core
  protocol&#8217;s window attributes, display cursor C(w).
</p>
</li>
<li>
<p>
repeat on parent window until a cursor has been found.
</p>
</li>
</ul></div>
<div class="paragraph"><p>The device cursor for a given window is reset once the window is destroyed
or the device is removed, whichever comes earlier.</p></div>
<div class="paragraph"><p>If deviceid does not specify a master pointer, a BadDevice error
is returned.</p></div>
</div>
<div class="sect3">
<h4 id="requests-changehierarchy">13.1.8. XIChangeHierarchy</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIChangeHierarchy
        num_changes:     CARD8
        changes:         LISTofHIERARCHYCHANGES
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>HIERARCHYCHANGE { ADDMASTER, REMOVEMASTER, ATTACHSLAVE, DETACHSLAVE }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>HIERARCHYCHANGETYPE { AddMaster, RemoveMaster, AttachSlave, DetachSlave }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>CHANGEMODE { Float, Attach }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>ADDMASTER { type:        HIERARCHYCHANGETYPE
            length:      CARD16
            name_len:    CARD16
            send_core:   BOOL
            enable:      BOOL
            name:        LISTofCHAR8 }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>REMOVEMASTER { type:            HIERARCHYCHANGETYPE
               length:          CARD16
               deviceid:        DEVICEID
               return_mode:     CHANGEMODE
               return_pointer:  DEVICEID
               return_keyboard: DEVICEID }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>ATTACHSLAVE   { type:        HIERARCHYCHANGETYPE
                length:      CARD16
                deviceid:    DEVICEID
                master:      DEVICEID }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>DETACHSLAVE { type:       HIERARCHYCHANGETYPE
              length:     CARD16
              deviceid:   DEVICEID }</code></pre>
</div></div>
<div class="paragraph"><p>XIChangeHierarchy allows a client to modify the
<a href="#hierarchy">Master/Slave device hierarchy</a>.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>num_changes
    The number of changes to apply to the current hierarchy.
changes
    The list of changes.</code></pre>
</div></div>
<div class="paragraph"><p>The server processes the changes in the order received from the client and
applies each requested change immediately. If an error occurs, processing
stops at the current change and returns the number of successfully applied
changes in the error.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ADDMASTER creates a pair of master devices.
type
    Always AddMaster.
length
    Length in 4 byte units.
name_len
    Length of name in bytes.
send_core
    True if the device should send core events.
enable
    True if the device is to be enabled immediately.
name
    The name for the new master devices. The master pointer's name is
    automatically appended with " pointer", the master keyboard's name is
    automatically appended with " keyboard".</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>REMOVEMASTER removes an existing master device.
type
    Always RemoveMaster.
length
    Length in 4 byte units.
deviceid
    The device to remove.
return_mode
    Return mode for attached slave devices.
    If return_mode is Float, all slave devices are set to floating.
    If return_mode is Attach, slave pointers are attached to
    return_pointer and slave keyboards are attached to
    return_keyboard.
return_pointer
return_keyboard
    The master pointer and master keyboard to attach slave devices to, if
    return_mode is Attach. If return_mode is Float, return_pointer
    and return_keyboard are undefined.</code></pre>
</div></div>
<div class="paragraph"><p>Removing a master pointer removes the paired master keyboard and vice
versa.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ATTACHSLAVE attaches a slave device to a given master device.
type
    Always ChangeAttachment.
length
    Length in 4 byte units.
deviceid
    Deviceid of the slave device.
master
    The new master device to attach this slave device to.</code></pre>
</div></div>
<div class="paragraph"><p>If any clients are selecting for touch events from the slave device, their
selection will be canceled.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>DETACHSLAVE detaches a slave device from its current master device.
type
    Always ChangeAttachment.
length
    Length in 4 byte units.
deviceid
    Deviceid of the slave device.</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="requests-setclientpointer">13.1.9. XISetClientPointer</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XISetClientPointer
        win:             Window
        deviceid:        DEVICEID
└───</code></pre>
</div></div>
<div class="paragraph"><p>Set the ClientPointer for the client owning win to the given device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>win
     Window or client ID.
deviceid
     The master pointer or master keyboard that acts as ClientPointer.</code></pre>
</div></div>
<div class="paragraph"><p>Some protocol requests are ambiguous and the server has to choose a device
to provide data for a request or a reply. By default, the server will
choose a client&#8217;s ClientPointer device to provide the data, unless the
client currently has a grab on another device. See section
<a href="#clientpointer">The ClientPointer principle</a> for more details.</p></div>
<div class="paragraph"><p>If win is None, the ClientPointer for this client is set to the given
device. Otherwise, if win is a valid window, the ClientPointer for the
client owning this window is set to the given device. Otherwise, if win is
not a valid window but a client with the client mask equal to win exists,
this client&#8217;s ClientPointer is set to the given device.</p></div>
<div class="paragraph"><p>If deviceid does not specify a master pointer or master keyboard, a
BadDevice error is returned.</p></div>
<div class="paragraph"><p>If window does not specify a valid window or client ID and is not None, a
BadWindow error is returned.</p></div>
</div>
<div class="sect3">
<h4 id="requests-getclientpointer">13.1.10. XIGetClientPointer</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIGetClientPointer
        win:             Window
        ▶
        set:             BOOL
        deviceid:        DEVICEID
└───</code></pre>
</div></div>
<div class="paragraph"><p>Query the ClientPointer for the client owning win.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>win
    The window or client ID.
set
    True if the client has a ClientPointer set.
deviceid
    The master pointer that acts as a ClientPointer if set is True.</code></pre>
</div></div>
<div class="paragraph"><p>No difference is made between a ClientPointer set explicitly through
XISetClientPointer and a ClientPointer implicitly assigned by the server
in response to an ambiguous request.</p></div>
</div>
<div class="sect3">
<h4 id="requests-setfocus">13.1.11. XISetFocus</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XISetFocus
        focus:           Window
        deviceid:        DEVICEID
        time:            Time
└───</code></pre>
</div></div>
<div class="paragraph"><p>Set the focus for the given device to the given window. Future key events
from this device are sent to this window.
This request generates FocusIn and FocusOut events.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>focus
    A viewable window or None.
deviceid
    The device to modify the focus window for.
time
    Specifies the time to change the focus or CurrentTime.</code></pre>
</div></div>
<div class="paragraph"><p>If focus is None, key events from this device are discarded until a new
focus window is set. If focus is a viewable window, key events from this
device are sent to this window. If the window becomes unviewable, the
window&#8217;s first viewable ancestor automatically becomes the focus window
and FocusIn and FocusOut events are sent as if a client had changed the
focus window.
This is equivalent to RevertToParent in the core XSetInputFocus window.</p></div>
<div class="paragraph"><p>This request 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.</p></div>
</div>
<div class="sect3">
<h4 id="requests-getfocus">13.1.12. XIGetFocus</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIGetFocus
        deviceid:        DEVICEID
        ▶
        focus:           Window
└───</code></pre>
</div></div>
<div class="paragraph"><p>Return the current focus window for the given device.</p></div>
</div>
<div class="sect3">
<h4 id="requests-grabdevice">13.1.13. XIGrabDevice</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIGrabDevice
        deviceid:        DEVICEID
        grab_window:     Window
        owner_events:    BOOL
        grab_mode:       { Synchronous, Asynchronous }
        paired_device_mode: { Synchronous, Asynchronous }
        time:            TIMESTAMP or CurrentTime
        cursor:          Cursor
        mask_len:        CARD16
        masks:           SETofEVTYPEMASK
        ▶
        status:          Success, AlreadyGrabbed, Frozen, InvalidTime, NotViewable
└───</code></pre>
</div></div>
<div class="paragraph"><p>This request actively grabs control of the specified input device. Further
input events from this device are reported only to the grabbing client.
This request overides any previous active grab by this client for this
device.  This request does not affect the processing of XI 2.2
touch events.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to grab.
grab_window
    Events are reported relative to the grab window.
owner_events
    Specifies whether event will be reported normally or relative to the
    grab window.
grab_mode
    Specifies if this device will be frozen as a result of the grab.
paired_device_mode
    Specifies if the master device paired with this device will be frozen
    as a result of the grab.
time
    A valid server time or CurrentTime.
cursor
    The cursor to display for the duration of the grab or None.
mask_len
    Length of mask in 4 byte units.
mask
    Event mask. An event mask for an event type T is defined as (1 &lt;&lt; T).
status
    Success or the reason why the grab could not be established.</code></pre>
</div></div>
<div class="paragraph"><p>The masks parameter specifies which events the client wishes to receive
while the device is grabbed.</p></div>
<div class="paragraph"><p>If owner-events is False, input events generated from this device are
reported with respect to grab-window, and are only reported if selected by
being included in the event-list.  If owner-events is True, then if a
generated 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 selected by being included in the event-list. For
either value of owner-events, unreported events are discarded.</p></div>
<div class="paragraph"><p>If grab-mode is Asynchronous, device event processing continues normally.
If the device is currently frozen by this client, then processing of
device events is resumed. If grab-mode is Synchronous, the state of the
grabbed device (as seen by means of the protocol) appears to freeze,
and no further device events are generated by the server until the
grabbing client issues a releasing XIAllowEvents request or until the
device grab is released. Actual device input events are not lost while the
device is frozen; they are simply queued for later processing.</p></div>
<div class="paragraph"><p>If the device is a slave device, the paired-device-mode is ignored.
Otherwise, if this device is a master device and paired-device-mode is
Asynchronous, event processing is unaffected by activation of the grab. If
this device is a master device and paired-device-mode is Synchronous, the
state of the master device paired with this device (as seen by means of the
protocol) appears to freeze, and no further events are generated by the
server until the grabbing client issues a releasing XIAllowEvents request
or until the device grab is released. Actual events are not lost while the
devices are frozen; they are simply queued for later processing.</p></div>
<div class="paragraph"><p>If the cursor is not None and the device is a master pointer device, the
cursor will be displayed until the device is ungrabbed.</p></div>
<div class="paragraph"><p>This request fails and returns:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>AlreadyGrabbed: If the device is actively grabbed by some other client.
NotViewable: If grab-window is not viewable.
InvalidTime: If the specified time is earlier than the last-grab-time for
             the specified device or later than the current X server time.
             Otherwise, the last-grab-time for the specified device is set
             to the specified time and CurrentTime is replaced by the
             current X server time.
Frozen: If the device is frozen by an active grab of another client.</code></pre>
</div></div>
<div class="paragraph"><p>To release a grab of a device, use XIUngrabDevice.</p></div>
</div>
<div class="sect3">
<h4 id="requests-ungrabdevice">13.1.14. XIUngrabDevice</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIUngrabDevice
        deviceid:        DEVICEID
        time:            TIMESTAMP or CurrentTime
└───</code></pre>
</div></div>
<div class="paragraph"><p>This request releases the device if this client has it actively grabbed
(from either XIGrabDevice or  XIPassiveGrabDevice) and
releases any queued events. If any devices were frozen by the grab,
XIUngrabDevice thaws them.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to grab.
time
    A valid server time or CurrentTime.</code></pre>
</div></div>
<div class="paragraph"><p>The request has no effect if the specified time is earlier than the
last-device-grab time or is later than the current server time.
This request generates FocusIn and FocusOut events.
An XIUngrabDevice is performed automatically if the event window for an
active device grab becomes not viewable.</p></div>
</div>
<div class="sect3">
<h4 id="requests-allowevents">13.1.15. XIAllowEvents</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIAllowEvents
        deviceid:        DEVICEID
        time:            TIMESTAMP or CurrentTime
        event_mode:      { AsyncDevice, SyncDevice,
                           AsyncPairedDevice, SyncPairedDevice,
                           ReplayDevice, AsyncPair, SyncPair,
                           AcceptTouch¹, RejectTouch¹ }
        touchid¹:        CARD32
        grab_window¹:    Window
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>¹ since XI 2.2</code></pre>
</div></div>
<div class="paragraph"><p>The XIAllowEvents request releases some queued events if the client
has caused a device to freeze. It also is used to handle touch grab and
ownership processing.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to grab.
time
    A valid server time or CurrentTime.
event_mode
    Specifies whether a device is to be thawed and events are to be
    replayed, or how to handle a grabbed touch sequence.
touchid
    The ID of the touch sequence to accept or reject. The value is undefined
    for event modes other than AcceptTouch and RejectTouch.
grab_window
    The window on which to accept or reject a touch sequence grab. The value
    is undefined for event modes other than AcceptTouch and RejectTouch.</code></pre>
</div></div>
<div class="paragraph"><p>The request has no effect if the specified time is earlier than the last-grab
time of the most recent active grab for the client, or if the specified time is
later than the current X server time. The time parameter must be CurrentTime for
requests with event modes of AcceptTouch and RejectTouch.</p></div>
<div class="paragraph"><p>When event-mode is AcceptTouch, a BadValue error occurs if the touch ID is
invalid. A BadAccess error occurs if this client is not the current or potential
owner of the specified touch ID.</p></div>
<div class="paragraph"><p>The following describes the processing that occurs depending on what constant
you pass to the event-mode argument:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>AsyncDevice:
    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, AsyncDevice thaws for
    all.
    AsyncDevice has no effect if the specified device is not frozen by the
    client, but the device need not be grabbed by the client.
SyncDevice:
    If the specified device is frozen and actively grabbed by the client,
    event processing for that device continues normally until the next
    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.
    SyncDevice has no effect if the specified device is not frozen by the
    client or is not grabbed by the client.
 ReplayDevice:
    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 XIGrabButton or from a previous XIAllowEvents with
    mode SyncDevice, but not from a Grab), the grab is released and
    that event is completely reprocessed.  This time, however, the request
    ignores any passive grabs at or above (towards the root) 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.
 AsyncPairedDevice
    If the paired master device is frozen by the client, event processing
    for it continues as usual. If the paired device is frozen multiple
    times by the client on behalf of multiple separate grabs,
    AsyncPairedDevice thaws for all.
    AsyncPairedDevice has no effect if the device is not frozen by the
    client, but those devices need not be grabbed by the client.
    AsyncPairedDevice has no effect if deviceid specifies a slave device.
 SyncPairedDevice
    If the paired master device is frozen by the client, event processing (for
    the paired master device) continues normally until the next button or key
    event is reported to the client for the grabbed device (button event for
    the grabbed device, key or motion event for the device), at which time
    the device again appears to freeze. However, if the reported event causes
    the grab to be released, then the device does not freeze.
    SyncPairedDevice has no effect if the specified device is not grabbed
    by the client or if it is no frozen as the result of an event.
    SyncPairedDevice has no effect if deviceid specifies a slave device.
 SyncPair
    If both the device and the paired master device are frozen by the
    client, event processing (for both devices) continues normally until
    the next XIButtonPress, XIButtonRelease, XIKeyPress, or XIKeyRelease
    event is reported to the client for a grabbed device (button event for
    a pointer, key event for a keyboard), at which time the devices again
    appear to freeze. However, if the reported event causes the grab to be
    released, then the devices do not freeze (but if the other device is
    still grabbed, then a subsequent event for it will still cause both
    devices to freeze).
    SyncPair has no effect unless both the device and the paired master
    device are frozen by the client. If the device or paired master device
    is frozen twice by the client on behalf of two separate grabs,
    SyncPair thaws for both (but a subsequent freeze for SyncPair will
    only freeze each device once).
    SyncPair has no effect if deviceid specifies a slave device.
 AsyncPair
    If the device and the paired master device are frozen by the client,
    event processing for both devices continues normally. If a device is
    frozen twice by the client on behalf of two separate grabs, AsyncBoth
    thaws for both. AsyncPair has no effect unless both the device and the
    paired master device frozen by the client.
    AsyncPair has no effect if deviceid specifies a slave device.
 AcceptTouch
    The client is deemed to have taken control of the touch sequence once it
    owns the sequence. TouchEnd events will be sent to all clients listening
    to the touch sequence that have either grabbed the touch sequence on a
    child window of the grab_window or have received events for the touch
    sequence through event selection. These clients will no longer receive
    any TouchUpdate events.
 RejectTouch
    The client is no longer interested in the touch sequence, and will
    receive a TouchEnd event. If the client is the current owner of the
    sequence, ownership will be passed on to the next listener.</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="requests-passivegrabdevice">13.1.16. XIPassiveGrabDevice</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIPassiveGrabDevice
        deviceid:        DEVICE
        detail:          CARD32
        grab_type:       GRABTYPE
        time:            TIMESTAMP
        grab_window:     Window
        cursor:          Cursor
        owner_events:    Bool
        grab_mode:       { Synchronous, Asynchronous, Touch¹ }
        paired_device_mode: { Synchronous, Asynchronous }
        num_modifiers:   INT16
        mask_len:        CARD16
        masks:           SETofEVTYPEMASK
        modifiers:       LISTofSETofMODIFIERMASK
        ▶
        num_modifiers_return:    INT16
        modifiers_return:        LISTofGRABMODIFIERINFO
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>GRABTYPE         { GrabtypeButton, GrabtypeKeycode, GrabtypeEnter,
                   GrabtypeFocusIn, GrabtypeTouchBegin¹ }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>GRABMODIFIERINFO {   status:    Access
                     modifiers: SETofMODIFIERMASK }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>¹ since XI 2.2</code></pre>
</div></div>
<div class="paragraph"><p>Establish an explicit passive grab for a button or keycode
on the specified input device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>cursor
    The cursor to display for the duration of the grab. If grab_type
    is not GrabtypeButton, this argument is ignored.
deviceid
    The device to establish the passive grab on or AllDevices or
    AllMasterDevices.
detail
    The button number, or key symbol to grab for.
    Must be 0 for GrabtypeEnter, GrabtypeFocusIn, and
    GrabtypeTouchBegin.
grab_type
    The type of grab to establish.
grab_window
    Events are reported relative to the grab window.
grab_mode
    If grab-mode is Asynchronous, device event processing continues
    normally.  If the device is currently frozen by this client, then
    processing of device events is resumed. If grab-mode is
    Synchronous, the state of the grabbed device (as seen by means of
    the protocol) appears to freeze, and no further device events are
    generated by the server until the grabbing client issues a
    releasing XIAllowEvents request or until the device grab is
    released. Actual device input events are not lost while the device
    is frozen; they are simply queued for later processing. If grab_type
    is GrabtypeTouchBegin, grab_mode must be set to Touch.
mask_len
    Length of mask in 4 byte units.
mask
    Event mask. An event mask for an event type T is defined as (1 &lt;&lt; T).
modifiers
    XKB modifier state to activate this passive grab.
num_modifiers
    Number of elements in modifiers.
owner_events
    Specifies whether event will be reported normally or relative to the
    grab window.
num_modifiers_return
    Number of elements in modifiers_return
modifiers_return
    XKB modifier state that could not be grabbed.
time
    This field is unused.</code></pre>
</div></div>
<div class="paragraph"><p>If owner-events is False, input events generated from this device are
reported with respect to grab-window, and are only reported if
selected by being included in the event-list.  If owner-events is
True, then if a generated 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 selected
by being included in the event-list. For either value of
owner-events, unreported events are discarded.</p></div>
<div class="paragraph"><p>If deviceid specifies a master pointer, the modifiers of the paired
master keyboard are used. If deviceid specifies a slave pointer
the modifiers of the master keyboard paired with the attached master
pointers are used. If deviceid specifies a slave keyboard, the
modifiers of the attached master keyboard are used. Note that
activating a grab on a slave device detaches the device from its
master. In this case, the modifiers after activation of the grab are
from the slave device only and may be different to the modifier state
when the grab was triggered.</p></div>
<div class="paragraph"><p>In the future, if grab_type is GrabtypeButton or GrabtypeKeyboard, the
device is actively grabbed if:</p></div>
<div class="ulist"><ul>
<li>
<p>
the device is not grabbed, and
</p>
</li>
<li>
<p>
the specified modifier keys are down, and
</p>
</li>
<li>
<p>
the grab_type is GrabtypeButton and the button specified in detail
          is logically pressed or the grab_type is GrabtypeKeycode and the
          keycode specified in detail is logically pressed, and
</p>
</li>
<li>
<p>
the grab_window contains the pointer, and
</p>
</li>
<li>
<p>
a passive grab on the same button/keycode + modifier
          combination does not exist on an ancestor of grab_window.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Otherwise, if grab_type is GrabtypeEnter or GrabtypeFocusIn, the
device is actively grabbed if:</p></div>
<div class="ulist"><ul>
<li>
<p>
the device is not actively grabbed, and
</p>
</li>
<li>
<p>
the specified modifier keys are down, and
</p>
</li>
<li>
<p>
the grab_type is GrabtypeEnter and the device&#8217;s pointer has moved
          into grab_window or a descendant of grab_window, or the grab_type is
          GrabtypeFocusIn and the device&#8217;s focus has been set to the
          grab_window or a descendant of grab_window, and
</p>
</li>
<li>
<p>
a passive grab of the same grab_type + modifier combination does not
          does not exist on an ancestor of grab_window.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Otherwise, if grab_type is GrabtypeTouchBegin, a touch grab begins if:</p></div>
<div class="ulist"><ul>
<li>
<p>
the device is not actively grabbed, and
</p>
</li>
<li>
<p>
the specified modifier keys are down
</p>
</li>
<li>
<p>
a touch begins in grab_window or a descendant of grab_window, and
</p>
</li>
<li>
<p>
a passive grab of the same grab_type + modifier combination does not
          does not exist on an ancestor of grab_window.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Ownership of the touch sequence is granted to the grabbing client if:</p></div>
<div class="ulist"><ul>
<li>
<p>
a TouchBegin or pointer grab for an emulated touch sequence of a
          direct touch device with the same modifier set does not exist on
          an ancestor of grab_window, or all applicable grabs have released
          ownership.
</p>
</li>
</ul></div>
<div class="paragraph"><p>A modifier of GrabAnyModifier is equivalent to issuing the request for
all possible modifier combinations (including no modifiers). A client
may request a grab for GrabAnyModifier and explicit modifier
combinations in the same request.</p></div>
<div class="paragraph"><p>A GrabtypeButton or GrabtypeKeyboard grab is released when all buttons
or keycode are released, independent of the state of modifier keys.
A GrabtypeEnter or GrabtypeFocusIn grab is released when the
pointer or focus leaves the window and all of its descendants,
independent of the state of modifier keys.
A GrabtypeTouchBegin grab is released when the touch sequence ends or
the client uses XIAllowEvents with mode RejectTouch.
Note that the logical state of a device (as seen by means of the
protocol) may lag the physical state if device event processing is
frozen.</p></div>
<div class="paragraph"><p>This request overrides all previous passive grabs by the same
client on the same button/key/enter/focus in + modifier combinations
on the same window.</p></div>
<div class="paragraph"><p>If some other client already has issued a XIPassiveGrabDevice request
with the same button or keycode and modifier combination, the
failed modifier combinations is returned in modifiers_return. If some
other client already has issued an XIPassiveGrabDevice request of
grab_type XIGrabtypeEnter, XIGrabtypeFocusIn, or
XIGrabtypeTouchBegin with the same grab_window and the same
modifier combination, the failed modifier combinations are returned
in modifiers_return. If num_modifiers_return is zero, all passive
grabs have been successful.</p></div>
<div class="paragraph"><p>If a button grab or enter grab activates, EnterNotify and LeaveNotify
events with mode Grab are generated as if the pointer were to suddenly
warp from its current position some position in the grab_window.
However, the pointer does not warp, and the pointer position is used
as both the initial and final positions for the events.</p></div>
<div class="paragraph"><p>If a keycode grab or focus grab activates, FocusIn and FocusOut events
with mode Grab are generated as if the focus were to change from the
current window to the grab_window.</p></div>
<div class="paragraph"><p>If an enter or focus in grab activates, additional EnterNotify events
with mode XIPassiveGrabNotify are generated as if the pointer or focus
were to suddenly warp from its current position to some position in
the grab window.  These events are sent to the grabbing client only
and only if the grab event mask has selected for it. If such a passive
grab deactivates, addional LeaveNotify events with mode
XIPassiveUngrabNotify are generated and sent to the grabbing client
before the grab deactivates.</p></div>
<div class="paragraph"><p>For GrabtypeTouchBegin, grab_mode must be Touch or a BadValue error
is generated.</p></div>
<div class="paragraph"><p>See section <a href="#multitouch-ownership">Ownership of touch sequences</a> for
additional notes on touch grabs, as they do not behave like traditional
grabs: in particular, they do not freeze the device, and delivery of touch
events continues even if the device is frozen due to a grab by another
client.</p></div>
</div>
<div class="sect3">
<h4 id="requests-passiveungrabdevice">13.1.17. XIPassiveUngrabDevice</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIPassiveUngrabDevice
        deviceid:        DEVICEID
        detail:          CARD32
        grab_type:       GRABTYPE
        grab_window:     Window
        num_modifiers:   INT16
        modifiers:       LISTofSETofMODIFIERMASK
└───</code></pre>
</div></div>
<div class="paragraph"><p>Release an explicit passive grab on the specified input device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to establish the passive grab on.
detail
    The button number or key symbol to ungrab.
    Must be 0 for GrabtypeEnter, GrabtypeFocusIn, and
    GrabtypeTouchBegin.
grab_type
    The type of grab to establish.
grab_window
    Events are reported relative to the grab window.
modifiers
    XKB modifier state to activate this passive grab.
num_modifiers
    Number of elements in modifiers.</code></pre>
</div></div>
<div class="paragraph"><p>This request has no effect if the client does not have a passive grab
of the same type, same button or keycode (if applicable) and modifier
combination on the grab_window.</p></div>
</div>
<div class="sect3">
<h4 id="requests-listproperties">13.1.18. XIListProperties</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIListProperties
        deviceid:        DEVICEID
        ▶
        num_properties:  INT16
        properties:      LISTofATOM
└───</code></pre>
</div></div>
<div class="paragraph"><p>List the properties associated with the given device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to list the properties for.
num_properties
    Number of properties in the reply
properties
    All properties on the device.</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="requests-changeproperty">13.1.19. XIChangeProperty</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIChangeProperty
        deviceid:        DEVICEID
        property:        ATOM
        type:            ATOM
        format:          { 8, 16, 32 }
        mode:            { Append, Prepend, Replace }
        num_items:       CARD32
        data:            LISTofINT8, or LISTofINT16, or LISTofINT32
└───</code></pre>
</div></div>
<div class="paragraph"><p>Change the given property on the given device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to change the property on.
property
    The property to modify.
type
    The property's type.
mode
    One of Append, Prepend, or Replace
num_items
    Number of items following this request.
data
    Property data (nitems * format/8 bytes)</code></pre>
</div></div>
<div class="paragraph"><p>The type is uninterpreted by the server. The format specifies whether
the data should be viewed as a list of 8-bit, 16-bit, or 32-bit
quantities so that the server can correctly byte-swap as necessary.</p></div>
<div class="paragraph"><p>If the mode is Replace, the previous propert y value is discarded.  If
the mode is Prepend or Append, then the type and format must match the
existing property value (or a Match error results). If the property is
undefined, it is treated as defined with the correct type and format
with zero-length data. For Prepend, the data is tacked on to the
beginning of the existing data, and for Append, it is tacked on to the
end of the existing data.</p></div>
<div class="paragraph"><p>The lifetime of a property is not tied to the storing client. Properties
remain until explicitly deleted, until the device is removed, or
until server reset.</p></div>
<div class="paragraph"><p>A property cannot be deleted by setting nitems to zero. To delete a
property, use XIDeleteProperty.</p></div>
<div class="paragraph"><p>This request generates an XIPropertyEvent.</p></div>
</div>
<div class="sect3">
<h4 id="requests-deleteproperty">13.1.20. XIDeleteProperty</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIDeleteProperty
        deviceid:        DEVICEID
        property:        ATOM
└───</code></pre>
</div></div>
<div class="paragraph"><p>Deletes the given property on the given device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to delete the property on.
property
    The property to delete.</code></pre>
</div></div>
<div class="paragraph"><p>If the property is deleted, an XIPropertyEvent is generated on the device.
If the property does not exist, this request does nothing.</p></div>
</div>
<div class="sect3">
<h4 id="requests-getproperty">13.1.21. XIGetProperty</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIGetProperty
        deviceid:        DEVICEID
        property:        ATOM
        type:            Atom or AnyPropertyType
        offset:          CARD32
        len:             CARD32
        delete:          BOOL
        ▶
        type:            Atom
        bytes_after:     CARD32
        num_items:       CARD32
        format:          { 8, 16, 32 }
        data:            LISTofINT8, or LISTofINT16, or LISTofINT32
└───</code></pre>
</div></div>
<div class="paragraph"><p>Get the data for the given property on the given device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device to retrieve the property data from.
property
    The property to retrieve the data from..
type
    The property type to retrieve or AnyPropertyType
offset
    The offset in 4-byte units.
len
    Number of bytes to receive in 4-byte units.
delete
    Delete the property after retrieving the data.
bytes_after
    Number of unread bytes in the stored property
num_items
    Number of items in data
format
    8, 16, or 32
data
    Property data (nitems * format/8 bytes)</code></pre>
</div></div>
<div class="paragraph"><p>If the specified property does not exist for the specified device, then
the return type is None, the format and bytes-after are zero, and the value is
empty. The delete argument is ignored in this case. If the specified property
exists but its type does not match the specified type, then the return
type is the actual type of the property, the format is the actual format of the
property (never zero), the bytes-after is the length of the property in bytes
(even if the format is 16 or 32), and the value is empty. The delete
argument is ignored in this case. If the specified property exists and
either AnyPropertyType is specified or the specified type matches the actual
type of the property, then the return type is the actual type of the property,
the format is the actual format of the property
(never zero), and the bytes-after and value are as follows, given:
         N = actual length of the stored property in bytes
            (even if the format is 16 or 32)
         I = 4 * long-offset
         T = N−I
         L = MINIMUM(T, 4 * long-length)
         A = N − (I + L)
The returned value starts at byte index I in the property (indexing
from 0), and its length in bytes is L. However, it is a Value error if
offset is given such that L is negative. The value of bytes_after is A,
giving the number of trailing unread bytes in the stored property. If
delete is True and the bytes_after is zero, the property is also
deleted from the device, and a XIPropertyNotify event is generated on
the device.</p></div>
</div>
</div>
<div class="sect2">
<h3 id="requests-xi23">13.2. Requests introduced in version 2.3</h3>
<div class="sect3">
<h4 id="requests-barrierreleasepointer">13.2.1. XIBarrierReleasePointer</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIBarrierReleasePointer
        num_items:       CARD32
        ▶
        data:            LISTofBARRIERRELEASEINFO
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>BARRIERRELEASEINFO { deviceid: DEVICEID,
                     barrier:  Barrier,
                     eventid: CARD32 }</code></pre>
</div></div>
<div class="paragraph"><p>Release a pointer currently blocked by a barrier. In the future, movement of
this pointer against the barrier will not be blocked.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>deviceid
    The device currently being blocked by a barrier
barrier
    The barrier currently blocking the device
eventid
    The unique event ID assigned to this barrier event sequence</code></pre>
</div></div>
<div class="paragraph"><p>If the barrier given does not currently block this device, or the eventid
is invalid, this request does nothing.</p></div>
<div class="paragraph"><p>Releasing a pointer barrier is only valid during one barrier event sequence,
and only applies to the next movement of this device against this barrier.
If the pointer moves away from the barrier following a
XIBarrierReleasePointer request, the release request is discarded. In the
future, if the pointer moves against the barrier again, a new eventid is
assigned and the client must re-issue the XIBarrierReleasePointer request.</p></div>
<div class="paragraph"><p>If the device is not a master pointer device, a BadDevice error results.
If the barrier does not name a valid barrier, a BadValue error results.</p></div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="events">14. Events</h2>
<div class="sectionbody">
<div class="paragraph"><p>An event specifies its length in 4-byte units after the initial 32 bytes.
Future versions of the protocol may provide additional information
in the same event, thus increasing the event size. Clients are required to
always read the number of bytes specified by the event, not the size of the
event they may have been compiled against.</p></div>
<div class="paragraph"><p>The following event types are available in XI2.</p></div>
<div class="paragraph"><p>Version 2.0:</p></div>
<div class="ulist"><ul>
<li>
<p>
HierarchyChanged
</p>
</li>
<li>
<p>
DeviceChanged
</p>
</li>
<li>
<p>
KeyPress
</p>
</li>
<li>
<p>
KeyRelease
</p>
</li>
<li>
<p>
ButtonPress
</p>
</li>
<li>
<p>
ButtonRelease
</p>
</li>
<li>
<p>
Motion
</p>
</li>
<li>
<p>
RawKeyPress
</p>
</li>
<li>
<p>
RawKeyRelease
</p>
</li>
<li>
<p>
RawButtonPress
</p>
</li>
<li>
<p>
RawButtonRelease
</p>
</li>
<li>
<p>
RawMotion
</p>
</li>
<li>
<p>
Enter
</p>
</li>
<li>
<p>
Leave
</p>
</li>
<li>
<p>
FocusIn
</p>
</li>
<li>
<p>
FocusOut
</p>
</li>
<li>
<p>
PropertyEvent
</p>
</li>
</ul></div>
<div class="paragraph"><p>Version 2.2:</p></div>
<div class="ulist"><ul>
<li>
<p>
TouchBegin
</p>
</li>
<li>
<p>
TouchUpdate
</p>
</li>
<li>
<p>
TouchOwnership
</p>
</li>
<li>
<p>
TouchEnd
</p>
</li>
<li>
<p>
RawTouchBegin
</p>
</li>
<li>
<p>
RawTouchUpdate
</p>
</li>
<li>
<p>
RawTouchEnd
</p>
</li>
</ul></div>
<div class="paragraph"><p>Version 2.3:</p></div>
<div class="ulist"><ul>
<li>
<p>
BarrierHit
</p>
</li>
<li>
<p>
BarrierLeave
</p>
</li>
</ul></div>
<div class="paragraph"><p>All events have a set of common fields specified as EVENTHEADER.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>EVENTHEADER { type:                       BYTE
              extension:                  BYTE
              sequenceNumber:             CARD16
              length:                     CARD32
              evtype:                     CARD16
              deviceid:                   DEVICEID
              time:                       Time }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>type
    Always GenericEvent.
extension
    Always the X Input extension offset.
sequenceNumber
    Sequence number of last request processed by the server.
length
    Length in 4-byte units after the initial 32 bytes.
evtype
    XI-specific event type.
deviceid
    Numerical device id for a device.
time
    Time in ms when the event occurred.</code></pre>
</div></div>
<div class="sect2">
<h3 id="events-xi20">14.1. Events introduced in version 2.0</h3>
<div class="sect3">
<h4 id="events-hierarchyevent">14.1.1. HierarchyEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    HierarchyEvent
        EVENTHEADER
        flags:                      SETofHIERARCHYMASK
        num_info:                   CARD16
        info:                       LISTofHIERARCHYINFO
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>HIERARCHYMASK { MasterAdded, MasterRemoved, SlaveAttached, SlaveDetached,
                SlaveAdded, SlaveRemoved, DeviceEnabled, DeviceDisabled }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>HIERARCHYINFO { deviceid:           DEVICEID,
                attachment:         DEVICEID,
                type:               DEVICEUSE
                enabled:            BOOL
                flags:              SETofHIERARCHYMASK}</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>flags
    Set of the changes that have occured, causing this event.
num_info
    The number of device info structs following the request.
info:
    The current hierarchy information.</code></pre>
</div></div>
<div class="paragraph"><p>An XIHierarchyEvent is sent whenever the device hierarchy been
changed. The flags specify all types of hierarchy modifiations that have
occured.
For all devices, info details the hierarchy information after the
modification of the hierarchy has occured. For each device specified with
deviceid:</p></div>
<div class="ulist"><ul>
<li>
<p>
if type is MasterPointer or MasterKeyboard, attachment decribes the
  pairing of this device.
</p>
</li>
<li>
<p>
if type is SlavePointer or SlaveKeyboard, attachment describes the
  master device this device is attached to.
</p>
</li>
<li>
<p>
if type is FloatingSlave device, attachment is undefined.
</p>
<div class="literalblock">
<div class="content">
<pre><code>enabled
     True if the device is enabled and can send events. A disabled master
     device will not forward events from an attached, enabled slave
     device.</code></pre>
</div></div>
</li>
</ul></div>
<div class="paragraph"><p>Note: Multiple devices may be affected in one hierarchy change,
deviceid in an XIHierarchyEvent is always the first affected
device. Clients should ignore deviceid and instead use the devices list.</p></div>
</div>
<div class="sect3">
<h4 id="events-devicechangedevent">14.1.2. DeviceChangedEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    DeviceChangedEvent
        EVENTHEADER
        reason:                CHANGEREASON
        source:                DEVICEID
        num_classes:           CARD16
        classes:               LISTofCLASS
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>CHANGEREASON { SlaveSwitch, DeviceChange }</code></pre>
</div></div>
<div class="paragraph"><p>A DeviceChangeEvent is sent whenever a device changes it&#8217;s capabilities.
This can happen either by a new slave device sending events through a
master device, or by a physical device changing capabilities at runtime.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>reason
    The reason for generating this event.
    If reason is SlaveSwitch, the slave device sending events through
    this device has changed and source specifies the new slave device.
    A SlaveSwitch reason can only occur on a master device.
    If reason is DeviceChange, the device itself has changed through
    other means (e.g. a physical device change) and source is
    the device itself.
source
    The source of the new classes.
num_classes
    Number of classes provided.
classes
    Details the available classes provided by the device.  The order the
    classes are provided in is undefined.</code></pre>
</div></div>
<div class="paragraph"><p>For a detailed description of classes, see the XIQueryDevice request.</p></div>
</div>
<div class="sect3">
<h4 id="events-deviceevent">14.1.3. DeviceEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    DeviceEvent
        EVENTHEADER
        detail:                     CARD32
        root:                       Window
        event:                      Window
        child:                      Window
        root_x:                     FP1616
        root_y:                     FP1616
        event_x:                    FP1616
        event_y:                    FP1616
        buttons_len:                CARD16
        valuators_len:              CARD16
        sourceid:                   DEVICEID
        mods:                       MODIFIERINFO
        group:                      GROUPINFO
        flags:                      DEVICEEEVENTFLAGS
        buttons:                    SETofBUTTONMASK
        valuators:                  SETofVALUATORMASK
        axisvalues:                 LISTofFP3232
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>BUTTONBIT { (1 &lt;&lt; Button1), (1 &lt;&lt; Button2), ... , (1 &lt;&lt; ButtonN) }
VALUATORBIT { (1 &lt;&lt; 1), ( 1 &lt;&lt; 2), ... ( 1 &lt;&lt; n) }</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>MODIFIERINFO  { base_mods:           CARD32,
                latched_mods:        CARD32,
                locked_mods:         CARD32,
                effective_mods:      CARD32}
GROUPINFO     { base_group:          CARD8,
                latched_group:       CARD8,
                locked_group:        CARD8,
                effective_group:     CARD8}</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>DEVICEEVENTFLAGS (all events): none
DEVICEEVENTFLAGS (key events only): { KeyRepeat }
DEVICEEVENTFLAGS (pointer events only): { PointerEmulated }
DEVICEEVENTFLAGS (touch events only): { TouchPendingEnd,
                                        TouchEmulatingPointer }</code></pre>
</div></div>
<div class="paragraph"><p>An XIDeviceEvent is generated whenever the logical state of a device
changes in response to a button press, a button release, a motion, a key
press or a key release. The event type may be one of KeyPress,
KeyRelease, ButtonPress, ButtonRelease, Motion.</p></div>
<div class="paragraph"><p>XI 2.2: The event type may also be TouchBegin, TouchUpdate, or TouchEnd.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>detail
    The button number, key code, touch ID, or 0.
root
event
child
    The root window, event window or subwindow, respectively. See core
    protocol specification for more detail.
root_x
root_y
    The position of the pointer in screen coordinates (16.16 fixed point).
event_x
event_y
    The position of the pointer in screen coordinates relative to the
    event window (16.16 fixed point).</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>buttons_len
    The length of buttons in 4 byte units.
valuators_len
    The length of valuators in 4 byte units.
sourceid
    The source device that originally generated the event.
mods
    XKB modifier state before the event occured.
group
    XKB group state before the event.
buttons
    Button state before the event.
valuators
    Bitmask of valuators provided in axisvalues.
axisvalues
    Valuator data in device-native resolution. This is a non-sparse
    array, value N represents the axis corresponding to the Nth bit set
    in valuators.
flags
    Miscellaneous information about this event; the union of the
    common flag set and either the key or pointer flag set,
    depending on the event type.
    KeyRepeat means that this event is for repeating purposes, and
    the physical state of the key has not changed.  This is only
    valid for KeyPress events.
    PointerEmulated signals that the event has been emulated from another
    XI 2.x event for legacy client support, and that this event should
    be ignored if the client listens for these events.  This flag is
    set on scroll ButtonPress and RawButtonPress events (buttons 4, 5, 6
    and 7) if a smooth-scrolling event on the Rel Vert Scroll or
    Rel Horiz Scroll axes was also generated. It is also set on Motion,
    ButtonPress, and ButtonRelease events generated by direct touch devices.
    TouchPendingEnd (for touch events only) means that the touch
    has physically ended, however another client still holds a grab, so the
    touch should be considered alive until all grabbing clients have
    accepted or passed on ownership.  The touch will not generate any
    further TouchUpdate events once an event with TouchPendingEnd has been
    received.
    TouchEmulatingPointer is set on touch events that emulate pointer
    events.</code></pre>
</div></div>
<div class="paragraph"><p>Modifier state in mods is detailed as follows:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>base_mods
    XKB base modifier state.
latched_mods
    XKB latched modifier state.
locked_mods
    XKB locked modifier state.</code></pre>
</div></div>
<div class="paragraph"><p>Group state in group is detailed as follows:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>base_group
    XKB base group state.
latched_group
    XKB latched group state.
locked_group
    XKB locked group state.</code></pre>
</div></div>
<div class="paragraph"><p>In servers supporting XI 2.2, a TouchBegin event is generated whenever a new
touch sequence initializes.
A TouchEnd event is generated whenever a touch sequence ceases. A
TouchUpdate event is generated whenever a valuator value changes, or a flag
flag (e.g. pending end) has changed for that touch sequence; this may result
in a TouchUpdate event being sent with zero valuators.</p></div>
<div class="paragraph"><p>The average finger size is significantly larger than one pixel. The
selection of the hotspot of a touchpoint is implementation dependent and
may not be the logical center of the touch.</p></div>
<div class="paragraph"><p>Touch tracking IDs are provided in the detail field of touch events. Its
value is always provided in every touch event. Tracking IDs are
represented as unsigned 32-bit values and increase strictly monotonically in
value for each new touch, wrapping back to 0 upon reaching the numerical limit
of IDs. The increment between two touch IDs is indeterminate. Clients may not
assume that any future touches will have specific touch IDs. IDs are globally
unique.</p></div>
<div class="paragraph"><p>The button state in touch events represents the state of the device&#8217;s
physical buttons only, even if that sequence is emulating pointer events.</p></div>
<div class="paragraph"><p>Touch events do not generate enter/leave events.</p></div>
</div>
<div class="sect3">
<h4 id="events-rawevent">14.1.4. RawEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    RawEvent
        EVENTHEADER
        detail:                    CARD32
        sourceid¹:                 DEVICEID
        flags:                     DEVICEEVENTFLAGS
        valuators_len:             CARD16
        valuators:                 SETofVALUATORMASK
        axisvalues:                LISTofFP3232
        axisvalues_raw:            LISTofFP3232
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>¹ since XI 2.1</code></pre>
</div></div>
<div class="paragraph"><p>A RawEvent provides the information provided by the driver to the
client. RawEvent provides both the raw data as supplied by the driver and
transformed data as used in the server. Transformations include, but are
not limited to, axis clipping and acceleration.
Transformed valuator data may be equivalent to raw data. In this case,
both raw and transformed valuator data is provided.
RawEvents are sent exclusively to all root windows.
Clients supporting XI 2.0 receive raw events when the device is not grabbed,
or when the device is grabbed by the client but not when the device is
grabbed by another client.
Clients supporting XI 2.1 or later receive raw events at all times, even
when the device is grabbed by another client.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>eventtype
    The type of event that occured on the device.
detail
    The button number, keycode or touch ID¹.
sourceid
    The source device that originally generated the event. The sourceid
    is undefined for clients not supporting XI 2.1.
flags
    Flags as described in DeviceEvent.
valuators_len
    The length of valuators in 4 byte units.
valuators
    Bitmask of valuators provided in axisvalues and axisvalues_raw.
axisvalues
    Valuator data in device-native resolution. This is a non-sparse
    array, value N represents the axis corresponding to the Nth bit set
    in valuators.
axisvalues_raw
    Untransformed valuator data in device-native resolution. This is a
    non-sparse array, value N represents the axis corresponding to the
    Nth bit set in valuators.</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>¹ since XI 2.2</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="events-enterleave">14.1.5. Enter or Leave or FocusIn or FocusOut</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    Enter or Leave or FocusIn or FocusOut
        EVENTHEADER
        root:               Window
        event:              Window
        child:              Window
        sourceid:           DEVICEID
        root_x:             FP1616
        root_y:             FP1616
        event_x             FP1616
        event_y:            FP1616
        mode:               NOTIFYMODE
        detail:             NOTIFYDETAIL
        same_screen:        BOOL
        focus:              BOOL
        mods:               MODIFIERINFO
        group:              GROUPINFO
        buttons_len:        CARD16
        buttons:            SETofBUTTONMASK
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>NOTIFYMODE { Normal, Grab, Ungrab }
NOTIFYDETAIL { Ancestor, Virtual, Inferior, Nonlinear, NonlinearVirtual,
               Pointer, PointerRoot, None }</code></pre>
</div></div>
<div class="paragraph"><p>Enter or Leave events are sent whenever a device&#8217;s pointer enters or
leaves a window.
FocusIn or FocusOut events are sent whenever a device&#8217;s focus is set to or
away from a window.
The enter/leave and focus in/out model is described in the core protocol
specification, Section 11. (EnterNotify, LeaveNotify events).</p></div>
<div class="paragraph"><p>For enter and leave events, the modifier and group state is the state of
the paired master device if the device is a master device, or the state of
the attached master keyboard if the device is an attached slave device, or
zero if the device is a floating slave device.</p></div>
<div class="paragraph"><p>For focus in and out events, the button state is the state of the paired
master device if the device is a master device, or the state of the
attached master keyboard if the device is an attached slave device, or
zero if the device is a floating slave device.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>root
event
child
    The root window, event window, and child window, respectively. See the
    core protocol specification for more detail.
sourceid
    The device that caused the pointer to move.
root_x
root_y
    The pointer coordinates relative to the root window.
event_x
event_y
    The pointer coordinates relative to the event window.
mode
    Normal pointer motion events have mode Normal. Pseudo-motion events
    when a grab activates have mode Grab, and pseudo-motion events when a
    grab deactivates have mode Ungrab. Pseudo-motion events caused by the
    activation or deactivation of a passive enter or focus in grab have mode
    XIPassiveGrabNotify or XIPassiveUngrabNotify.
detail
    Specifies the relation of the event window to the window the pointer
    entered or left. See the core protocol spec for details.
same_screen
    True if the event window is on the same screen as the pointer's root
    window.
focus
    If the event window is the focus window or an inferior of the focus
    window, then focus is True. Otherwise, focus is False. This field is
    unspecified for focus in/out events.
mods
    XKB modifier state before the event occured.
group
    XKB group state before the event.
buttons_len
    The length of buttons in 4 byte units.
buttons
    Button state before the event.</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="events-propertyevent">14.1.6. XIPropertyEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    XIPropertyEvent
        EVENTHEADER
        property:           ATOM
        what:               { PropertyCreated, PropertyDeleted, PropertyModified }
└───</code></pre>
</div></div>
<div class="paragraph"><p>XIPropertyEvents are sent whenever a device property is created, deleted or
modified by a client.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>property
    The property that has been created, deleted, or modified
what
    Specifies what has been changed.</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="events-xi22">14.2. Events introduced in version 2.2</h3>
<div class="sect3">
<h4 id="events-touchownershipevent">14.2.1. TouchOwnershipEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    TouchOwnershipEvent
        EVENTHEADER
        touchid:                    CARD32
        root:                       Window
        event:                      Window
        child:                      Window
        sourceid:                   DEVICEID
        flags:                      SETofTOUCHOWNERSHIPFLAGS
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>TOUCHOWNERSHIPFLAGS:    (none currently defined)</code></pre>
</div></div>
<div class="paragraph"><p>A TouchOwnershipEvent indicates that ownership has changed, and the client
is now the owner of the touch sequence specified by touchid.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>touchid
    The identifier of the touch sequence.
root
event
child
    The root window, event window, and child window, respectively. See the
    core protocol specification for more detail.
sourceid
    The source device that originally generated the event.
flags
    A bitmask of flags for this event.</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="events-xi23">14.3. Events introduced in version 2.3</h3>
<div class="sect3">
<h4 id="events-barrierevent">14.3.1. BarrierEvent</h4>
<div class="literalblock">
<div class="content">
<pre><code>┌───
    BarrierEvent
        EVENTHEADER
        eventid:                    CARD32
        root:                       Window
        event:                      Window
        barrier:                    Barrier
        dtime:                      CARD32
        flags:                      SETofBARRIERFLAGS
        sourceid:                   DEVICEID
        root_x:                     FP1616
        root_y:                     FP1616
        dx:                         FP3232
        dy:                         FP3232
└───</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>BARRIERFLAGS { PointerReleased, DeviceIsGrabbed }</code></pre>
</div></div>
<div class="paragraph"><p>A BarrierEvent indicates interaction between a barrier and a pointer device.
If the event type is BarrierHit, pointer movement has been blocked by a
barrier. If the event type is BarrierLeave, a pointer previously blocked
by a barrier has moved away from that barrier, or has moved
through the blocking barrier following an earlier XIBarrierReleasePointer
request.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>eventid
   The unique event ID for this barrier event sequence.
root
event
    The root window or barrier window, respectively. The barrier window
    is always the drawable specified in in the CreatePointerBarrier request.
barrier
    The barrier blocking pointer movement.
dtime
    The relative time in milliseconds between the last event and this
    event.
flags
    A set of flags that apply to this barrier event
    PointerReleased:
       The pointer has moved through the barrier following a
       XIBarrierReleasePointer request (BarrierLeave only).
    DeviceIsGrabbed:
       The pointer device that generated this event is currently
       grabbed.
sourceid
    The source device that originally generated the event.
root_x
root_y
    The position of the pointer in screen coordinates (16.16 fixed
    point), after being constrained by barrier and/or screen extents.
dx
dy
    The relative movement of the pointer from its previous position to
    the new position if pointer movement were not constrained by this
    barrier.</code></pre>
</div></div>
<div class="paragraph"><p>Root coordinates in barrier events represent the position of the cursor
after confinement by barriers, screens and RandR output extents.</p></div>
<div class="paragraph"><p>Barrier event IDs are provided in the eventid field of barrier events. Its
value is always provided in every barrier event. Event IDs are
represented as unsigned 32-bit values and increase strictly monotonically in
value for each new barrier event sequence, wrapping back to 0 upon reaching
the numerical limit of IDs. The increment between two event IDs is
indeterminate. Clients may not assume that any future barrier constraints
will have specific event IDs. IDs are unique per device per barrier.</p></div>
<div class="paragraph"><p>If a pointer is actively grabbed after a barrier event sequence has
initiated, future barrier events of this sequence continue to use the same
eventid, but all barrier events have the DeviceIsGrabbed flag set. If the
pointer is ungrabbed, future events of this sequence have the same eventid
and the DeviceIsGrabbed flag is unset.</p></div>
<div class="paragraph"><p>The PointerReleased flag may only be set on a BarrierLeave event.
A BarrierLeave(PointerReleased) event is generated when the pointer moves
through the barrier following a XIBarrierReleasePointer request. The time
between the XIBarrierReleasePointer and the BarrierLeave event thus depends
on user input.
A BarrierLeave(PointerReleased) event is also generated if the barrier is
destroyed while pointer movement is constrained by the barrier, or the
master pointer blocked by the barrier is removed. This event
has a dx/dy of 0/0.</p></div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="xi22-usecases">Appendix A: XI 2.2 Use-cases</h2>
<div class="sectionbody">
<div class="paragraph"><p>All use-cases that include the receiving and processing of touch events
require the client to announce XI 2.2 support in the XIQueryVersion request.</p></div>
<div class="sect2">
<h3 id="_client_c_wants_to_process_touch_events_from_a_device_d_on_window_w">Client C wants to process touch events from a device D on window W.</h3>
<div class="ulist"><ul>
<li>
<p>
C calls XISelectEvent for XI_Touch{Begin|Update|End} from D on W.
</p>
</li>
<li>
<p>
C receives TouchBegin whenever a touch sequence starts within W&#8217;s borders.
</p>
</li>
<li>
<p>
C receives TouchUpdate events whenever an axis valuator value changes for a
   touch sequence it received a TouchBegin event for.
</p>
</li>
<li>
<p>
C receives TouchEnd whenever a touch it received a TouchBegin event for
   ceases.
</p>
</li>
</ul></div>
<div class="sect3">
<h4 id="_while_client_i_wants_to_pre_process_touch_events_from_device_d_on_the_parent_window_of_w">While client I wants to pre-process touch events from device D on the parent window  of W.</h4>
<div class="ulist"><ul>
<li>
<p>
C calls XISelectEvent for XI_Touch{Begin|Update|Ownership|End} from D on W.
</p>
</li>
<li>
<p>
I calls XIPassiveGrab for XI_Touch{Begin|Update|Ownership|End} from D on a
   parent window of W.
</p>
</li>
<li>
<p>
I receives TouchBegin whenever a touch begins within window W, as well as a
   TouchOwnership event indicating that it currently owns the touch sequence.
   C receives a TouchBegin event as well, but without TouchOwnership.
</p>
</li>
<li>
<p>
When an axis valuator changes in this touch sequence, both I and C receive a
   TouchUpdate event.  I may process the event to determine if it is going to
   accept or reject the touch, whereas C may perform reversible processing.
</p>
</li>
<li>
<p>
If I decides it is going to claim the touch sequence for its exclusive
   processing, it calls XIAllowEvents with an event mode of XIAcceptTouch; at
   this point, C receives a TouchEnd event, and undoes any processing it has
   already performed due to the touch sequence.  Further TouchUpdate events are
   delivered only to I.
</p>
</li>
<li>
<p>
Alternatively, if I decides it does not want to receive further events
   from this touch sequence, it calls XIAllowEvents with an event mode of
   XIRejectTouch; at this point, I receives a TouchEnd event confirming that it
   has rejected the touch.  C receives a TouchOwnership event confirming that it
   is now the new owner of the touch, and further TouchUpdate events are
   delivered only to C.  As C now owns the touch, it is free to perform
   irreversible processing of the sequence.
</p>
</li>
<li>
<p>
When the touch physically ceases, a TouchEnd event is sent to C.
</p>
</li>
</ul></div>
</div>
<div class="sect3">
<h4 id="_while_client_i_wants_to_process_pointer_events_on_window_w_8217_s_parent_window_y">While client I wants to process pointer events on window W&#8217;s parent, window Y.</h4>
<div class="ulist"><ul>
<li>
<p>
I calls XIPassiveGrab for XI_{ButtonPress,MotionNotify,ButtonRelease} to
   create a synchronous pointer grab from D on Y.
</p>
</li>
<li>
<p>
C calls XISelectEvent for XI_Touch{Begin|Update|Ownership|End} from D on W.
</p>
</li>
<li>
<p>
I receives a ButtonPress event whenever a touch begins within W, and is
   considered the owner of the event.  C receives a TouchBegin event, but does
   not receive a TouchOwnership event.
</p>
</li>
<li>
<p>
When the touchpoint moves, C will receive a TouchUpdate event.  Event
   delivery to I is subject to the synchronous delivery mechanism. The
   emulated motion notify event is queued in the server while the device is
   frozen.
</p>
</li>
<li>
<p>
I may assert ownership by calling XIAllowEvents on Y with any mode other
   than ReplayDevice, which will cause all further events to be sent only to I,
   with a TouchEnd event being sent to C.
</p>
</li>
<li>
<p>
Alternatively, I may reject the touch sequence by calling XIAllowEvents on
   Y with mode ReplayDevice, which will cause no further events from that touch
   to be sent to I, and a TouchOwnership event to be sent to C, with subsequent
   motion events being sent as TouchUpdate events.
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect2">
<h3 id="_driver_drv_provides_touch_support_from_tracked_device_d">Driver DRV provides touch support from tracked device D:</h3>
<div class="ulist"><ul>
<li>
<p>
DRV initializes a TouchClass for the device.
</p>
</li>
<li>
<p>
DRV parses D&#8217;s device protocol and selects one touch sequence to be emulated
   as pointer event.
</p>
</li>
<li>
<p>
DRV calls the respective input driver API with the touch sequence data. The
   touch sequence emulating a pointer has the respective flag set. DRV does not
   submit pointer data for any touchpoint.
</p>
</li>
</ul></div>
</div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated
 2016-03-30 04:17:56 UTC
</div>
</div>
</body>
</html>