This file is indexed.

/usr/share/doc/x11proto-kb-dev/xkbproto.html is in x11proto-kb-dev 1.0.6-2.

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
 4077
 4078
 4079
 4080
 4081
 4082
 4083
 4084
 4085
 4086
 4087
 4088
 4089
 4090
 4091
 4092
 4093
 4094
 4095
 4096
 4097
 4098
 4099
 4100
 4101
 4102
 4103
 4104
 4105
 4106
 4107
 4108
 4109
 4110
 4111
 4112
 4113
 4114
 4115
 4116
 4117
 4118
 4119
 4120
 4121
 4122
 4123
 4124
 4125
 4126
 4127
 4128
 4129
 4130
 4131
 4132
 4133
 4134
 4135
 4136
 4137
 4138
 4139
 4140
 4141
 4142
 4143
 4144
 4145
 4146
 4147
 4148
 4149
 4150
 4151
 4152
 4153
 4154
 4155
 4156
 4157
 4158
 4159
 4160
 4161
 4162
 4163
 4164
 4165
 4166
 4167
 4168
 4169
 4170
 4171
 4172
 4173
 4174
 4175
 4176
 4177
 4178
 4179
 4180
 4181
 4182
 4183
 4184
 4185
 4186
 4187
 4188
 4189
 4190
 4191
 4192
 4193
 4194
 4195
 4196
 4197
 4198
 4199
 4200
 4201
 4202
 4203
 4204
 4205
 4206
 4207
 4208
 4209
 4210
 4211
 4212
 4213
 4214
 4215
 4216
 4217
 4218
 4219
 4220
 4221
 4222
 4223
 4224
 4225
 4226
 4227
 4228
 4229
 4230
 4231
 4232
 4233
 4234
 4235
 4236
 4237
 4238
 4239
 4240
 4241
 4242
 4243
 4244
 4245
 4246
 4247
 4248
 4249
 4250
 4251
 4252
 4253
 4254
 4255
 4256
 4257
 4258
 4259
 4260
 4261
 4262
 4263
 4264
 4265
 4266
 4267
 4268
 4269
 4270
 4271
 4272
 4273
 4274
 4275
 4276
 4277
 4278
 4279
 4280
 4281
 4282
 4283
 4284
 4285
 4286
 4287
 4288
 4289
 4290
 4291
 4292
 4293
 4294
 4295
 4296
 4297
 4298
 4299
 4300
 4301
 4302
 4303
 4304
 4305
 4306
 4307
 4308
 4309
 4310
 4311
 4312
 4313
 4314
 4315
 4316
 4317
 4318
 4319
 4320
 4321
 4322
 4323
 4324
 4325
 4326
 4327
 4328
 4329
 4330
 4331
 4332
 4333
 4334
 4335
 4336
 4337
 4338
 4339
 4340
 4341
 4342
 4343
 4344
 4345
 4346
 4347
 4348
 4349
 4350
 4351
 4352
 4353
 4354
 4355
 4356
 4357
 4358
 4359
 4360
 4361
 4362
 4363
 4364
 4365
 4366
 4367
 4368
 4369
 4370
 4371
 4372
 4373
 4374
 4375
 4376
 4377
 4378
 4379
 4380
 4381
 4382
 4383
 4384
 4385
 4386
 4387
 4388
 4389
 4390
 4391
 4392
 4393
 4394
 4395
 4396
 4397
 4398
 4399
 4400
 4401
 4402
 4403
 4404
 4405
 4406
 4407
 4408
 4409
 4410
 4411
 4412
 4413
 4414
 4415
 4416
 4417
 4418
 4419
 4420
 4421
 4422
 4423
 4424
 4425
 4426
 4427
 4428
 4429
 4430
 4431
 4432
 4433
 4434
 4435
 4436
 4437
 4438
 4439
 4440
 4441
 4442
 4443
 4444
 4445
 4446
 4447
 4448
 4449
 4450
 4451
 4452
 4453
 4454
 4455
 4456
 4457
 4458
 4459
 4460
 4461
 4462
 4463
 4464
 4465
 4466
 4467
 4468
 4469
 4470
 4471
 4472
 4473
 4474
 4475
 4476
 4477
 4478
 4479
 4480
 4481
 4482
 4483
 4484
 4485
 4486
 4487
 4488
 4489
 4490
 4491
 4492
 4493
 4494
 4495
 4496
 4497
 4498
 4499
 4500
 4501
 4502
 4503
 4504
 4505
 4506
 4507
 4508
 4509
 4510
 4511
 4512
 4513
 4514
 4515
 4516
 4517
 4518
 4519
 4520
 4521
 4522
 4523
 4524
 4525
 4526
 4527
 4528
 4529
 4530
 4531
 4532
 4533
 4534
 4535
 4536
 4537
 4538
 4539
 4540
 4541
 4542
 4543
 4544
 4545
 4546
 4547
 4548
 4549
 4550
 4551
 4552
 4553
 4554
 4555
 4556
 4557
 4558
 4559
 4560
 4561
 4562
 4563
 4564
 4565
 4566
 4567
 4568
 4569
 4570
 4571
 4572
 4573
 4574
 4575
 4576
 4577
 4578
 4579
 4580
 4581
 4582
 4583
 4584
 4585
 4586
 4587
 4588
 4589
 4590
 4591
 4592
 4593
 4594
 4595
 4596
 4597
 4598
 4599
 4600
 4601
 4602
 4603
 4604
 4605
 4606
 4607
 4608
 4609
 4610
 4611
 4612
 4613
 4614
 4615
 4616
 4617
 4618
 4619
 4620
 4621
 4622
 4623
 4624
 4625
 4626
 4627
 4628
 4629
 4630
 4631
 4632
 4633
 4634
 4635
 4636
 4637
 4638
 4639
 4640
 4641
 4642
 4643
 4644
 4645
 4646
 4647
 4648
 4649
 4650
 4651
 4652
 4653
 4654
 4655
 4656
 4657
 4658
 4659
 4660
 4661
 4662
 4663
 4664
 4665
 4666
 4667
 4668
 4669
 4670
 4671
 4672
 4673
 4674
 4675
 4676
 4677
 4678
 4679
 4680
 4681
 4682
 4683
 4684
 4685
 4686
 4687
 4688
 4689
 4690
 4691
 4692
 4693
 4694
 4695
 4696
 4697
 4698
 4699
 4700
 4701
 4702
 4703
 4704
 4705
 4706
 4707
 4708
 4709
 4710
 4711
 4712
 4713
 4714
 4715
 4716
 4717
 4718
 4719
 4720
 4721
 4722
 4723
 4724
 4725
 4726
 4727
 4728
 4729
 4730
 4731
 4732
 4733
 4734
 4735
 4736
 4737
 4738
 4739
 4740
 4741
 4742
 4743
 4744
 4745
 4746
 4747
 4748
 4749
 4750
 4751
 4752
 4753
 4754
 4755
 4756
 4757
 4758
 4759
 4760
 4761
 4762
 4763
 4764
 4765
 4766
 4767
 4768
 4769
 4770
 4771
 4772
 4773
 4774
 4775
 4776
 4777
 4778
 4779
 4780
 4781
 4782
 4783
 4784
 4785
 4786
 4787
 4788
 4789
 4790
 4791
 4792
 4793
 4794
 4795
 4796
 4797
 4798
 4799
 4800
 4801
 4802
 4803
 4804
 4805
 4806
 4807
 4808
 4809
 4810
 4811
 4812
 4813
 4814
 4815
 4816
 4817
 4818
 4819
 4820
 4821
 4822
 4823
 4824
 4825
 4826
 4827
 4828
 4829
 4830
 4831
 4832
 4833
 4834
 4835
 4836
 4837
 4838
 4839
 4840
 4841
 4842
 4843
 4844
 4845
 4846
 4847
 4848
 4849
 4850
 4851
 4852
 4853
 4854
 4855
 4856
 4857
 4858
 4859
 4860
 4861
 4862
 4863
 4864
 4865
 4866
 4867
 4868
 4869
 4870
 4871
 4872
 4873
 4874
 4875
 4876
 4877
 4878
 4879
 4880
 4881
 4882
 4883
 4884
 4885
 4886
 4887
 4888
 4889
 4890
 4891
 4892
 4893
 4894
 4895
 4896
 4897
 4898
 4899
 4900
 4901
 4902
 4903
 4904
 4905
 4906
 4907
 4908
 4909
 4910
 4911
 4912
 4913
 4914
 4915
 4916
 4917
 4918
 4919
 4920
 4921
 4922
 4923
 4924
 4925
 4926
 4927
 4928
 4929
 4930
 4931
 4932
 4933
 4934
 4935
 4936
 4937
 4938
 4939
 4940
 4941
 4942
 4943
 4944
 4945
 4946
 4947
 4948
 4949
 4950
 4951
 4952
 4953
 4954
 4955
 4956
 4957
 4958
 4959
 4960
 4961
 4962
 4963
 4964
 4965
 4966
 4967
 4968
 4969
 4970
 4971
 4972
 4973
 4974
 4975
 4976
 4977
 4978
 4979
 4980
 4981
 4982
 4983
 4984
 4985
 4986
 4987
 4988
 4989
 4990
 4991
 4992
 4993
 4994
 4995
 4996
 4997
 4998
 4999
 5000
 5001
 5002
 5003
 5004
 5005
 5006
 5007
 5008
 5009
 5010
 5011
 5012
 5013
 5014
 5015
 5016
 5017
 5018
 5019
 5020
 5021
 5022
 5023
 5024
 5025
 5026
 5027
 5028
 5029
 5030
 5031
 5032
 5033
 5034
 5035
 5036
 5037
 5038
 5039
 5040
 5041
 5042
 5043
 5044
 5045
 5046
 5047
 5048
 5049
 5050
 5051
 5052
 5053
 5054
 5055
 5056
 5057
 5058
 5059
 5060
 5061
 5062
 5063
 5064
 5065
 5066
 5067
 5068
 5069
 5070
 5071
 5072
 5073
 5074
 5075
 5076
 5077
 5078
 5079
 5080
 5081
 5082
 5083
 5084
 5085
 5086
 5087
 5088
 5089
 5090
 5091
 5092
 5093
 5094
 5095
 5096
 5097
 5098
 5099
 5100
 5101
 5102
 5103
 5104
 5105
 5106
 5107
 5108
 5109
 5110
 5111
 5112
 5113
 5114
 5115
 5116
 5117
 5118
 5119
 5120
 5121
 5122
 5123
 5124
 5125
 5126
 5127
 5128
 5129
 5130
 5131
 5132
 5133
 5134
 5135
 5136
 5137
 5138
 5139
 5140
 5141
 5142
 5143
 5144
 5145
 5146
 5147
 5148
 5149
 5150
 5151
 5152
 5153
 5154
 5155
 5156
 5157
 5158
 5159
 5160
 5161
 5162
 5163
 5164
 5165
 5166
 5167
 5168
 5169
 5170
 5171
 5172
 5173
 5174
 5175
 5176
 5177
 5178
 5179
 5180
 5181
 5182
 5183
 5184
 5185
 5186
 5187
 5188
 5189
 5190
 5191
 5192
 5193
 5194
 5195
 5196
 5197
 5198
 5199
 5200
 5201
 5202
 5203
 5204
 5205
 5206
 5207
 5208
 5209
 5210
 5211
 5212
 5213
 5214
 5215
 5216
 5217
 5218
 5219
 5220
 5221
 5222
 5223
 5224
 5225
 5226
 5227
 5228
 5229
 5230
 5231
 5232
 5233
 5234
 5235
 5236
 5237
 5238
 5239
 5240
 5241
 5242
 5243
 5244
 5245
 5246
 5247
 5248
 5249
 5250
 5251
 5252
 5253
 5254
 5255
 5256
 5257
 5258
 5259
 5260
 5261
 5262
 5263
 5264
 5265
 5266
 5267
 5268
 5269
 5270
 5271
 5272
 5273
 5274
 5275
 5276
 5277
 5278
 5279
 5280
 5281
 5282
 5283
 5284
 5285
 5286
 5287
 5288
 5289
 5290
 5291
 5292
 5293
 5294
 5295
 5296
 5297
 5298
 5299
 5300
 5301
 5302
 5303
 5304
 5305
 5306
 5307
 5308
 5309
 5310
 5311
 5312
 5313
 5314
 5315
 5316
 5317
 5318
 5319
 5320
 5321
 5322
 5323
 5324
 5325
 5326
 5327
 5328
 5329
 5330
 5331
 5332
 5333
 5334
 5335
 5336
 5337
 5338
 5339
 5340
 5341
 5342
 5343
 5344
 5345
 5346
 5347
 5348
 5349
 5350
 5351
 5352
 5353
 5354
 5355
 5356
 5357
 5358
 5359
 5360
 5361
 5362
 5363
 5364
 5365
 5366
 5367
 5368
 5369
 5370
 5371
 5372
 5373
 5374
 5375
 5376
 5377
 5378
 5379
 5380
 5381
 5382
 5383
 5384
 5385
 5386
 5387
 5388
 5389
 5390
 5391
 5392
 5393
 5394
 5395
 5396
 5397
 5398
 5399
 5400
 5401
 5402
 5403
 5404
 5405
 5406
 5407
 5408
 5409
 5410
 5411
 5412
 5413
 5414
 5415
 5416
 5417
 5418
 5419
 5420
 5421
 5422
 5423
 5424
 5425
 5426
 5427
 5428
 5429
 5430
 5431
 5432
 5433
 5434
 5435
 5436
 5437
 5438
 5439
 5440
 5441
 5442
 5443
 5444
 5445
 5446
 5447
 5448
 5449
 5450
 5451
 5452
 5453
 5454
 5455
 5456
 5457
 5458
 5459
 5460
 5461
 5462
 5463
 5464
 5465
 5466
 5467
 5468
 5469
 5470
 5471
 5472
 5473
 5474
 5475
 5476
 5477
 5478
 5479
 5480
 5481
 5482
 5483
 5484
 5485
 5486
 5487
 5488
 5489
 5490
 5491
 5492
 5493
 5494
 5495
 5496
 5497
 5498
 5499
 5500
 5501
 5502
 5503
 5504
 5505
 5506
 5507
 5508
 5509
 5510
 5511
 5512
 5513
 5514
 5515
 5516
 5517
 5518
 5519
 5520
 5521
 5522
 5523
 5524
 5525
 5526
 5527
 5528
 5529
 5530
 5531
 5532
 5533
 5534
 5535
 5536
 5537
 5538
 5539
 5540
 5541
 5542
 5543
 5544
 5545
 5546
 5547
 5548
 5549
 5550
 5551
 5552
 5553
 5554
 5555
 5556
 5557
 5558
 5559
 5560
 5561
 5562
 5563
 5564
 5565
 5566
 5567
 5568
 5569
 5570
 5571
 5572
 5573
 5574
 5575
 5576
 5577
 5578
 5579
 5580
 5581
 5582
 5583
 5584
 5585
 5586
 5587
 5588
 5589
 5590
 5591
 5592
 5593
 5594
 5595
 5596
 5597
 5598
 5599
 5600
 5601
 5602
 5603
 5604
 5605
 5606
 5607
 5608
 5609
 5610
 5611
 5612
 5613
 5614
 5615
 5616
 5617
 5618
 5619
 5620
 5621
 5622
 5623
 5624
 5625
 5626
 5627
 5628
 5629
 5630
 5631
 5632
 5633
 5634
 5635
 5636
 5637
 5638
 5639
 5640
 5641
 5642
 5643
 5644
 5645
 5646
 5647
 5648
 5649
 5650
 5651
 5652
 5653
 5654
 5655
 5656
 5657
 5658
 5659
 5660
 5661
 5662
 5663
 5664
 5665
 5666
 5667
 5668
 5669
 5670
 5671
 5672
 5673
 5674
 5675
 5676
 5677
 5678
 5679
 5680
 5681
 5682
 5683
 5684
 5685
 5686
 5687
 5688
 5689
 5690
 5691
 5692
 5693
 5694
 5695
 5696
 5697
 5698
 5699
 5700
 5701
 5702
 5703
 5704
 5705
 5706
 5707
 5708
 5709
 5710
 5711
 5712
 5713
 5714
 5715
 5716
 5717
 5718
 5719
 5720
 5721
 5722
 5723
 5724
 5725
 5726
 5727
 5728
 5729
 5730
 5731
 5732
 5733
 5734
 5735
 5736
 5737
 5738
 5739
 5740
 5741
 5742
 5743
 5744
 5745
 5746
 5747
 5748
 5749
 5750
 5751
 5752
 5753
 5754
 5755
 5756
 5757
 5758
 5759
 5760
 5761
 5762
 5763
 5764
 5765
 5766
 5767
 5768
 5769
 5770
 5771
 5772
 5773
 5774
 5775
 5776
 5777
 5778
 5779
 5780
 5781
 5782
 5783
 5784
 5785
 5786
 5787
 5788
 5789
 5790
 5791
 5792
 5793
 5794
 5795
 5796
 5797
 5798
 5799
 5800
 5801
 5802
 5803
 5804
 5805
 5806
 5807
 5808
 5809
 5810
 5811
 5812
 5813
 5814
 5815
 5816
 5817
 5818
 5819
 5820
 5821
 5822
 5823
 5824
 5825
 5826
 5827
 5828
 5829
 5830
 5831
 5832
 5833
 5834
 5835
 5836
 5837
 5838
 5839
 5840
 5841
 5842
 5843
 5844
 5845
 5846
 5847
 5848
 5849
 5850
 5851
 5852
 5853
 5854
 5855
 5856
 5857
 5858
 5859
 5860
 5861
 5862
 5863
 5864
 5865
 5866
 5867
 5868
 5869
 5870
 5871
 5872
 5873
 5874
 5875
 5876
 5877
 5878
 5879
 5880
 5881
 5882
 5883
 5884
 5885
 5886
 5887
 5888
 5889
 5890
 5891
 5892
 5893
 5894
 5895
 5896
 5897
 5898
 5899
 5900
 5901
 5902
 5903
 5904
 5905
 5906
 5907
 5908
 5909
 5910
 5911
 5912
 5913
 5914
 5915
 5916
 5917
 5918
 5919
 5920
 5921
 5922
 5923
 5924
 5925
 5926
 5927
 5928
 5929
 5930
 5931
 5932
 5933
 5934
 5935
 5936
 5937
 5938
 5939
 5940
 5941
 5942
 5943
 5944
 5945
 5946
 5947
 5948
 5949
 5950
 5951
 5952
 5953
 5954
 5955
 5956
 5957
 5958
 5959
 5960
 5961
 5962
 5963
 5964
 5965
 5966
 5967
 5968
 5969
 5970
 5971
 5972
 5973
 5974
 5975
 5976
 5977
 5978
 5979
 5980
 5981
 5982
 5983
 5984
 5985
 5986
 5987
 5988
 5989
 5990
 5991
 5992
 5993
 5994
 5995
 5996
 5997
 5998
 5999
 6000
 6001
 6002
 6003
 6004
 6005
 6006
 6007
 6008
 6009
 6010
 6011
 6012
 6013
 6014
 6015
 6016
 6017
 6018
 6019
 6020
 6021
 6022
 6023
 6024
 6025
 6026
 6027
 6028
 6029
 6030
 6031
 6032
 6033
 6034
 6035
 6036
 6037
 6038
 6039
 6040
 6041
 6042
 6043
 6044
 6045
 6046
 6047
 6048
 6049
 6050
 6051
 6052
 6053
 6054
 6055
 6056
 6057
 6058
 6059
 6060
 6061
 6062
 6063
 6064
 6065
 6066
 6067
 6068
 6069
 6070
 6071
 6072
 6073
 6074
 6075
 6076
 6077
 6078
 6079
 6080
 6081
 6082
 6083
 6084
 6085
 6086
 6087
 6088
 6089
 6090
 6091
 6092
 6093
 6094
 6095
 6096
 6097
 6098
 6099
 6100
 6101
 6102
 6103
 6104
 6105
 6106
 6107
 6108
 6109
 6110
 6111
 6112
 6113
 6114
 6115
 6116
 6117
 6118
 6119
 6120
 6121
 6122
 6123
 6124
 6125
 6126
 6127
 6128
 6129
 6130
 6131
 6132
 6133
 6134
 6135
 6136
 6137
 6138
 6139
 6140
 6141
 6142
 6143
 6144
 6145
 6146
 6147
 6148
 6149
 6150
 6151
 6152
 6153
 6154
 6155
 6156
 6157
 6158
 6159
 6160
 6161
 6162
 6163
 6164
 6165
 6166
 6167
 6168
 6169
 6170
 6171
 6172
 6173
 6174
 6175
 6176
 6177
 6178
 6179
 6180
 6181
 6182
 6183
 6184
 6185
 6186
 6187
 6188
 6189
 6190
 6191
 6192
 6193
 6194
 6195
 6196
 6197
 6198
 6199
 6200
 6201
 6202
 6203
 6204
 6205
 6206
 6207
 6208
 6209
 6210
 6211
 6212
 6213
 6214
 6215
 6216
 6217
 6218
 6219
 6220
 6221
 6222
 6223
 6224
 6225
 6226
 6227
 6228
 6229
 6230
 6231
 6232
 6233
 6234
 6235
 6236
 6237
 6238
 6239
 6240
 6241
 6242
 6243
 6244
 6245
 6246
 6247
 6248
 6249
 6250
 6251
 6252
 6253
 6254
 6255
 6256
 6257
 6258
 6259
 6260
 6261
 6262
 6263
 6264
 6265
 6266
 6267
 6268
 6269
 6270
 6271
 6272
 6273
 6274
 6275
 6276
 6277
 6278
 6279
 6280
 6281
 6282
 6283
 6284
 6285
 6286
 6287
 6288
 6289
 6290
 6291
 6292
 6293
 6294
 6295
 6296
 6297
 6298
 6299
 6300
 6301
 6302
 6303
 6304
 6305
 6306
 6307
 6308
 6309
 6310
 6311
 6312
 6313
 6314
 6315
 6316
 6317
 6318
 6319
 6320
 6321
 6322
 6323
 6324
 6325
 6326
 6327
 6328
 6329
 6330
 6331
 6332
 6333
 6334
 6335
 6336
 6337
 6338
 6339
 6340
 6341
 6342
 6343
 6344
 6345
 6346
 6347
 6348
 6349
 6350
 6351
 6352
 6353
 6354
 6355
 6356
 6357
 6358
 6359
 6360
 6361
 6362
 6363
 6364
 6365
 6366
 6367
 6368
 6369
 6370
 6371
 6372
 6373
 6374
 6375
 6376
 6377
 6378
 6379
 6380
 6381
 6382
 6383
 6384
 6385
 6386
 6387
 6388
 6389
 6390
 6391
 6392
 6393
 6394
 6395
 6396
 6397
 6398
 6399
 6400
 6401
 6402
 6403
 6404
 6405
 6406
 6407
 6408
 6409
 6410
 6411
 6412
 6413
 6414
 6415
 6416
 6417
 6418
 6419
 6420
 6421
 6422
 6423
 6424
 6425
 6426
 6427
 6428
 6429
 6430
 6431
 6432
 6433
 6434
 6435
 6436
 6437
 6438
 6439
 6440
 6441
 6442
 6443
 6444
 6445
 6446
 6447
 6448
 6449
 6450
 6451
 6452
 6453
 6454
 6455
 6456
 6457
 6458
 6459
 6460
 6461
 6462
 6463
 6464
 6465
 6466
 6467
 6468
 6469
 6470
 6471
 6472
 6473
 6474
 6475
 6476
 6477
 6478
 6479
 6480
 6481
 6482
 6483
 6484
 6485
 6486
 6487
 6488
 6489
 6490
 6491
 6492
 6493
 6494
 6495
 6496
 6497
 6498
 6499
 6500
 6501
 6502
 6503
 6504
 6505
 6506
 6507
 6508
 6509
 6510
 6511
 6512
 6513
 6514
 6515
 6516
 6517
 6518
 6519
 6520
 6521
 6522
 6523
 6524
 6525
 6526
 6527
 6528
 6529
 6530
 6531
 6532
 6533
 6534
 6535
 6536
 6537
 6538
 6539
 6540
 6541
 6542
 6543
 6544
 6545
 6546
 6547
 6548
 6549
 6550
 6551
 6552
 6553
 6554
 6555
 6556
 6557
 6558
 6559
 6560
 6561
 6562
 6563
 6564
 6565
 6566
 6567
 6568
 6569
 6570
 6571
 6572
 6573
 6574
 6575
 6576
 6577
 6578
 6579
 6580
 6581
 6582
 6583
 6584
 6585
 6586
 6587
 6588
 6589
 6590
 6591
 6592
 6593
 6594
 6595
 6596
 6597
 6598
 6599
 6600
 6601
 6602
 6603
 6604
 6605
 6606
 6607
 6608
 6609
 6610
 6611
 6612
 6613
 6614
 6615
 6616
 6617
 6618
 6619
 6620
 6621
 6622
 6623
 6624
 6625
 6626
 6627
 6628
 6629
 6630
 6631
 6632
 6633
 6634
 6635
 6636
 6637
 6638
 6639
 6640
 6641
 6642
 6643
 6644
 6645
 6646
 6647
 6648
 6649
 6650
 6651
 6652
 6653
 6654
 6655
 6656
 6657
 6658
 6659
 6660
 6661
 6662
 6663
 6664
 6665
 6666
 6667
 6668
 6669
 6670
 6671
 6672
 6673
 6674
 6675
 6676
 6677
 6678
 6679
 6680
 6681
 6682
 6683
 6684
 6685
 6686
 6687
 6688
 6689
 6690
 6691
 6692
 6693
 6694
 6695
 6696
 6697
 6698
 6699
 6700
 6701
 6702
 6703
 6704
 6705
 6706
 6707
 6708
 6709
 6710
 6711
 6712
 6713
 6714
 6715
 6716
 6717
 6718
 6719
 6720
 6721
 6722
 6723
 6724
 6725
 6726
 6727
 6728
 6729
 6730
 6731
 6732
 6733
 6734
 6735
 6736
 6737
 6738
 6739
 6740
 6741
 6742
 6743
 6744
 6745
 6746
 6747
 6748
 6749
 6750
 6751
 6752
 6753
 6754
 6755
 6756
 6757
 6758
 6759
 6760
 6761
 6762
 6763
 6764
 6765
 6766
 6767
 6768
 6769
 6770
 6771
 6772
 6773
 6774
 6775
 6776
 6777
 6778
 6779
 6780
 6781
 6782
 6783
 6784
 6785
 6786
 6787
 6788
 6789
 6790
 6791
 6792
 6793
 6794
 6795
 6796
 6797
 6798
 6799
 6800
 6801
 6802
 6803
 6804
 6805
 6806
 6807
 6808
 6809
 6810
 6811
 6812
 6813
 6814
 6815
 6816
 6817
 6818
 6819
 6820
 6821
 6822
 6823
 6824
 6825
 6826
 6827
 6828
 6829
 6830
 6831
 6832
 6833
 6834
 6835
 6836
 6837
 6838
 6839
 6840
 6841
 6842
 6843
 6844
 6845
 6846
 6847
 6848
 6849
 6850
 6851
 6852
 6853
 6854
 6855
 6856
 6857
 6858
 6859
 6860
 6861
 6862
 6863
 6864
 6865
 6866
 6867
 6868
 6869
 6870
 6871
 6872
 6873
 6874
 6875
 6876
 6877
 6878
 6879
 6880
 6881
 6882
 6883
 6884
 6885
 6886
 6887
 6888
 6889
 6890
 6891
 6892
 6893
 6894
 6895
 6896
 6897
 6898
 6899
 6900
 6901
 6902
 6903
 6904
 6905
 6906
 6907
 6908
 6909
 6910
 6911
 6912
 6913
 6914
 6915
 6916
 6917
 6918
 6919
 6920
 6921
 6922
 6923
 6924
 6925
 6926
 6927
 6928
 6929
 6930
 6931
 6932
 6933
 6934
 6935
 6936
 6937
 6938
 6939
 6940
 6941
 6942
 6943
 6944
 6945
 6946
 6947
 6948
 6949
 6950
 6951
 6952
 6953
 6954
 6955
 6956
 6957
 6958
 6959
 6960
 6961
 6962
 6963
 6964
 6965
 6966
 6967
 6968
 6969
 6970
 6971
 6972
 6973
 6974
 6975
 6976
 6977
 6978
 6979
 6980
 6981
 6982
 6983
 6984
 6985
 6986
 6987
 6988
 6989
 6990
 6991
 6992
 6993
 6994
 6995
 6996
 6997
 6998
 6999
 7000
 7001
 7002
 7003
 7004
 7005
 7006
 7007
 7008
 7009
 7010
 7011
 7012
 7013
 7014
 7015
 7016
 7017
 7018
 7019
 7020
 7021
 7022
 7023
 7024
 7025
 7026
 7027
 7028
 7029
 7030
 7031
 7032
 7033
 7034
 7035
 7036
 7037
 7038
 7039
 7040
 7041
 7042
 7043
 7044
 7045
 7046
 7047
 7048
 7049
 7050
 7051
 7052
 7053
 7054
 7055
 7056
 7057
 7058
 7059
 7060
 7061
 7062
 7063
 7064
 7065
 7066
 7067
 7068
 7069
 7070
 7071
 7072
 7073
 7074
 7075
 7076
 7077
 7078
 7079
 7080
 7081
 7082
 7083
 7084
 7085
 7086
 7087
 7088
 7089
 7090
 7091
 7092
 7093
 7094
 7095
 7096
 7097
 7098
 7099
 7100
 7101
 7102
 7103
 7104
 7105
 7106
 7107
 7108
 7109
 7110
 7111
 7112
 7113
 7114
 7115
 7116
 7117
 7118
 7119
 7120
 7121
 7122
 7123
 7124
 7125
 7126
 7127
 7128
 7129
 7130
 7131
 7132
 7133
 7134
 7135
 7136
 7137
 7138
 7139
 7140
 7141
 7142
 7143
 7144
 7145
 7146
 7147
 7148
 7149
 7150
 7151
 7152
 7153
 7154
 7155
 7156
 7157
 7158
 7159
 7160
 7161
 7162
 7163
 7164
 7165
 7166
 7167
 7168
 7169
 7170
 7171
 7172
 7173
 7174
 7175
 7176
 7177
 7178
 7179
 7180
 7181
 7182
 7183
 7184
 7185
 7186
 7187
 7188
 7189
 7190
 7191
 7192
 7193
 7194
 7195
 7196
 7197
 7198
 7199
 7200
 7201
 7202
 7203
 7204
 7205
 7206
 7207
 7208
 7209
 7210
 7211
 7212
 7213
 7214
 7215
 7216
 7217
 7218
 7219
 7220
 7221
 7222
 7223
 7224
 7225
 7226
 7227
 7228
 7229
 7230
 7231
 7232
 7233
 7234
 7235
 7236
 7237
 7238
 7239
 7240
 7241
 7242
 7243
 7244
 7245
 7246
 7247
 7248
 7249
 7250
 7251
 7252
 7253
 7254
 7255
 7256
 7257
 7258
 7259
 7260
 7261
 7262
 7263
 7264
 7265
 7266
 7267
 7268
 7269
 7270
 7271
 7272
 7273
 7274
 7275
 7276
 7277
 7278
 7279
 7280
 7281
 7282
 7283
 7284
 7285
 7286
 7287
 7288
 7289
 7290
 7291
 7292
 7293
 7294
 7295
 7296
 7297
 7298
 7299
 7300
 7301
 7302
 7303
 7304
 7305
 7306
 7307
 7308
 7309
 7310
 7311
 7312
 7313
 7314
 7315
 7316
 7317
 7318
 7319
 7320
 7321
 7322
 7323
 7324
 7325
 7326
 7327
 7328
 7329
 7330
 7331
 7332
 7333
 7334
 7335
 7336
 7337
 7338
 7339
 7340
 7341
 7342
 7343
 7344
 7345
 7346
 7347
 7348
 7349
 7350
 7351
 7352
 7353
 7354
 7355
 7356
 7357
 7358
 7359
 7360
 7361
 7362
 7363
 7364
 7365
 7366
 7367
 7368
 7369
 7370
 7371
 7372
 7373
 7374
 7375
 7376
 7377
 7378
 7379
 7380
 7381
 7382
 7383
 7384
 7385
 7386
 7387
 7388
 7389
 7390
 7391
 7392
 7393
 7394
 7395
 7396
 7397
 7398
 7399
 7400
 7401
 7402
 7403
 7404
 7405
 7406
 7407
 7408
 7409
 7410
 7411
 7412
 7413
 7414
 7415
 7416
 7417
 7418
 7419
 7420
 7421
 7422
 7423
 7424
 7425
 7426
 7427
 7428
 7429
 7430
 7431
 7432
 7433
 7434
 7435
 7436
 7437
 7438
 7439
 7440
 7441
 7442
 7443
 7444
 7445
 7446
 7447
 7448
 7449
 7450
 7451
 7452
 7453
 7454
 7455
 7456
 7457
 7458
 7459
 7460
 7461
 7462
 7463
 7464
 7465
 7466
 7467
 7468
 7469
 7470
 7471
 7472
 7473
 7474
 7475
 7476
 7477
 7478
 7479
 7480
 7481
 7482
 7483
 7484
 7485
 7486
 7487
 7488
 7489
 7490
 7491
 7492
 7493
 7494
 7495
 7496
 7497
 7498
 7499
 7500
 7501
 7502
 7503
 7504
 7505
 7506
 7507
 7508
 7509
 7510
 7511
 7512
 7513
 7514
 7515
 7516
 7517
 7518
 7519
 7520
 7521
 7522
 7523
 7524
 7525
 7526
 7527
 7528
 7529
 7530
 7531
 7532
 7533
 7534
 7535
 7536
 7537
 7538
 7539
 7540
 7541
 7542
 7543
 7544
 7545
 7546
 7547
 7548
 7549
 7550
 7551
 7552
 7553
 7554
 7555
 7556
 7557
 7558
 7559
 7560
 7561
 7562
 7563
 7564
 7565
 7566
 7567
 7568
 7569
 7570
 7571
 7572
 7573
 7574
 7575
 7576
 7577
 7578
 7579
 7580
 7581
 7582
 7583
 7584
 7585
 7586
 7587
 7588
 7589
 7590
 7591
 7592
 7593
 7594
 7595
 7596
 7597
 7598
 7599
 7600
 7601
 7602
 7603
 7604
 7605
 7606
 7607
 7608
 7609
 7610
 7611
 7612
 7613
 7614
 7615
 7616
 7617
 7618
 7619
 7620
 7621
 7622
 7623
 7624
 7625
 7626
 7627
 7628
 7629
 7630
 7631
 7632
 7633
 7634
 7635
 7636
 7637
 7638
 7639
 7640
 7641
 7642
 7643
 7644
 7645
 7646
 7647
 7648
 7649
 7650
 7651
 7652
 7653
 7654
 7655
 7656
 7657
 7658
 7659
 7660
 7661
 7662
 7663
 7664
 7665
 7666
 7667
 7668
 7669
 7670
 7671
 7672
 7673
 7674
 7675
 7676
 7677
 7678
 7679
 7680
 7681
 7682
 7683
 7684
 7685
 7686
 7687
 7688
 7689
 7690
 7691
 7692
 7693
 7694
 7695
 7696
 7697
 7698
 7699
 7700
 7701
 7702
 7703
 7704
 7705
 7706
 7707
 7708
 7709
 7710
 7711
 7712
 7713
 7714
 7715
 7716
 7717
 7718
 7719
 7720
 7721
 7722
 7723
 7724
 7725
 7726
 7727
 7728
 7729
 7730
 7731
 7732
 7733
 7734
 7735
 7736
 7737
 7738
 7739
 7740
 7741
 7742
 7743
 7744
 7745
 7746
 7747
 7748
 7749
 7750
 7751
 7752
 7753
 7754
 7755
 7756
 7757
 7758
 7759
 7760
 7761
 7762
 7763
 7764
 7765
 7766
 7767
 7768
 7769
 7770
 7771
 7772
 7773
 7774
 7775
 7776
 7777
 7778
 7779
 7780
 7781
 7782
 7783
 7784
 7785
 7786
 7787
 7788
 7789
 7790
 7791
 7792
 7793
 7794
 7795
 7796
 7797
 7798
 7799
 7800
 7801
 7802
 7803
 7804
 7805
 7806
 7807
 7808
 7809
 7810
 7811
 7812
 7813
 7814
 7815
 7816
 7817
 7818
 7819
 7820
 7821
 7822
 7823
 7824
 7825
 7826
 7827
 7828
 7829
 7830
 7831
 7832
 7833
 7834
 7835
 7836
 7837
 7838
 7839
 7840
 7841
 7842
 7843
 7844
 7845
 7846
 7847
 7848
 7849
 7850
 7851
 7852
 7853
 7854
 7855
 7856
 7857
 7858
 7859
 7860
 7861
 7862
 7863
 7864
 7865
 7866
 7867
 7868
 7869
 7870
 7871
 7872
 7873
 7874
 7875
 7876
 7877
 7878
 7879
 7880
 7881
 7882
 7883
 7884
 7885
 7886
 7887
 7888
 7889
 7890
 7891
 7892
 7893
 7894
 7895
 7896
 7897
 7898
 7899
 7900
 7901
 7902
 7903
 7904
 7905
 7906
 7907
 7908
 7909
 7910
 7911
 7912
 7913
 7914
 7915
 7916
 7917
 7918
 7919
 7920
 7921
 7922
 7923
 7924
 7925
 7926
 7927
 7928
 7929
 7930
 7931
 7932
 7933
 7934
 7935
 7936
 7937
 7938
 7939
 7940
 7941
 7942
 7943
 7944
 7945
 7946
 7947
 7948
 7949
 7950
 7951
 7952
 7953
 7954
 7955
 7956
 7957
 7958
 7959
 7960
 7961
 7962
 7963
 7964
 7965
 7966
 7967
 7968
 7969
 7970
 7971
 7972
 7973
 7974
 7975
 7976
 7977
 7978
 7979
 7980
 7981
 7982
 7983
 7984
 7985
 7986
 7987
 7988
 7989
 7990
 7991
 7992
 7993
 7994
 7995
 7996
 7997
 7998
 7999
 8000
 8001
 8002
 8003
 8004
 8005
 8006
 8007
 8008
 8009
 8010
 8011
 8012
 8013
 8014
 8015
 8016
 8017
 8018
 8019
 8020
 8021
 8022
 8023
 8024
 8025
 8026
 8027
 8028
 8029
 8030
 8031
 8032
 8033
 8034
 8035
 8036
 8037
 8038
 8039
 8040
 8041
 8042
 8043
 8044
 8045
 8046
 8047
 8048
 8049
 8050
 8051
 8052
 8053
 8054
 8055
 8056
 8057
 8058
 8059
 8060
 8061
 8062
 8063
 8064
 8065
 8066
 8067
 8068
 8069
 8070
 8071
 8072
 8073
 8074
 8075
 8076
 8077
 8078
 8079
 8080
 8081
 8082
 8083
 8084
 8085
 8086
 8087
 8088
 8089
 8090
 8091
 8092
 8093
 8094
 8095
 8096
 8097
 8098
 8099
 8100
 8101
 8102
 8103
 8104
 8105
 8106
 8107
 8108
 8109
 8110
 8111
 8112
 8113
 8114
 8115
 8116
 8117
 8118
 8119
 8120
 8121
 8122
 8123
 8124
 8125
 8126
 8127
 8128
 8129
 8130
 8131
 8132
 8133
 8134
 8135
 8136
 8137
 8138
 8139
 8140
 8141
 8142
 8143
 8144
 8145
 8146
 8147
 8148
 8149
 8150
 8151
 8152
 8153
 8154
 8155
 8156
 8157
 8158
 8159
 8160
 8161
 8162
 8163
 8164
 8165
 8166
 8167
 8168
 8169
 8170
 8171
 8172
 8173
 8174
 8175
 8176
 8177
 8178
 8179
 8180
 8181
 8182
 8183
 8184
 8185
 8186
 8187
 8188
 8189
 8190
 8191
 8192
 8193
 8194
 8195
 8196
 8197
 8198
 8199
 8200
 8201
 8202
 8203
 8204
 8205
 8206
 8207
 8208
 8209
 8210
 8211
 8212
 8213
 8214
 8215
 8216
 8217
 8218
 8219
 8220
 8221
 8222
 8223
 8224
 8225
 8226
 8227
 8228
 8229
 8230
 8231
 8232
 8233
 8234
 8235
 8236
 8237
 8238
 8239
 8240
 8241
 8242
 8243
 8244
 8245
 8246
 8247
 8248
 8249
 8250
 8251
 8252
 8253
 8254
 8255
 8256
 8257
 8258
 8259
 8260
 8261
 8262
 8263
 8264
 8265
 8266
 8267
 8268
 8269
 8270
 8271
 8272
 8273
 8274
 8275
 8276
 8277
 8278
 8279
 8280
 8281
 8282
 8283
 8284
 8285
 8286
 8287
 8288
 8289
 8290
 8291
 8292
 8293
 8294
 8295
 8296
 8297
 8298
 8299
 8300
 8301
 8302
 8303
 8304
 8305
 8306
 8307
 8308
 8309
 8310
 8311
 8312
 8313
 8314
 8315
 8316
 8317
 8318
 8319
 8320
 8321
 8322
 8323
 8324
 8325
 8326
 8327
 8328
 8329
 8330
 8331
 8332
 8333
 8334
 8335
 8336
 8337
 8338
 8339
 8340
 8341
 8342
 8343
 8344
 8345
 8346
 8347
 8348
 8349
 8350
 8351
 8352
 8353
 8354
 8355
 8356
 8357
 8358
 8359
 8360
 8361
 8362
 8363
 8364
 8365
 8366
 8367
 8368
 8369
 8370
 8371
 8372
 8373
 8374
 8375
 8376
 8377
 8378
 8379
 8380
 8381
 8382
 8383
 8384
 8385
 8386
 8387
 8388
 8389
 8390
 8391
 8392
 8393
 8394
 8395
 8396
 8397
 8398
 8399
 8400
 8401
 8402
 8403
 8404
 8405
 8406
 8407
 8408
 8409
 8410
 8411
 8412
 8413
 8414
 8415
 8416
 8417
 8418
 8419
 8420
 8421
 8422
 8423
 8424
 8425
 8426
 8427
 8428
 8429
 8430
 8431
 8432
 8433
 8434
 8435
 8436
 8437
 8438
 8439
 8440
 8441
 8442
 8443
 8444
 8445
 8446
 8447
 8448
 8449
 8450
 8451
 8452
 8453
 8454
 8455
 8456
 8457
 8458
 8459
 8460
 8461
 8462
 8463
 8464
 8465
 8466
 8467
 8468
 8469
 8470
 8471
 8472
 8473
 8474
 8475
 8476
 8477
 8478
 8479
 8480
 8481
 8482
 8483
 8484
 8485
 8486
 8487
 8488
 8489
 8490
 8491
 8492
 8493
 8494
 8495
 8496
 8497
 8498
 8499
 8500
 8501
 8502
 8503
 8504
 8505
 8506
 8507
 8508
 8509
 8510
 8511
 8512
 8513
 8514
 8515
 8516
 8517
 8518
 8519
 8520
 8521
 8522
 8523
 8524
 8525
 8526
 8527
 8528
 8529
 8530
 8531
 8532
 8533
 8534
 8535
 8536
 8537
 8538
 8539
 8540
 8541
 8542
 8543
 8544
 8545
 8546
 8547
 8548
 8549
 8550
 8551
 8552
 8553
 8554
 8555
 8556
 8557
 8558
 8559
 8560
 8561
 8562
 8563
 8564
 8565
 8566
 8567
 8568
 8569
 8570
 8571
 8572
 8573
 8574
 8575
 8576
 8577
 8578
 8579
 8580
 8581
 8582
 8583
 8584
 8585
 8586
 8587
 8588
 8589
 8590
 8591
 8592
 8593
 8594
 8595
 8596
 8597
 8598
 8599
 8600
 8601
 8602
 8603
 8604
 8605
 8606
 8607
 8608
 8609
 8610
 8611
 8612
 8613
 8614
 8615
 8616
 8617
 8618
 8619
 8620
 8621
 8622
 8623
 8624
 8625
 8626
 8627
 8628
 8629
 8630
 8631
 8632
 8633
 8634
 8635
 8636
 8637
 8638
 8639
 8640
 8641
 8642
 8643
 8644
 8645
 8646
 8647
 8648
 8649
 8650
 8651
 8652
 8653
 8654
 8655
 8656
 8657
 8658
 8659
 8660
 8661
 8662
 8663
 8664
 8665
 8666
 8667
 8668
 8669
 8670
 8671
 8672
 8673
 8674
 8675
 8676
 8677
 8678
 8679
 8680
 8681
 8682
 8683
 8684
 8685
 8686
 8687
 8688
 8689
 8690
 8691
 8692
 8693
 8694
 8695
 8696
 8697
 8698
 8699
 8700
 8701
 8702
 8703
 8704
 8705
 8706
 8707
 8708
 8709
 8710
 8711
 8712
 8713
 8714
 8715
 8716
 8717
 8718
 8719
 8720
 8721
 8722
 8723
 8724
 8725
 8726
 8727
 8728
 8729
 8730
 8731
 8732
 8733
 8734
 8735
 8736
 8737
 8738
 8739
 8740
 8741
 8742
 8743
 8744
 8745
 8746
 8747
 8748
 8749
 8750
 8751
 8752
 8753
 8754
 8755
 8756
 8757
 8758
 8759
 8760
 8761
 8762
 8763
 8764
 8765
 8766
 8767
 8768
 8769
 8770
 8771
 8772
 8773
 8774
 8775
 8776
 8777
 8778
 8779
 8780
 8781
 8782
 8783
 8784
 8785
 8786
 8787
 8788
 8789
 8790
 8791
 8792
 8793
 8794
 8795
 8796
 8797
 8798
 8799
 8800
 8801
 8802
 8803
 8804
 8805
 8806
 8807
 8808
 8809
 8810
 8811
 8812
 8813
 8814
 8815
 8816
 8817
 8818
 8819
 8820
 8821
 8822
 8823
 8824
 8825
 8826
 8827
 8828
 8829
 8830
 8831
 8832
 8833
 8834
 8835
 8836
 8837
 8838
 8839
 8840
 8841
 8842
 8843
 8844
 8845
 8846
 8847
 8848
 8849
 8850
 8851
 8852
 8853
 8854
 8855
 8856
 8857
 8858
 8859
 8860
 8861
 8862
 8863
 8864
 8865
 8866
 8867
 8868
 8869
 8870
 8871
 8872
 8873
 8874
 8875
 8876
 8877
 8878
 8879
 8880
 8881
 8882
 8883
 8884
 8885
 8886
 8887
 8888
 8889
 8890
 8891
 8892
 8893
 8894
 8895
 8896
 8897
 8898
 8899
 8900
 8901
 8902
 8903
 8904
 8905
 8906
 8907
 8908
 8909
 8910
 8911
 8912
 8913
 8914
 8915
 8916
 8917
 8918
 8919
 8920
 8921
 8922
 8923
 8924
 8925
 8926
 8927
 8928
 8929
 8930
 8931
 8932
 8933
 8934
 8935
 8936
 8937
 8938
 8939
 8940
 8941
 8942
 8943
 8944
 8945
 8946
 8947
 8948
 8949
 8950
 8951
 8952
 8953
 8954
 8955
 8956
 8957
 8958
 8959
 8960
 8961
 8962
 8963
 8964
 8965
 8966
 8967
 8968
 8969
 8970
 8971
 8972
 8973
 8974
 8975
 8976
 8977
 8978
 8979
 8980
 8981
 8982
 8983
 8984
 8985
 8986
 8987
 8988
 8989
 8990
 8991
 8992
 8993
 8994
 8995
 8996
 8997
 8998
 8999
 9000
 9001
 9002
 9003
 9004
 9005
 9006
 9007
 9008
 9009
 9010
 9011
 9012
 9013
 9014
 9015
 9016
 9017
 9018
 9019
 9020
 9021
 9022
 9023
 9024
 9025
 9026
 9027
 9028
 9029
 9030
 9031
 9032
 9033
 9034
 9035
 9036
 9037
 9038
 9039
 9040
 9041
 9042
 9043
 9044
 9045
 9046
 9047
 9048
 9049
 9050
 9051
 9052
 9053
 9054
 9055
 9056
 9057
 9058
 9059
 9060
 9061
 9062
 9063
 9064
 9065
 9066
 9067
 9068
 9069
 9070
 9071
 9072
 9073
 9074
 9075
 9076
 9077
 9078
 9079
 9080
 9081
 9082
 9083
 9084
 9085
 9086
 9087
 9088
 9089
 9090
 9091
 9092
 9093
 9094
 9095
 9096
 9097
 9098
 9099
 9100
 9101
 9102
 9103
 9104
 9105
 9106
 9107
 9108
 9109
 9110
 9111
 9112
 9113
 9114
 9115
 9116
 9117
 9118
 9119
 9120
 9121
 9122
 9123
 9124
 9125
 9126
 9127
 9128
 9129
 9130
 9131
 9132
 9133
 9134
 9135
 9136
 9137
 9138
 9139
 9140
 9141
 9142
 9143
 9144
 9145
 9146
 9147
 9148
 9149
 9150
 9151
 9152
 9153
 9154
 9155
 9156
 9157
 9158
 9159
 9160
 9161
 9162
 9163
 9164
 9165
 9166
 9167
 9168
 9169
 9170
 9171
 9172
 9173
 9174
 9175
 9176
 9177
 9178
 9179
 9180
 9181
 9182
 9183
 9184
 9185
 9186
 9187
 9188
 9189
 9190
 9191
 9192
 9193
 9194
 9195
 9196
 9197
 9198
 9199
 9200
 9201
 9202
 9203
 9204
 9205
 9206
 9207
 9208
 9209
 9210
 9211
 9212
 9213
 9214
 9215
 9216
 9217
 9218
 9219
 9220
 9221
 9222
 9223
 9224
 9225
 9226
 9227
 9228
 9229
 9230
 9231
 9232
 9233
 9234
 9235
 9236
 9237
 9238
 9239
 9240
 9241
 9242
 9243
 9244
 9245
 9246
 9247
 9248
 9249
 9250
 9251
 9252
 9253
 9254
 9255
 9256
 9257
 9258
 9259
 9260
 9261
 9262
 9263
 9264
 9265
 9266
 9267
 9268
 9269
 9270
 9271
 9272
 9273
 9274
 9275
 9276
 9277
 9278
 9279
 9280
 9281
 9282
 9283
 9284
 9285
 9286
 9287
 9288
 9289
 9290
 9291
 9292
 9293
 9294
 9295
 9296
 9297
 9298
 9299
 9300
 9301
 9302
 9303
 9304
 9305
 9306
 9307
 9308
 9309
 9310
 9311
 9312
 9313
 9314
 9315
 9316
 9317
 9318
 9319
 9320
 9321
 9322
 9323
 9324
 9325
 9326
 9327
 9328
 9329
 9330
 9331
 9332
 9333
 9334
 9335
 9336
 9337
 9338
 9339
 9340
 9341
 9342
 9343
 9344
 9345
 9346
 9347
 9348
 9349
 9350
 9351
 9352
 9353
 9354
 9355
 9356
 9357
 9358
 9359
 9360
 9361
 9362
 9363
 9364
 9365
 9366
 9367
 9368
 9369
 9370
 9371
 9372
 9373
 9374
 9375
 9376
 9377
 9378
 9379
 9380
 9381
 9382
 9383
 9384
 9385
 9386
 9387
 9388
 9389
 9390
 9391
 9392
 9393
 9394
 9395
 9396
 9397
 9398
 9399
 9400
 9401
 9402
 9403
 9404
 9405
 9406
 9407
 9408
 9409
 9410
 9411
 9412
 9413
 9414
 9415
 9416
 9417
 9418
 9419
 9420
 9421
 9422
 9423
 9424
 9425
 9426
 9427
 9428
 9429
 9430
 9431
 9432
 9433
 9434
 9435
 9436
 9437
 9438
 9439
 9440
 9441
 9442
 9443
 9444
 9445
 9446
 9447
 9448
 9449
 9450
 9451
 9452
 9453
 9454
 9455
 9456
 9457
 9458
 9459
 9460
 9461
 9462
 9463
 9464
 9465
 9466
 9467
 9468
 9469
 9470
 9471
 9472
 9473
 9474
 9475
 9476
 9477
 9478
 9479
 9480
 9481
 9482
 9483
 9484
 9485
 9486
 9487
 9488
 9489
 9490
 9491
 9492
 9493
 9494
 9495
 9496
 9497
 9498
 9499
 9500
 9501
 9502
 9503
 9504
 9505
 9506
 9507
 9508
 9509
 9510
 9511
 9512
 9513
 9514
 9515
 9516
 9517
 9518
 9519
 9520
 9521
 9522
 9523
 9524
 9525
 9526
 9527
 9528
 9529
 9530
 9531
 9532
 9533
 9534
 9535
 9536
 9537
 9538
 9539
 9540
 9541
 9542
 9543
 9544
 9545
 9546
 9547
 9548
 9549
 9550
 9551
 9552
 9553
 9554
 9555
 9556
 9557
 9558
 9559
 9560
 9561
 9562
 9563
 9564
 9565
 9566
 9567
 9568
 9569
 9570
 9571
 9572
 9573
 9574
 9575
 9576
 9577
 9578
 9579
 9580
 9581
 9582
 9583
 9584
 9585
 9586
 9587
 9588
 9589
 9590
 9591
 9592
 9593
 9594
 9595
 9596
 9597
 9598
 9599
 9600
 9601
 9602
 9603
 9604
 9605
 9606
 9607
 9608
 9609
 9610
 9611
 9612
 9613
 9614
 9615
 9616
 9617
 9618
 9619
 9620
 9621
 9622
 9623
 9624
 9625
 9626
 9627
 9628
 9629
 9630
 9631
 9632
 9633
 9634
 9635
 9636
 9637
 9638
 9639
 9640
 9641
 9642
 9643
 9644
 9645
 9646
 9647
 9648
 9649
 9650
 9651
 9652
 9653
 9654
 9655
 9656
 9657
 9658
 9659
 9660
 9661
 9662
 9663
 9664
 9665
 9666
 9667
 9668
 9669
 9670
 9671
 9672
 9673
 9674
 9675
 9676
 9677
 9678
 9679
 9680
 9681
 9682
 9683
 9684
 9685
 9686
 9687
 9688
 9689
 9690
 9691
 9692
 9693
 9694
 9695
 9696
 9697
 9698
 9699
 9700
 9701
 9702
 9703
 9704
 9705
 9706
 9707
 9708
 9709
 9710
 9711
 9712
 9713
 9714
 9715
 9716
 9717
 9718
 9719
 9720
 9721
 9722
 9723
 9724
 9725
 9726
 9727
 9728
 9729
 9730
 9731
 9732
 9733
 9734
 9735
 9736
 9737
 9738
 9739
 9740
 9741
 9742
 9743
 9744
 9745
 9746
 9747
 9748
 9749
 9750
 9751
 9752
 9753
 9754
 9755
 9756
 9757
 9758
 9759
 9760
 9761
 9762
 9763
 9764
 9765
 9766
 9767
 9768
 9769
 9770
 9771
 9772
 9773
 9774
 9775
 9776
 9777
 9778
 9779
 9780
 9781
 9782
 9783
 9784
 9785
 9786
 9787
 9788
 9789
 9790
 9791
 9792
 9793
 9794
 9795
 9796
 9797
 9798
 9799
 9800
 9801
 9802
 9803
 9804
 9805
 9806
 9807
 9808
 9809
 9810
 9811
 9812
 9813
 9814
 9815
 9816
 9817
 9818
 9819
 9820
 9821
 9822
 9823
 9824
 9825
 9826
 9827
 9828
 9829
 9830
 9831
 9832
 9833
 9834
 9835
 9836
 9837
 9838
 9839
 9840
 9841
 9842
 9843
 9844
 9845
 9846
 9847
 9848
 9849
 9850
 9851
 9852
 9853
 9854
 9855
 9856
 9857
 9858
 9859
 9860
 9861
 9862
 9863
 9864
 9865
 9866
 9867
 9868
 9869
 9870
 9871
 9872
 9873
 9874
 9875
 9876
 9877
 9878
 9879
 9880
 9881
 9882
 9883
 9884
 9885
 9886
 9887
 9888
 9889
 9890
 9891
 9892
 9893
 9894
 9895
 9896
 9897
 9898
 9899
 9900
 9901
 9902
 9903
 9904
 9905
 9906
 9907
 9908
 9909
 9910
 9911
 9912
 9913
 9914
 9915
 9916
 9917
 9918
 9919
 9920
 9921
 9922
 9923
 9924
 9925
 9926
 9927
 9928
 9929
 9930
 9931
 9932
 9933
 9934
 9935
 9936
 9937
 9938
 9939
 9940
 9941
 9942
 9943
 9944
 9945
 9946
 9947
 9948
 9949
 9950
 9951
 9952
 9953
 9954
 9955
 9956
 9957
 9958
 9959
 9960
 9961
 9962
 9963
 9964
 9965
 9966
 9967
 9968
 9969
 9970
 9971
 9972
 9973
 9974
 9975
 9976
 9977
 9978
 9979
 9980
 9981
 9982
 9983
 9984
 9985
 9986
 9987
 9988
 9989
 9990
 9991
 9992
 9993
 9994
 9995
 9996
 9997
 9998
 9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The X Keyboard Extension: Protocol Specification</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><style xmlns="" type="text/css">/*
 * Copyright (c) 2011 Gaetan Nadon
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

/*
 * Shared stylesheet for X.Org documentation translated to HTML format
 * http://www.sagehill.net/docbookxsl/UsingCSS.html
 * http://www.w3schools.com/css/default.asp
 * https://addons.mozilla.org/en-US/firefox/addon/web-developer/developers
 * https://addons.mozilla.org/en-US/firefox/addon/font-finder/
 */

/*
 * The sans-serif fonts are considered more legible on a computer screen
 * http://dry.sailingissues.com/linux-equivalents-verdana-arial.html
 *
 */
body {
  font-family: "Bitstream Vera Sans", "DejaVu Sans", Tahoma, Geneva, Arial, Sans-serif;
  /* In support of using "em" font size unit, the w3c recommended method */
  font-size: 100%;
}

/*
 * Selection: all elements requiring mono spaced fonts.
 *
 * The family names attempt to match the proportionally spaced font
 * family names such that the same font name is used for both.
 * We'd like to use Bitstream, for example, in both proportionally and
 * mono spaced font text.
 */
.command,
.errorcode,
.errorname,
.errortype,
.filename,
.funcsynopsis,
.function,
.parameter,
.programlisting,
.property,
.screen,
.structname,
.symbol,
.synopsis,
.type
{
  font-family:  "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Courier, "Liberation Mono", Monospace;
}

/*
 * Books have a title page, a preface, some chapters and appendices,
 * a glossary, an index and a bibliography, in that order.
 *
 * An Article has no preface and no chapters. It has sections, appendices,
 * a glossary, an index and a bibliography.
 */

/*
 * Selection: book main title and subtitle
 */
div.book>div.titlepage h1.title,
div.book>div.titlepage h2.subtitle {
  text-align: center;
}

/*
 * Selection: article main title and subtitle
 */
div.article>div.titlepage h2.title,
div.article>div.titlepage h3.subtitle,
div.article>div.sect1>div.titlepage h2.title,
div.article>div.section>div.titlepage h2.title {
  text-align: center;
}

/*
 * Selection: various types of authors and collaborators, individuals or corporate
 *
 * These authors are not always contained inside an authorgroup.
 * They can be contained inside a lot of different parent types where they might
 * not be centered.
 * Reducing the margin at the bottom makes a visual separation between authors
 * We specify here the ones on the title page, others may be added based on merit.
 */
div.titlepage .authorgroup,
div.titlepage .author,
div.titlepage .collab,
div.titlepage .corpauthor,
div.titlepage .corpcredit,
div.titlepage .editor,
div.titlepage .othercredit {
  text-align: center;
  margin-bottom: 0.25em;
}

/*
 * Selection: the affiliation of various types of authors and collaborators,
 * individuals or corporate.
 */
div.titlepage .affiliation {
  text-align: center;
}

/*
 * Selection: product release information (X Version 11, Release 7)
 *
 * The releaseinfo element can be contained inside a lot of different parent
 * types where it might not be centered.
 * We specify here the one on the title page, others may be added based on merit.
 */
div.titlepage p.releaseinfo {
  font-weight: bold;
  text-align: center;
}

/*
 * Selection: publishing date
 */
div.titlepage .pubdate {
  text-align: center;
}

/*
 * The legal notices are displayed in smaller sized fonts
 * Justification is only supported in IE and therefore not requested.
 *
 */
.legalnotice {
  font-size: small;
  font-style: italic;
}

/*
 * Selection: book or article main ToC title
 * A paragraph is generated for the title rather than a level 2 heading.
 * We do not want to select chapters sub table of contents, only the main one
 */
div.book>div.toc>p,
div.article>div.toc>p {
  font-size: 1.5em;
  text-align: center;
}

/*
 * Selection: major sections of a book or an article
 *
 * Unlike books, articles do not have a titlepage element for appendix.
 * Using the selector "div.titlepage h2.title" would be too general.
 */
div.book>div.preface>div.titlepage h2.title,
div.book>div.chapter>div.titlepage h2.title,
div.article>div.sect1>div.titlepage h2.title,
div.article>div.section>div.titlepage h2.title,
div.book>div.appendix>div.titlepage h2.title,
div.article>div.appendix h2.title,
div.glossary>div.titlepage h2.title,
div.index>div.titlepage h2.title,
div.bibliography>div.titlepage h2.title {
   /* Add a border top over the major parts, just like printed books */
   /* The Gray color is already used for the ruler over the main ToC. */
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: Gray;
  /* Put some space between the border and the title */
  padding-top: 0.2em;
  text-align: center;
}

/*
 * A Screen is a verbatim environment for displaying text that the user might
 * see on a computer terminal. It is often used to display the results of a command.
 *
 * http://www.css3.info/preview/rounded-border/
 */
.screen {
  background: #e0ffff;
  border-width: 1px;
  border-style: solid;
  border-color: #B0C4DE;
  border-radius: 1.0em;
  /* Browser's vendor properties prior to CSS 3 */
  -moz-border-radius: 1.0em;
  -webkit-border-radius: 1.0em;
  -khtml-border-radius: 1.0em;
  margin-left: 1.0em;
  margin-right: 1.0em;
  padding: 0.5em;
}

/*
 * Emphasis program listings with a light shade of gray similar to what
 * DocBook XSL guide does: http://www.sagehill.net/docbookxsl/ProgramListings.html
 * Found many C API docs on the web using like shades of gray.
 */
.programlisting {
  background: #F4F4F4;
  border-width: 1px;
  border-style: solid;
  border-color: Gray;
  padding: 0.5em;
}

/*
 * Emphasis functions synopsis using a darker shade of gray.
 * Add a border such that it stands out more.
 * Set the padding so the text does not touch the border.
 */
.funcsynopsis, .synopsis {
  background: #e6e6fa;
  border-width: 1px;
  border-style: solid;
  border-color: Gray;
  clear: both;
  margin: 0.5em;
  padding: 0.25em;
}

/*
 * Selection: paragraphs inside synopsis
 *
 * Removes the default browser margin, let the container set the padding.
 * Paragraphs are not always used in synopsis
 */
.funcsynopsis p,
.synopsis p {
  margin: 0;
  padding: 0;
}

/*
 * Selection: variable lists, informal tables and tables
 *
 * Note the parameter name "variablelist.as.table" in xorg-xhtml.xsl
 * A table with rows and columns is constructed inside div.variablelist
 *
 * Set the left margin so it is indented to the right
 * Display informal tables with single line borders
 */
table {
  margin-left: 0.5em;
  border-collapse: collapse;
}

/*
 * Selection: paragraphs inside tables
 *
 * Removes the default browser margin, let the container set the padding.
 * Paragraphs are not always used in tables
 */
td p {
  margin: 0;
  padding: 0;
}

/*
 * Add some space between the left and right column.
 * The vertical alignment helps the reader associate a term
 * with a multi-line definition.
 */
td, th {
  padding-left: 1.0em;
  padding-right: 1.0em;
  vertical-align: top;
}

.warning {
  border: 1px solid red;
  background: #FFFF66;
  padding-left: 0.5em;
}
</style></head><body><div class="book" title="The X Keyboard Extension: Protocol Specification"><div class="titlepage"><div><div><h1 class="title"><a id="xkbproto"></a>The X Keyboard Extension: Protocol Specification</h1></div><div><h2 class="subtitle">X Consortium Standard</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Erik</span> <span class="surname">Fortune</span></h3><div class="affiliation"><span class="orgname">Silicon Graphics, Inc<br /></span></div></div></div><div><p class="releaseinfo">X Version 11, Release 7.6</p></div><div><p class="releaseinfo">Version 1.0</p></div><div><p class="copyright">Copyright © 1995, 1996 X Consortium Inc., Silicon Graphics Inc., Hewlett-Packard Company, Digital Equipment Corporation</p></div><div><div class="legalnotice" title="Legal Notice"><a id="idp3603248"></a><p>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
</p><p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
</p><p>
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p><p>
Except as contained in this notice, the names of the X Consortium, Silicon Graphics Inc., Hewlett-Packard Company, and Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.
</p></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="preface"><a href="#idm57270416">Acknowledgments</a></span></dt><dt><span class="chapter"><a href="#Overview">1. Overview</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Conventions_and_Assumptions">Conventions and Assumptions</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Keyboard_State">2. Keyboard State</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Locking_and_Latching_Modifiers_and_Groups">Locking and Latching Modifiers and Groups</a></span></dt><dt><span class="sect1"><a href="#Fundamental_Components_of_XKB_Keyboard_State">Fundamental Components of XKB Keyboard State</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Computing_Effective_Modifier_and_Group">Computing Effective Modifier and Group</a></span></dt><dt><span class="sect2"><a href="#Computing_A_State_Field_from_an_XKB_State">Computing A State Field from an XKB State</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Derived_Components_of_XKB_Keyboard_State">Derived Components of XKB Keyboard State</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior">Server Internal Modifiers and Ignore Locks Behavior</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Compatibility_Components_of_Keyboard_State">Compatibility Components of Keyboard State</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Virtual_Modifiers">3. Virtual Modifiers</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Modifier_Definitions">Modifier Definitions</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Inactive_Modifier_Definitions">Inactive Modifier Definitions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Virtual_Modifier_Mapping">Virtual Modifier Mapping</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Global_Keyboard_Controls">4. Global Keyboard Controls</a></span></dt><dd><dl><dt><span class="sect1"><a href="#The_RepeatKeys_Control">The RepeatKeys Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_PerKeyRepeat_Control">The PerKeyRepeat Control</a></span></dt><dt><span class="sect2"><a href="#Detectable_Autorepeat">Detectable Autorepeat</a></span></dt></dl></dd><dt><span class="sect1"><a href="#The_SlowKeys_Control">The SlowKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_BounceKeys_Control">The BounceKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_StickyKeys_Control">The StickyKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_MouseKeys_Control">The MouseKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_MouseKeysAccel_Control">The MouseKeysAccel Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Relative_Pointer_Motion">Relative Pointer Motion</a></span></dt><dt><span class="sect2"><a href="#Absolute_Pointer_Motion">Absolute Pointer Motion</a></span></dt></dl></dd><dt><span class="sect1"><a href="#The_AccessXKeys_Control">The AccessXKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_AccessXTimeout_Control">The AccessXTimeout Control</a></span></dt><dt><span class="sect1"><a href="#The_AccessXFeedback_Control">The AccessXFeedback Control</a></span></dt><dt><span class="sect1"><a href="#The_Overlay1_and_Overlay2_Controls">The Overlay1 and Overlay2 Controls</a></span></dt><dt><span class="sect1"><a href="#Boolean_Controls_and_The_EnabledControls_Control">"Boolean" Controls and The EnabledControls Control</a></span></dt><dt><span class="sect1"><a href="#Automatic_Reset_of_Boolean_Controls">Automatic Reset of Boolean Controls</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Key_Event_Processing_Overview">5. Key Event Processing Overview</a></span></dt><dt><span class="chapter"><a href="#Key_Event_Processing_in_the_Server">6. Key Event Processing in the Server</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Applying_Global_Controls">Applying Global Controls</a></span></dt><dt><span class="sect1"><a href="#Key_Behavior">Key Behavior</a></span></dt><dt><span class="sect1"><a href="#Key_Actions">Key Actions</a></span></dt><dt><span class="sect1"><a href="#Delivering_a_Key_or_Button_Event_to_a_Client">Delivering a Key or Button Event to a Client</a></span></dt><dd><dl><dt><span class="sect2"><a href="#XKB_Interactions_With_Core_Protocol_Grabs">XKB Interactions With Core Protocol Grabs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Key_Event_Processing_in_the_Client">7. Key Event Processing in the Client</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Notation_and_Terminology">Notation and Terminology</a></span></dt><dt><span class="sect1"><a href="#Determining_the_KeySym_Associated_with_a_Key_Event">Determining the KeySym Associated with a Key Event</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Key_Types">Key Types</a></span></dt><dt><span class="sect2"><a href="#Key_Symbol_Map">Key Symbol Map</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Transforming_the_KeySym_Associated_with_a_Key_Event">Transforming the KeySym Associated with a Key Event</a></span></dt><dt><span class="sect1"><a href="#Client_Map_Example">Client Map Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Symbolic_Names">8. Symbolic Names</a></span></dt><dt><span class="chapter"><a href="#Keyboard_Indicators">9. Keyboard Indicators</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Global_Information_About_Indicators">Global Information About Indicators</a></span></dt><dt><span class="sect1"><a href="#Per_Indicator_Information">Per-Indicator Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Indicator_Maps">Indicator Maps</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Keyboard_Bells">10. Keyboard Bells</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Client_Notification_of_Bells">Client Notification of Bells</a></span></dt><dt><span class="sect1"><a href="#Disabling_Server_Generated_Bells">Disabling Server Generated Bells</a></span></dt><dt><span class="sect1"><a href="#Generating_Named_Bells">Generating Named Bells</a></span></dt><dt><span class="sect1"><a href="#Generating_Optional_Named_Bells">Generating Optional Named Bells</a></span></dt><dt><span class="sect1"><a href="#Forcing_a_Server_Generated_Bell">Forcing a Server Generated Bell</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Keyboard_Geometry">11. Keyboard Geometry</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Shapes_and_Outlines">Shapes and Outlines</a></span></dt><dt><span class="sect1"><a href="#Sections">Sections</a></span></dt><dt><span class="sect1"><a href="#Doodads">Doodads</a></span></dt><dt><span class="sect1"><a href="#Keyboard_Geometry_Example">Keyboard Geometry Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Interactions_Between_XKB_and_the_Core_Protocol">12. Interactions Between XKB and the Core Protocol</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Group_Compatibility_Map">Group Compatibility Map</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Setting_a_Passive_Grab_for_an_XKB_State">Setting a Passive Grab for an XKB State</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Changing_the_Keyboard_Mapping_Using_the_Core_Protocol">Changing the Keyboard Mapping Using the Core Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Explicit_Keyboard_Mapping_Components">Explicit Keyboard Mapping Components</a></span></dt><dt><span class="sect2"><a href="#Assigning_Symbols_To_Groups">Assigning Symbols To Groups</a></span></dt><dt><span class="sect2"><a href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key">Assigning Types To Groups of Symbols for a Key</a></span></dt><dt><span class="sect2"><a href="#Assigning_Actions_To_Keys">Assigning Actions To Keys</a></span></dt><dt><span class="sect2"><a href="#Updating_Everything_Else">Updating Everything Else</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Effects_of_XKB_on_Core_Protocol_Events">Effects of XKB on Core Protocol Events</a></span></dt><dt><span class="sect1"><a href="#Effect_of_XKB_on_Core_Protocol_Requests">Effect of XKB on Core Protocol Requests</a></span></dt><dt><span class="sect1"><a href="#Sending_Events_to_Clients">Sending Events to Clients</a></span></dt></dl></dd><dt><span class="chapter"><a href="#The_Server_Database_of_Keyboard_Components">13. The Server Database of Keyboard Components</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Component_Names">Component Names</a></span></dt><dt><span class="sect1"><a href="#Partial_Components_and_Combining_Multiple_Components">Partial Components and Combining Multiple Components</a></span></dt><dt><span class="sect1"><a href="#Component_Hints">Component Hints</a></span></dt><dt><span class="sect1"><a href="#Keyboard_Components">Keyboard Components</a></span></dt><dt><span class="sect1"><a href="#The_Keycodes_Component">The Keycodes Component</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_Types_Component">The Types Component</a></span></dt><dt><span class="sect2"><a href="#The_Compatibility_Map_Component">The Compatibility Map Component</a></span></dt><dt><span class="sect2"><a href="#The_Symbols_Component">The Symbols Component</a></span></dt><dt><span class="sect2"><a href="#The_Geometry_Component">The Geometry Component</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Complete_Keymaps">Complete Keymaps</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Replacing_the_Keyboard_On_the_Fly">14. Replacing the Keyboard "On-the-Fly"</a></span></dt><dt><span class="chapter"><a href="#Interactions_Between_XKB_and_the_X_Input_Extension">15. Interactions Between XKB and the X Input Extension</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Using_XKB_Functions_with_Input_Extension_Keyboards">Using XKB Functions with Input Extension Keyboards</a></span></dt><dt><span class="sect1"><a href="#Pointer_and_Device_Button_Actions">Pointer and Device Button Actions</a></span></dt><dt><span class="sect1"><a href="#Indicator_Maps_for_Extension_Devices">Indicator Maps for Extension Devices</a></span></dt><dt><span class="sect1"><a href="#Indicator_Names_for_Extension_Devices">Indicator Names for Extension Devices</a></span></dt></dl></dd><dt><span class="chapter"><a href="#XKB_Protocol_Requests">16. XKB Protocol Requests</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Errors">Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Keyboard_Errors">Keyboard Errors</a></span></dt><dt><span class="sect2"><a href="#Side_Effects_of_Errors">Side-Effects of Errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Common_Types">Common Types</a></span></dt><dt><span class="sect1"><a href="#Requests">Requests</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Initializing_the_X_Keyboard_Extension">Initializing the X Keyboard Extension</a></span></dt><dt><span class="sect2"><a href="#Selecting_Events">Selecting Events</a></span></dt><dt><span class="sect2"><a href="#Generating_Named_Keyboard_Bells">Generating Named Keyboard Bells</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Keyboard_State">Querying and Changing Keyboard State</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Keyboard_Controls">Querying and Changing Keyboard Controls</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_the_Keyboard_Mapping">Querying and Changing the Keyboard Mapping</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_the_Compatibility_Map">Querying and Changing the Compatibility Map</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Indicators">Querying and Changing Indicators</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Symbolic_Names">Querying and Changing Symbolic Names</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Keyboard_Geometry">Querying and Changing Keyboard Geometry</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Per_Client_Flags">Querying and Changing Per-Client Flags</a></span></dt><dt><span class="sect2"><a href="#Using_the_Servers_Database_of_Keyboard_Components">Using the Server’s Database of Keyboard Components</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Input_Extension_Devices">Querying and Changing Input Extension Devices</a></span></dt><dt><span class="sect2"><a href="#Debugging_the_X_Keyboard_Extension">Debugging the X Keyboard Extension</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Events">Events</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Tracking_Keyboard_Replacement">Tracking Keyboard Replacement</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Mapping_Changes">Tracking Keyboard Mapping Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_State_Changes">Tracking Keyboard State Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Control_Changes">Tracking Keyboard Control Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Indicator_State_Changes">Tracking Keyboard Indicator State Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Indicator_Map_Changes">Tracking Keyboard Indicator Map Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Name_Changes">Tracking Keyboard Name Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Compatibility_Map_Changes">Tracking Compatibility Map Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Application_Bell_Requests">Tracking Application Bell Requests</a></span></dt><dt><span class="sect2"><a href="#Tracking_Messages_Generated_by_Key_Actions">Tracking Messages Generated by Key Actions</a></span></dt><dt><span class="sect2"><a href="#Tracking_Changes_to_AccessX_State_and_Keys">Tracking Changes to AccessX State and Keys</a></span></dt><dt><span class="sect2"><a href="#Tracking_Changes_To_Extension_Devices">Tracking Changes To Extension Devices</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="#default_symbol_transformations">A. Default Symbol Transformations</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Interpreting_the_Control_Modifier">Interpreting the Control Modifier</a></span></dt><dt><span class="sect1"><a href="#Interpreting_the_Lock_Modifier">Interpreting the Lock Modifier</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Locale_Sensitive_Capitalization">Locale-Sensitive Capitalization</a></span></dt><dt><span class="sect2"><a href="#Locale_Insensitive_Capitalization">Locale-Insensitive Capitalization</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="#canonical_key_types">B. Canonical Key Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Canonical_Key_Types">Canonical Key Types</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_ONE_LEVEL_Key_Type">The ONE_LEVEL Key Type</a></span></dt><dt><span class="sect2"><a href="#The_TWO_LEVEL_Key_Type">The TWO_LEVEL Key Type</a></span></dt><dt><span class="sect2"><a href="#The_ALPHABETIC_Key_Type">The ALPHABETIC Key Type</a></span></dt><dt><span class="sect2"><a href="#The_KEYPAD_Key_Type">The KEYPAD Key Type</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="#new_keysyms">C. New KeySyms</a></span></dt><dd><dl><dt><span class="sect1"><a href="#New_KeySyms">New KeySyms</a></span></dt><dd><dl><dt><span class="sect2"><a href="#KeySyms_Used_by_the_ISO9995_Standard">KeySyms Used by the ISO9995 Standard</a></span></dt><dt><span class="sect2"><a href="#KeySyms_Used_to_Control_The_Core_Pointer">KeySyms Used to Control The Core Pointer</a></span></dt><dt><span class="sect2"><a href="#KeySyms_Used_to_Change_Keyboard_Controls">KeySyms Used to Change Keyboard Controls</a></span></dt><dt><span class="sect2"><a href="#KeySyms_Used_To_Control_The_Server">KeySyms Used To Control The Server</a></span></dt><dt><span class="sect2"><a href="#KeySyms_for_Non_Spacing_Diacritical_Keys">KeySyms for Non-Spacing Diacritical Keys</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="#protocol_encoding">D. Protocol Encoding</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Syntactic_Conventions">Syntactic Conventions</a></span></dt><dt><span class="sect1"><a href="#appD::Common_Types">Common Types</a></span></dt><dt><span class="sect1"><a href="#appD::Errors">Errors</a></span></dt><dt><span class="sect1"><a href="#appD::Key_Actions">Key Actions</a></span></dt><dt><span class="sect1"><a href="#Key_Behaviors">Key Behaviors</a></span></dt><dt><span class="sect1"><a href="#appD::Requests">Requests</a></span></dt><dt><span class="sect1"><a href="#appD::Events">Events</a></span></dt></dl></dd></dl></div><div class="preface" title="Acknowledgments"><div class="titlepage"><div><div><h2 class="title"><a id="idm57270416"></a>Acknowledgments</h2></div></div></div><p>
I am grateful for all of the comments and suggestions I have received over the years. I could not possibly list everyone who has helped, but a few people have gone well above and beyond the call of duty and simply must be listed here.
</p><p>
My managers here at SGI, Tom Paquin (now at Netscape) and Gianni Mariani were wonderful. Rather than insisting on some relatively quick, specialized proprietary solution to the keyboard problems we were having, both Tom and Gianni understood the importance of solving them in a general way and for the community as a whole. That was a difficult position to take and it was even harder to maintain when the scope of the project expanded beyond anything we imagined was possible. Gianni and Tom were unflagging in their support and their desire to “do the right thing” despite the schedule and budget pressure that intervened from time to time.
</p><p>
Will Walker, at Digital Equipment Corporation, has been a longtime supporter of XKB. His help and input was essential to ensure that the extension as a whole fits and works together well. His focus was AccessX but the entire extension has benefited from his input and hard work. Without his unflagging good cheer and willingness to lend a hand, XKB would not be where it is today.
</p><p>
Matt Landau, at the X Consortium, stood behind XKB during some tough spots in the release and standardization process. Without Matt’s support, XKB would likely not be a standard for a long time to come. When it became clear that we had too much to do for the amount of time we had remaining, Matt did a fantastic job of finding people to help finish the work needed for standardization.
</p><p>
One of those people was George Sachs, at Hewlett-Packard, who jumped in to help out. His help was essential in getting the extension into this release. Another was Donna Converse, who helped figure out how to explain all of this stuff to someone who hadn’t had their head buried in it for years.
</p><p>
Amber Benson and Gary Aitken were simply phenomenal. They jumped into a huge and complicated project with good cheer and unbelievable energy. They were “up to speed” and contributing within days. I stand in awe of the amount that they managed to achieve in such a short time. Thanks to Gary and Amber, the XKB library specification is a work of art and a thousand times easier to use and more useful than it would otherwise be.
</p><p>
I truly cannot express my gratitude to all of you, without whom this would not have been possible.
</p><p>
Erik Fortune
</p><p>
Silicon Graphics, Inc.
</p><p>
5 February 1996
</p></div><div class="chapter" title="Chapter 1. Overview"><div class="titlepage"><div><div><h2 class="title"><a id="Overview"></a>Chapter 1. Overview</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Conventions_and_Assumptions">Conventions and Assumptions</a></span></dt></dl></div><p>
This extension provides a number of new capabilities and controls for
text keyboards.
</p><p>
The core X protocol specifies the ways that the <span class="emphasis"><em>
Shift</em></span>
, <span class="emphasis"><em>
Control</em></span>
 and <span class="emphasis"><em>
Lock</em></span>
 modifiers and the modifiers bound to the <span class="emphasis"><em>
Mode_switch</em></span>
 or <span class="emphasis"><em>
Num_Lock</em></span>
 keysyms interact to generate keysyms and characters. The core protocol also
allows users to specify that a key affects one or more modifiers. This behavior
is simple and fairly flexible, but it has a number of limitations that make it
difficult or impossible to properly support many common varieties of keyboard
behavior. The limitations of core protocol support for keyboards include:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Use of a single, uniform, four-symbol mapping for all keyboard keys
makes it difficult to properly support keyboard overlays, PC-style break keys
or keyboards that comply with ISO9995 or a host of other national and
international standards.
  </p></li><li class="listitem"><p>Use of a modifier to specify a second keyboard group has side-effects
that wreak havoc with client grabs and X toolkit translations and limit us to
two keyboard groups.
  </p></li><li class="listitem"><p>Poorly specified locking key behavior requires X servers to look for a
few "magic" keysyms to determine which keys should lock when pressed. This
leads to incompatibilities between X servers with no way for clients to detect
implementation differences.
  </p></li><li class="listitem"><p>Poorly specified capitalization and control behavior requires
modifications to X library source code to support new character sets or locales
and can lead to incompatibilities between system-wide and X library
capitalization behavior.
  </p></li><li class="listitem"><p>Limited interactions between modifiers specified by the core protocol
make many common keyboard behaviors difficult or impossible to implement. For
example, there is no reliable way to indicate whether or not using shift should
"cancel" the lock modifier.
  </p></li><li class="listitem"><p>The lack of any explicit descriptions for indicators, most modifiers
and other aspects of the keyboard appearance requires clients that wish to
clearly describe the keyboard to a user to resort to a mishmash of prior
knowledge and heuristics.
  </p></li></ul></div><p>
This extension makes it possible to clearly and explicitly specify most aspects
of keyboard behavior on a per-key basis. It adds the notion of a numeric
keyboard group to the global keyboard state and provides mechanisms to more
closely track the logical and physical state of the keyboard. For keyboard
control clients, this extension provides descriptions and symbolic names for
many aspects of keyboard appearance and behavior. It also includes a number of
keyboard controls designed to make keyboards more accessible to people with
movement impairments.
</p><p>
The X Keyboard Extension essentially replaces the core protocol definition of a
keyboard. The following sections describe the new capabilities of the extension
and the effect of the extension on core protocol requests, events and errors.
</p><div class="sect1" title="Conventions and Assumptions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Conventions_and_Assumptions"></a>Conventions and Assumptions</h2></div></div></div><p>
This document uses the syntactic
conventions, common types, and errors defined in sections two through four of
the specification of the X Window System Protocol. This document assumes
familiarity with the fundamental concepts of X, especially those related to the
way that X handles keyboards. Readers who are not familiar with the meaning or
use of keycodes, keysyms or modifiers should consult (at least) the first five
chapters of the protocol specification of the X Window System before
continuing.
</p></div></div><div class="chapter" title="Chapter 2. Keyboard State"><div class="titlepage"><div><div><h2 class="title"><a id="Keyboard_State"></a>Chapter 2. Keyboard State</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Locking_and_Latching_Modifiers_and_Groups">Locking and Latching Modifiers and Groups</a></span></dt><dt><span class="sect1"><a href="#Fundamental_Components_of_XKB_Keyboard_State">Fundamental Components of XKB Keyboard State</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Computing_Effective_Modifier_and_Group">Computing Effective Modifier and Group</a></span></dt><dt><span class="sect2"><a href="#Computing_A_State_Field_from_an_XKB_State">Computing A State Field from an XKB State</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Derived_Components_of_XKB_Keyboard_State">Derived Components of XKB Keyboard State</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior">Server Internal Modifiers and Ignore Locks Behavior</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Compatibility_Components_of_Keyboard_State">Compatibility Components of Keyboard State</a></span></dt></dl></div><p>
The core protocol description of
keyboard state consists of eight <span class="emphasis"><em>
modifiers</em></span>
(<span class="emphasis"><em>
Shift</em></span>
, <span class="emphasis"><em>
Lock</em></span>
, <span class="emphasis"><em>
Control</em></span>
, and <span class="emphasis"><em>
Mod1</em></span>
-<span class="emphasis"><em>
Mod5</em></span>
). A modifier reports the state of one or modifier keys, which are similar to
qualifier keys as defined by the ISO9995 standard:
</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term">Qualifier key</span></p></td><td><p>
A key whose operation
has no immediate effect, but which, for as long as it is held down, modifies
the effect of other keys. A qualifier key may be, for example, a shift key or a
control key.
      </p></td></tr></tbody></table></div><p>
Whenever a modifier key is physically or logically depressed, the modifier it
controls is set in the keyboard state. The protocol implies that certain
modifier keys lock (i.e. affect modifier state after they have been physically
released) but does not explicitly discuss locking keys or their behavior. The
current modifier state is reported to clients in a number of core protocol
events and can be determined using the <span class="emphasis"><em>
QueryPointer</em></span>
 request.
</p><p>
The XKB extension retains the eight "real" modifiers defined by the core
protocol but extends the core protocol notion of <span class="emphasis"><em>
keyboard state</em></span>
 to include up to four <span class="emphasis"><em>
keysym groups</em></span>
, as defined by the ISO9995 standard:
</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term">Group:</span></p></td><td><p>
A logical state of a keyboard providing
access to a collection of characters. A group usually contains a set of
characters which logically belong together and which may be arranged on several
shift levels within that group.
      </p></td></tr></tbody></table></div><p>
For example, keyboard group can be used to select between multiple alphabets on
a single keyboard, or to access less-commonly used symbols within a character
set.
</p><div class="sect1" title="Locking and Latching Modifiers and Groups"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Locking_and_Latching_Modifiers_and_Groups"></a>Locking and Latching Modifiers and Groups</h2></div></div></div><p>
With the core protocol, there is no way to
tell whether a modifier is set due to a lock or because the user is actually
holding down a key; this can make for a clumsy user-interface as locked
modifiers or group state interfere with accelerators and translations.
</p><p>
XKB adds explicit support for locking
and latching modifiers and groups. Locked modifiers or groups apply to all
future key events until they are explicitly changed. Latched modifiers or
groups apply only to the next key event that does not change keyboard state.
</p></div><div class="sect1" title="Fundamental Components of XKB Keyboard State"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Fundamental_Components_of_XKB_Keyboard_State"></a>Fundamental Components of XKB Keyboard State</h2></div></div></div><p>
The fundamental components of XKB keyboard state include:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The locked modifiers and group</p></li><li class="listitem"><p>The latched modifiers and group</p></li><li class="listitem"><p>The base modifiers and group (for which keys are physically or
logically down)
  </p></li><li class="listitem"><p>The effective modifiers and group (the cumulative effect of the base,
locked and latched modifier and group states).
  </p></li><li class="listitem"><p>State of the core pointer buttons.</p></li></ul></div><p>
The latched and locked state of modifiers and groups can be changed in response
to keyboard activity or under application control using the <span class="emphasis"><em>
XkbLatchLockState</em></span>
 request. The base modifier, base group
and pointer button states always reflect the logical state of the keyboard and
pointer and change <span class="emphasis"><em>
only</em></span>
 in response to keyboard or pointer activity.
</p><div class="sect2" title="Computing Effective Modifier and Group"><div class="titlepage"><div><div><h3 class="title"><a id="Computing_Effective_Modifier_and_Group"></a>Computing Effective Modifier and Group</h3></div></div></div><p>
The effective modifiers and group
report the cumulative effects of the base, latched and locked modifiers and
group respectively, and cannot be directly changed. Note that the effective
modifiers and effective group are computed differently.
</p><p>
The effective modifiers are simply the bitwise union of the base, latched and
locked modifiers.
</p><p>
The effective group is the arithmetic sum of the base, latched and locked
groups. The locked and effective keyboard group must fall in the range
<span class="emphasis"><em>
Group1</em></span>
-<span class="emphasis"><em>
Group4</em></span>
, so they are adjusted into range as specified by the global <span class="emphasis"><em>
GroupsWrap </em></span>
control as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
If the <span class="emphasis"><em>
RedirectIntoRange</em></span>
 flag is set, the four least significant
bits of the groups wrap control specify the index of a group to which all
illegal groups correspond. If the specified group is also out of range, all
illegal groups map to <span class="emphasis"><em>
Group1</em></span>.
    </p></li><li class="listitem"><p>
If the <span class="emphasis"><em>
ClampIntoRange</em></span>
 flag is set, out-of-range groups
correspond to the nearest legal group. Effective groups larger than the highest
supported group are mapped to the highest supported group; effective groups
less than <span class="emphasis"><em>
Group1</em></span>
 are mapped to <span class="emphasis"><em>
Group1</em></span>
. For example, a key with two groups of symbols uses <span class="emphasis"><em>
Group2</em></span>
 type and symbols if the global effective group is either <span class="emphasis"><em>
Group3</em></span>
 or <span class="emphasis"><em>
Group4</em></span>.
    </p></li><li class="listitem"><p>
If neither flag is set, group is
wrapped into range using integer modulus. For example, a key with two groups of
symbols for which groups wrap uses <span class="emphasis"><em>
Group1</em></span>
 symbols if the global effective group is <span class="emphasis"><em>
Group3</em></span>
 or <span class="emphasis"><em>
Group2</em></span>
 symbols if the global effective group is <span class="emphasis"><em>
Group4</em></span>.
    </p></li></ul></div><p>
The base and latched keyboard groups are unrestricted eight-bit integer values
and are not affected by the <span class="emphasis"><em>
GroupsWrap</em></span>
 control.
</p></div><div class="sect2" title="Computing A State Field from an XKB State"><div class="titlepage"><div><div><h3 class="title"><a id="Computing_A_State_Field_from_an_XKB_State"></a>Computing A State Field from an XKB State</h3></div></div></div><p>
Many events report the keyboard state
in a single <span class="emphasis"><em>
state</em></span>
 field. Using XKB, a state field combines modifiers, group and the pointer
button state into a single sixteen bit value as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Bits 0 through 7 (the least significant eight bits) of the effective
state comprise a mask of type KEYMASK which reports the state modifiers.
  </p></li><li class="listitem"><p>Bits 8 through 12 comprise a mask of type BUTMASK which reports pointer
button state.
  </p></li><li class="listitem"><p>Bits 13 and 14 are interpreted as a two-bit unsigned numeric value and
report the state keyboard group.
  </p></li><li class="listitem"><p>Bit 15 (the most significant bit) is reserved and must be zero.
  </p></li></ul></div><p>
It is possible to assemble a state field from any of the components of the XKB
keyboard state. For example, the effective keyboard state would be assembled as
described above using the effective keyboard group, the effective keyboard
modifiers and the pointer button state.
</p></div></div><div class="sect1" title="Derived Components of XKB Keyboard State"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Derived_Components_of_XKB_Keyboard_State"></a>Derived Components of XKB Keyboard State</h2></div></div></div><p>
In addition to the fundamental state
components, XKB keeps track of and reports a number of state components which
are derived from the fundamental components but stored and reported separately
to make it easier to track changes in the keyboard state. These derived
components are updated automatically whenever any of the fundamental components
change but cannot be changed directly.
</p><p>
The first pair of derived state components control the way that passive grabs
are activated and the way that modifiers are reported in core protocol events
that report state. The server uses the <span class="emphasis"><em>
ServerInternalModifiers</em></span>
, <span class="emphasis"><em>
IgnoreLocksModifiers</em></span>
 and <span class="emphasis"><em>
IgnoreGroupLock</em></span>
 controls, described in <a class="link" href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior" title="Server Internal Modifiers and Ignore Locks Behavior">Server
Internal Modifiers and Ignore Locks Behavior</a>, to derive these two
states as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The lookup state is the state used to determine the symbols associated
with a key event and consists of the effective state minus any server internal
modifiers.
  </p></li><li class="listitem"><p>The grab state is the state used to decide whether a particular event
triggers a passive grab and consists of the lookup state minus any members of
the ignore locks modifiers that are not either latched or logically depressed.
If the ignore group locks control is set, the grab state does not include the
effects of any locked groups.
  </p></li></ul></div><div class="sect2" title="Server Internal Modifiers and Ignore Locks Behavior"><div class="titlepage"><div><div><h3 class="title"><a id="Server_Internal_Modifiers_and_Ignore_Locks_Behavior"></a>Server Internal Modifiers and Ignore Locks Behavior</h3></div></div></div><p>
The core protocol does not provide any
way to exclude certain modifiers from client events, so there is no way to set
up a modifier which affects only the server.
</p><p>
The modifiers specified in the mask of the <span class="emphasis"><em>
InternalMods</em></span>
 control are not reported in any core
protocol events, are not used to determine grabs and are not used to calculate
compatibility state for XKB-unaware clients. Server internal modifiers affect
only the action applied when a key is pressed.
</p><p>
The core protocol does not provide any way to exclude certain modifiers from
grab calculations, so locking modifiers often have unanticipated and
unfortunate side-effects. XKB provides another mask which can help avoid some
of these problems.
</p><p>
The locked state of the modifiers specified in mask of the <span class="emphasis"><em>
IgnoreLockMods</em></span>
 control is not reported in most core
protocol events and is not used to activate grabs. The only core events which
include the locked state of the modifiers in the ignore locks mask are key
press and release events that do not activate a passive grab and which do not
occur while a grab is active. If the <span class="emphasis"><em>
IgnoreGroupLock</em></span>
 control is set, the locked state of the
keyboard group is not considered when activating passive grabs.
</p><p>
Without XKB, the passive grab set by a translation (e.g. <span class="emphasis"><em>
Alt&lt;KeyPress&gt;space</em></span>
) does not trigger if any modifiers other than those specified by the
translation are set, with the result that many user interface components do not
react when either Num Lock or when the secondary keyboard group are active. The
ignore locks mask and the ignore group locks control make it possible to avoid
this behavior without exhaustively grabbing every possible modifier combination.
</p></div></div><div class="sect1" title="Compatibility Components of Keyboard State"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Compatibility_Components_of_Keyboard_State"></a>Compatibility Components of Keyboard State</h2></div></div></div><p>
The core protocol interpretation of
keyboard modifiers does not include direct support for multiple groups, so XKB
reports the effective keyboard group to XKB-aware clients using some of the
reserved bits in the state field of some core protocol events, as described in
<a class="link" href="#Computing_A_State_Field_from_an_XKB_State" title="Computing A State Field from an XKB State">Computing A State Field from an
XKB State</a>.
</p><p>
This modified state field would not be interpreted correctly by XKB-unaware
clients, so XKB provides a <span class="emphasis"><em>
group compatibility mapping</em></span>
(see <a class="link" href="#Group_Compatibility_Map" title="Group Compatibility Map">Group Compatibility Map</a>) which
remaps the keyboard group into a core modifier mask that has similar effects,
when possible. XKB maintains three compatibility state components that are used
to make non-XKB clients work as well as possible:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
The <span class="emphasis"><em>
compatibility state</em></span>
 corresponds to the effective modifier
and effective group state.
    </p></li><li class="listitem"><p>
The <span class="emphasis"><em>
compatibility lookup state</em></span>
 is the core-protocol equivalent of the
lookup state.
    </p></li><li class="listitem"><p>
The <span class="emphasis"><em>
compatibility grab state</em></span>
 is the nearest core-protocol equivalent
of the grab state.
    </p></li></ul></div><p>
Compatibility states are essentially the corresponding XKB state, but with
keyboard group possibly encoded as one or more modifiers; <a class="link" href="#Group_Compatibility_Map" title="Group Compatibility Map">Group Compatibility Map</a> describes
the group compatibility map, which specifies the modifier(s) that correspond to
each keyboard group.
</p><p>
The compatibility state reported to XKB-unaware
 clients for any given core protocol event
is computed from the modifier state that XKB-capable clients would see for that
same event. For example, if the ignore group locks control is set and group 2
is locked, the modifier bound to <span class="emphasis"><em>
Mode_switch</em></span>
 is not reported in any event except (Device)KeyPress and (Device)KeyRelease
events that do not trigger a passive grab.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Referring to clients as "XKB-capable
 is somewhat misleading in this context.
The sample implementation of XKB invisibly extends the X library to use the
keyboard extension if it is present. This means that most clients can take
advantage of all of XKB without modification, but it also means that the XKB
state can be reported to clients that have not explicitly requested the
keyboard extension. Clients that <span class="emphasis"><em>
directly</em></span>
 interpret the state field of core protocol events or that interpret the keymap
directly may be affected by some of the XKB differences; clients that use
library or toolkit routines to interpret keyboard events automatically use all
of the XKB features.
</p></div><p>
XKB-aware clients can query the keyboard state at any time or request immediate
notification of a change to any of the fundamental or derived components of the
keyboard state.
</p></div></div><div class="chapter" title="Chapter 3. Virtual Modifiers"><div class="titlepage"><div><div><h2 class="title"><a id="Virtual_Modifiers"></a>Chapter 3. Virtual Modifiers</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Modifier_Definitions">Modifier Definitions</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Inactive_Modifier_Definitions">Inactive Modifier Definitions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Virtual_Modifier_Mapping">Virtual Modifier Mapping</a></span></dt></dl></div><p>
The core protocol specifies that
certain keysyms, when bound to modifiers, affect the rules of keycode to keysym
interpretation for all keys; for example, when <span class="emphasis"><em>
Num_Lock</em></span>
 is bound to some modifier, that modifier is used to choose shifted or
unshifted state for the numeric keypad keys. The core protocol does not provide
a convenient way to determine the mapping of modifier bits, in particular
<span class="emphasis"><em>
Mod1</em></span>
 through <span class="emphasis"><em>
Mod5</em></span>
, to keysyms such as <span class="emphasis"><em>
Num_Lock</em></span>
 and <span class="emphasis"><em>
Mode_switch</em></span>
. Clients must retrieve and search the modifier map to determine the keycodes
bound to each modifier, and then retrieve and search the keyboard mapping to
determine the keysyms bound to the keycodes. They must repeat this process for
all modifiers whenever any part of the modifier mapping is changed.
</p><p>
XKB provides a set of sixteen named virtual modifiers, each of which can be
bound to any set of the eight "real" modifiers (<span class="emphasis"><em>
Shift</em></span>
, <span class="emphasis"><em>
Lock</em></span>
, <span class="emphasis"><em>
Control</em></span>
 and <span class="emphasis"><em>
Mod1</em></span>
-<span class="emphasis"><em>
Mod5</em></span>
 as reported in the keyboard state). This makes it easier for applications and
keyboard layout designers to specify to the function a modifier key or data
structure should fulfill without having to worry about which modifier is bound
to a particular keysym.
</p><p>
The use of a single, server-driven mechanism for reporting changes to all data
structures makes it easier for clients to stay synchronized. For example, the
core protocol specifies a special interpretation for the modifier bound to the
<span class="emphasis"><em>
Num_Lock</em></span>
 key. Whenever any keys or modifiers are rebound, every application has to
check the keyboard mapping to make sure that the binding for <span class="emphasis"><em>
Num_Lock</em></span>
 has not changed. If <span class="emphasis"><em>
Num_Lock</em></span>
 is remapped when XKB is in use, the keyboard description is automatically
updated to reflect the new binding, and clients are notified immediately and
explicitly if there is a change they need to consider.
</p><p>
The separation of function from physical modifier bindings also makes it easier
to specify more clearly the intent of a binding. X servers do not all assign
modifiers the same way — for example, <span class="emphasis"><em>
Num_Lock</em></span>
 might be bound to <span class="emphasis"><em>
Mod2</em></span>
 for one vendor and to <span class="emphasis"><em>
Mod4</em></span>
 for another. This makes it cumbersome to automatically remap the keyboard to a
desired configuration without some kind of prior knowledge about the keyboard
layout and bindings. With XKB, applications simply use virtual modifiers to
specify the behavior they want, without regard for the actual physical bindings
in effect.
</p><p>
XKB puts most aspects of the keyboard under user or program control, so it is
even more important to clearly and uniformly refer to modifiers by function.
</p><div class="sect1" title="Modifier Definitions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Modifier_Definitions"></a>Modifier Definitions</h2></div></div></div><p>
Use an <span class="emphasis"><em>
XKB modifier definition</em></span>
 to specify the modifiers affected by any XKB control or data structure. An XKB
modifier definition consists of a set of real modifiers, a set of virtual
modifiers, and an effective mask. The mask is derived from the real and virtual
modifiers and cannot be explicitly changed — it contains all of the real
modifiers specified in the definition <span class="emphasis"><em>
plus</em></span>
 any real modifiers that are bound to the virtual modifiers specified in the
definition. For example, this modifier definition specifies the numeric lock
modifier if the <span class="emphasis"><em>
Num_Lock</em></span>
 keysym is not bound to any real modifier:
</p><pre class="literallayout">
{ real_mods= None, virtual_mods= NumLock, mask= None }
</pre><p>
If we assign <span class="emphasis"><em>
Mod2</em></span>
 to the <span class="emphasis"><em>
Num_Lock</em></span>
 key, the definition changes to:
</p><pre class="literallayout">
{ real_mods= None, virtual_mods= NumLock, mask= Mod2 }
</pre><p>
Using this kind of modifier definition makes it easy to specify the desired
behavior in such a way that XKB can automatically update all of the data
structures that make up a keymap to reflect user or application specified
changes in any one aspect of the keymap.
</p><p>
The use of modifier definitions also makes it possible to unambiguously specify
the reason that a modifier is of interest. On a system for which the <span class="emphasis"><em>
Alt</em></span>
 and <span class="emphasis"><em>
Meta</em></span>
 keysyms are bound to the same modifier, the following definitions behave
identically:
</p><pre class="literallayout">
{ real_mods= None, virtual_mods= Alt, mask= Mod1 }
{ real_mods= None, virtual_mods= Meta, mask= Mod1 }
</pre><p>
If we rebind one of the modifiers, the modifier definitions automatically
reflect the change:
</p><pre class="literallayout">
{ real_mods= None, virtual_mods= Alt, mask= Mod1 }
{ real_mods= None, virtual_mods= Meta, mask= Mod4 }
</pre><p>
Without the level of indirection provided by virtual modifier maps and modifier
definitions, we would have no way to tell which of the two definitions is
concerned with <span class="emphasis"><em>
Alt</em></span>
 and which is concerned with <span class="emphasis"><em>
Meta</em></span>.
</p><div class="sect2" title="Inactive Modifier Definitions"><div class="titlepage"><div><div><h3 class="title"><a id="Inactive_Modifier_Definitions"></a>Inactive Modifier Definitions</h3></div></div></div><p>
Some XKB structures ignore modifier
definitions in which the virtual modifiers are unbound. Consider this
example:
</p><pre class="literallayout">
if ( state matches { Shift } ) Do OneThing;
if ( state matches { Shift+NumLock } ) Do Another;
</pre><p>
If the <span class="emphasis"><em>
NumLock</em></span>
 virtual modifier is not bound to any real modifiers, these effective masks for
these two cases are identical (i.e. they contain only <span class="emphasis"><em>
Shift</em></span>
). When it is essential to distinguish between <span class="emphasis"><em>
OneThing</em></span>
 and Another, XKB considers only those modifier definitions for which all
virtual modifiers are bound.
</p></div></div><div class="sect1" title="Virtual Modifier Mapping"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Virtual_Modifier_Mapping"></a>Virtual Modifier Mapping</h2></div></div></div><p>
XKB maintains a <span class="emphasis"><em>
virtual modifier mapping</em></span>
, which lists the virtual modifiers associated with each key. The real
modifiers bound to a virtual modifier always include all of the modifiers bound
to any of the keys that specify that virtual modifier in their virtual modifier
mapping.
</p><p>
For example, if <span class="emphasis"><em>
Mod3</em></span>
 is bound to the <span class="emphasis"><em>
Num_Lock</em></span>
 key by the core protocol modifier mapping, and the <span class="emphasis"><em>
NumLock</em></span>
 virtual modifier is bound to they <span class="emphasis"><em>
Num_Lock</em></span>
 key by the virtual modifier mapping, <span class="emphasis"><em>
Mod3</em></span>
 is added to the set of modifiers associated with the <span class="emphasis"><em>
NumLock</em></span>
 virtual modifier.
</p><p>
The virtual modifier mapping is normally updated automatically whenever actions
are assigned to keys (see <a class="link" href="#Changing_the_Keyboard_Mapping_Using_the_Core_Protocol" title="Changing the Keyboard Mapping Using the Core Protocol">Changing
the Keyboard Mapping Using the Core Protocol</a> for details) and few
applications should need to change the virtual modifier mapping explicitly.
</p></div></div><div class="chapter" title="Chapter 4. Global Keyboard Controls"><div class="titlepage"><div><div><h2 class="title"><a id="Global_Keyboard_Controls"></a>Chapter 4. Global Keyboard Controls</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#The_RepeatKeys_Control">The RepeatKeys Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_PerKeyRepeat_Control">The PerKeyRepeat Control</a></span></dt><dt><span class="sect2"><a href="#Detectable_Autorepeat">Detectable Autorepeat</a></span></dt></dl></dd><dt><span class="sect1"><a href="#The_SlowKeys_Control">The SlowKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_BounceKeys_Control">The BounceKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_StickyKeys_Control">The StickyKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_MouseKeys_Control">The MouseKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_MouseKeysAccel_Control">The MouseKeysAccel Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Relative_Pointer_Motion">Relative Pointer Motion</a></span></dt><dt><span class="sect2"><a href="#Absolute_Pointer_Motion">Absolute Pointer Motion</a></span></dt></dl></dd><dt><span class="sect1"><a href="#The_AccessXKeys_Control">The AccessXKeys Control</a></span></dt><dt><span class="sect1"><a href="#The_AccessXTimeout_Control">The AccessXTimeout Control</a></span></dt><dt><span class="sect1"><a href="#The_AccessXFeedback_Control">The AccessXFeedback Control</a></span></dt><dt><span class="sect1"><a href="#The_Overlay1_and_Overlay2_Controls">The Overlay1 and Overlay2 Controls</a></span></dt><dt><span class="sect1"><a href="#Boolean_Controls_and_The_EnabledControls_Control">"Boolean" Controls and The EnabledControls Control</a></span></dt><dt><span class="sect1"><a href="#Automatic_Reset_of_Boolean_Controls">Automatic Reset of Boolean Controls</a></span></dt></dl></div><p>
The X Keyboard Extension supports a number of <span class="emphasis"><em>
global key controls</em></span>
, which affect the way that XKB handles the keyboard as a whole. Many of these
controls make the keyboard more accessible to the physically impaired and are
based on the AccessDOS package<sup>[<a id="idp41728" href="#ftn.idp41728" class="footnote">1</a>]</sup>.
</p><div class="sect1" title="The RepeatKeys Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_RepeatKeys_Control"></a>The RepeatKeys Control</h2></div></div></div><p>
The core protocol only allows control over whether or not the entire keyboard
or individual keys should autorepeat when held down. The <span class="emphasis"><em>
RepeatKeys</em></span>
 control extends this capability by adding control over the delay until a key
begins to repeat and the rate at which it repeats. <span class="emphasis"><em>
RepeatKeys</em></span>
 is also coupled with the core autorepeat control; changes to one are always
reflected in the other.
</p><p>
The <span class="emphasis"><em>
RepeatKeys</em></span>
 control has two parameters. The <span class="emphasis"><em>
autorepeat delay</em></span>
 specifies the delay between the initial press of an autorepeating key and the
first generated repeat event in milliseconds. The <span class="emphasis"><em>
autorepeat interval</em></span>
 specifies the delay between all subsequent generated repeat events in
milliseconds.
</p><div class="sect2" title="The PerKeyRepeat Control"><div class="titlepage"><div><div><h3 class="title"><a id="The_PerKeyRepeat_Control"></a>The PerKeyRepeat Control</h3></div></div></div><p>
When <span class="emphasis"><em>
RepeatKeys</em></span>
 are active, the <span class="emphasis"><em>
PerKeyRepeat</em></span>
 control specifies whether or not individual keys should autorepeat when held
down. XKB provides the <span class="emphasis"><em>
PerKeyRepeat</em></span>
 for convenience only, and it always parallels the <span class="emphasis"><em>
auto-repeats</em></span>
 field of the core protocol <span class="emphasis"><em>
GetKeyboardControl</em></span>
 request — changes to one are always reflected in the other.
</p></div><div class="sect2" title="Detectable Autorepeat"><div class="titlepage"><div><div><h3 class="title"><a id="Detectable_Autorepeat"></a>Detectable Autorepeat</h3></div></div></div><p>
The X server usually generates both press and release events whenever an
autorepeating key is held down. If an XKB-aware client enables the <span class="emphasis"><em>
DetectableAutorepeat</em></span>
 per-client option for a keyboard, the server sends that client a key release
event only when the key is <span class="emphasis"><em>
physically</em></span>
 released. For example, holding down a key to generate three characters without
detectable autorepeat yields:
</p><pre class="literallayout">
Press <span class="emphasis"><em>-&gt;</em></span> Release <span class="emphasis"><em>-&gt;</em></span> Press <span class="emphasis"><em>-&gt;</em></span> Release <span class="emphasis"><em>-&gt;</em></span> Press <span class="emphasis"><em>-&gt;</em></span> Release
</pre><p>
If detectable autorepeat is enabled, the client instead receives:
</p><pre class="literallayout">
Press<span class="emphasis"><em>-&gt;</em></span> Press <span class="emphasis"><em>-&gt;</em></span> Press <span class="emphasis"><em>-&gt;</em></span> Release
</pre><p>
Note that only clients that request detectable autorepeat are affected; other
clients continue to receive both press and release events for autorepeating
keys. Also note that support for detectable autorepeat is optional; servers are
not required to support detectable autorepeat, but they must correctly report
whether or not it is supported.
</p><p>
<a class="link" href="#Querying_and_Changing_Per_Client_Flags" title="Querying and Changing Per-Client Flags">Querying and Changing Per-Client
Flags</a> describes the <span class="emphasis"><em>
XkbPerClientFlags</em></span>
 request, which reports or changes values for all of the per-client flags, and
which lists the per-client flags that are supported.
</p></div></div><div class="sect1" title="The SlowKeys Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_SlowKeys_Control"></a>The SlowKeys Control</h2></div></div></div><p>
Some users often bump keys accidentally while moving their hand or typing stick
toward the key they want. Usually, the keys that are bumped accidentally are
hit only for a very short period of time. The <span class="emphasis"><em>
SlowKeys</em></span>
 control helps filter these accidental bumps by telling the server to wait a
specified period, called the <span class="emphasis"><em>
SlowKeys acceptance delay</em></span>
, before delivering key events. If the key is released before this period
elapses, no key events are generated. The user can then bump any number of keys
on their way to the one they want without generating unwanted characters. Once
they have reached the key they want, they can then hold it long enough for
<span class="emphasis"><em>
SlowKeys</em></span>
 to accept it.
</p><p>
The <span class="emphasis"><em>
SlowKeys</em></span>
 control has one parameter; the <span class="emphasis"><em>
slow keys delay</em></span>
 specifies the length of time, in milliseconds, that a key must be held down
before it is accepted.
</p><p>
When <span class="emphasis"><em>
SlowKeys</em></span>
 are active, the X Keyboard Extension reports the initial press, acceptance,
rejection or release of any key to interested clients using <span class="emphasis"><em>
AccessXNotify</em></span>
 events. The <span class="emphasis"><em>
AccessXNotify</em></span>
 event is described in more detail in <a class="link" href="#Events" title="Events">Events</a>.
</p></div><div class="sect1" title="The BounceKeys Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_BounceKeys_Control"></a>The BounceKeys Control</h2></div></div></div><p>
Some people with physical impairments accidentally "bounce" on a key when they
press it. That is, they press it once, then accidentally press it again
immediately. The <span class="emphasis"><em>
BounceKeys</em></span>
 control temporarily disables a key after it has been pressed, effectively
"debouncing" the keyboard.
</p><p>
The <span class="emphasis"><em>
BounceKeys</em></span>
 has a single parameter. The <span class="emphasis"><em>
BounceKeys delay</em></span>
 specifies the period of time, in milliseconds, that the key is disabled after
it is pressed.
</p><p>
When <span class="emphasis"><em>
BounceKeys</em></span>
 are active, the server reports the acceptance or rejection of any key to
interested clients by sending an <span class="emphasis"><em>
AccessXNotify</em></span>
 event. The <span class="emphasis"><em>
AccessXNotify</em></span>
 event is described in more detail in <a class="link" href="#Events" title="Events">Events</a>.
</p></div><div class="sect1" title="The StickyKeys Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_StickyKeys_Control"></a>The StickyKeys Control</h2></div></div></div><p>
Some people find it difficult or impossible to press two keys at once. The
<span class="emphasis"><em>
StickyKeys</em></span>
 control makes it easier for them to type by changing the behavior of the
modifier keys. When <span class="emphasis"><em>
StickyKeys</em></span>
 are enabled, a modifier is latched when the user presses it just once, so the
user can first press a modifier, release it, then press another key. For
example, to get an exclamation point (!) on a PC-style keyboard, the user can
press the <span class="emphasis"><em>
Shift</em></span>
 key, release it, then press the <span class="emphasis"><em>
1</em></span>
 key.
</p><p>
By default, <span class="emphasis"><em>
StickyKeys</em></span>
 also allows users to lock modifier keys without requiring special locking
keys. The user can press a modifier twice in a row to lock it, and then unlock
it by pressing it one more time.
</p><p>
Modifiers are automatically unlatched when the user presses a non-modifier key.
For instance, to enter the sequence <span class="emphasis"><em>
Shift</em></span>
+<span class="emphasis"><em>
Ctrl</em></span>
+<span class="emphasis"><em>
Z</em></span>
 the user could press and release the <span class="emphasis"><em>
Shift</em></span>
 key to latch the <span class="emphasis"><em>
Shift</em></span>
 modifier, then press and release the <span class="emphasis"><em>
Ctrl</em></span>
 key to latch the <span class="emphasis"><em>
Control</em></span>
 modifier — the <span class="emphasis"><em>
Ctrl</em></span>
 key is a modifier key, so pressing it does not unlatch the <span class="emphasis"><em>
Shift</em></span>
 modifier, but leaves both the <span class="emphasis"><em>
Shift</em></span>
 and <span class="emphasis"><em>
Control</em></span>
 modifiers latched, instead. When the user presses the <span class="emphasis"><em>
Z</em></span>
 key, it will be as though the user pressed <span class="emphasis"><em>
Shift</em></span>
+<span class="emphasis"><em>
Ctrl</em></span>
+<span class="emphasis"><em>
Z</em></span>
 simultaneously. The <span class="emphasis"><em>
Z</em></span>
 key is not a modifier key, so the <span class="emphasis"><em>
Shift</em></span>
 and <span class="emphasis"><em>
Control</em></span>
 modifiers are unlatched after the event is generated.
</p><p>
A locked a modifier remains in effect until the user unlocks it. For example,
to enter the sequence ("XKB") on a PC-style keyboard with a typical US/ASCII
layout, the user could press and release the <span class="emphasis"><em>
Shift</em></span>
 key twice to lock the <span class="emphasis"><em>
Shift</em></span>
 modifier. Then, when the user presses the <span class="emphasis"><em>
9</em></span>
, <span class="emphasis"><em></em></span>
, <span class="emphasis"><em>
x</em></span>
, <span class="emphasis"><em>
k</em></span>
, <span class="emphasis"><em>
b</em></span>
, <span class="emphasis"><em></em></span>
, and <span class="emphasis"><em>
0</em></span>
 keys in sequence, it will generate ("XKB"). To unlock the <span class="emphasis"><em>
Shift</em></span>
 modifier, the user can press and release the <span class="emphasis"><em>
Shift</em></span>
 key.
</p><p>
Two option flags modify the behavior of the <span class="emphasis"><em>
StickyKeys</em></span>
 control:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If the <span class="emphasis"><em>
XkbAX_TwoKeys</em></span>
 flag is set, XKB automatically turns <span class="emphasis"><em>
StickyKeys</em></span>
 off if the user presses two or more keys at once. This serves to automatically
disable StickyKeys when a user who does not require sticky keys is using the
keyboard.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
XkbAX_LatchToLock</em></span>
 controls the locking behavior of <span class="emphasis"><em>
StickyKeys</em></span>
; the <span class="emphasis"><em>
StickyKeys</em></span>
 control only locks modifiers as described above if the <span class="emphasis"><em>
XkbAX_LatchToLock</em></span>
 flag is set.
  </p></li></ul></div></div><div class="sect1" title="The MouseKeys Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_MouseKeys_Control"></a>The MouseKeys Control</h2></div></div></div><p>
The <span class="emphasis"><em>
MouseKeys</em></span>
 control lets a user control all the mouse functions from the keyboard. When
<span class="emphasis"><em>
MouseKeys</em></span>
 are enabled, all keys with <span class="emphasis"><em>
MouseKeys</em></span>
 actions bound to them generate core pointer events instead of normal key press
and release events.
</p><p>
The <span class="emphasis"><em>
MouseKeys</em></span>
 control has a single parameter, the <span class="emphasis"><em>
mouse keys default button</em></span>
, which specifies the core pointer button to be used by mouse keys actions that
do not explicitly specify a button.
</p></div><div class="sect1" title="The MouseKeysAccel Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_MouseKeysAccel_Control"></a>The MouseKeysAccel Control</h2></div></div></div><p>
If the <span class="emphasis"><em>
MouseKeysAccel</em></span>
 control is enabled, the effect of a pointer motion action changes as a key is
held down. The <span class="emphasis"><em>
mouse keys delay</em></span>
 specifies the amount of time between the initial key press and the first
repeated motion event. The <span class="emphasis"><em>
mouse keys interval</em></span>
 specifies the amount of time between repeated mouse keys events. The <span class="emphasis"><em>
steps to maximum acceleration</em></span>
 field specifies the total number of events before the key is travelling at
maximum speed. The <span class="emphasis"><em>
maximum acceleration</em></span>
 field specifies the maximum acceleration. The <span class="emphasis"><em>
curve</em></span>
 parameter controls the ramp used to reach maximum acceleration.
</p><p>
When <span class="emphasis"><em>
MouseKeys</em></span>
 are active and a <span class="emphasis"><em>
SA_MovePtr</em></span>
 key action (see <a class="link" href="#Key_Actions" title="Key Actions">Key
Actions</a>) is activated, a pointer motion event is generated immediately.
If <span class="emphasis"><em>
MouseKeysAccel</em></span>
 is enabled and if acceleration is enabled for the key in question, a second
event is generated after <span class="emphasis"><em>
mouse keys delay </em></span>
milliseconds, and additional events are generated every <span class="emphasis"><em>
mouse keys interval</em></span>
 milliseconds for as long as the key is held down.
</p><div class="sect2" title="Relative Pointer Motion"><div class="titlepage"><div><div><h3 class="title"><a id="Relative_Pointer_Motion"></a>Relative Pointer Motion</h3></div></div></div><p>
If the <span class="emphasis"><em>
SA_MovePtr</em></span>
 action specifies relative motion, events are generated as follows: The initial
event always moves the cursor the distance specified in the action; after
<span class="emphasis"><em>
steps to maximum acceleration</em></span>
 events have been generated, all subsequent events move the pointer the
distance specified in the action times the <span class="emphasis"><em>
maximum acceleration.</em></span>
 Events after the first but before maximum acceleration has been achieved are
accelerated according to the formula:
</p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-1.svg"></object></div><p>
Where <span class="emphasis"><em>
action_delta</em></span>
 is the offset specified by the mouse keys action, <span class="emphasis"><em>
max_accel </em></span>
and <span class="emphasis"><em>
steps_to_max</em></span>
 are parameters to the <span class="emphasis"><em>
MouseKeysAccel</em></span>
 ctrl, and the curveFactor is computed using the <span class="emphasis"><em>
MouseKeysAccel</em></span>
 <span class="emphasis"><em>
curve</em></span>
 parameter as follows:
</p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-2.svg"></object></div><p>
With the result that a <span class="emphasis"><em>
curve</em></span>
 of <span class="emphasis"><em>
0</em></span>
 causes the distance moved to increase linearly from <span class="emphasis"><em>
action_delta</em></span>
 to </p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-3.svg"></object></div><p>

, and the minimum legal <span class="emphasis"><em>
curve</em></span>
 of -<span class="emphasis"><em>
1000</em></span>
 causes all events after the first move at <span class="emphasis"><em>
max_accel</em></span>
. A negative <span class="emphasis"><em>
curve</em></span>
 causes an initial sharp increase in acceleration which tapers off, while a
positive curve yields a slower initial increase in acceleration followed by a
sharp increase as the number of pointer events generated by the action
approaches <span class="emphasis"><em>
steps_to_max</em></span>
.
</p></div><div class="sect2" title="Absolute Pointer Motion"><div class="titlepage"><div><div><h3 class="title"><a id="Absolute_Pointer_Motion"></a>Absolute Pointer Motion</h3></div></div></div><p>
If an <span class="emphasis"><em>
SA_MovePtr</em></span>
 action specifies an absolute position for one of the coordinates but still
allows acceleration, all repeated events contain any absolute coordinates
specified in the action.
</p></div></div><div class="sect1" title="The AccessXKeys Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_AccessXKeys_Control"></a>The AccessXKeys Control</h2></div></div></div><p>
If <span class="emphasis"><em>
AccessXKeys</em></span>
 is enabled many controls can also be turned on or off from the keyboard by
entering the following standard key sequences:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Holding down a shift key by itself for eight seconds toggles the
<span class="emphasis"><em>
SlowKeys</em></span>
 control.
  </p></li><li class="listitem"><p>Pressing and releasing a shift key five times in a row without any
intervening key events and with less than 30 seconds delay between consecutive
presses toggles the state of the <span class="emphasis"><em>
StickyKeys</em></span>
 control.
  </p></li><li class="listitem"><p>Simultaneously operating two or more modifier keys deactivates the
<span class="emphasis"><em>
StickyKeys</em></span>
 control.
  </p></li></ul></div><p>
Some of these key sequences optionally generate audible feedback of the change
in state, as described in <a class="link" href="#The_AccessXFeedback_Control" title="The AccessXFeedback Control">The
AccessXFeedback Control</a>, or cause <span class="emphasis"><em>
XkbAccessXNotify</em></span>
 events as described in <a class="link" href="#Events" title="Events">Events</a>.
</p></div><div class="sect1" title="The AccessXTimeout Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_AccessXTimeout_Control"></a>The AccessXTimeout Control</h2></div></div></div><p>
In environments where computers are shared, features such as <span class="emphasis"><em>
SlowKeys</em></span>
 present a problem: if <span class="emphasis"><em>
SlowKeys</em></span>
 is on, the keyboard can appear to be unresponsive because keys have no effect
unless they are held for a certain period of time. To help address this
problem, XKB provides an <span class="emphasis"><em>
AccessXTimeout</em></span>
 control to automatically change the value of any global controls or AccessX
options if the keyboard is idle for a specified period of time.
</p><p>
The AccessXTimeout control has a number of parameters which affect the duration
of the timeout and the features changed when the timeout expires.
</p><p>
The <span class="emphasis"><em>
AccessX Timeout</em></span>
 field specifies the number of seconds the keyboard must be idle before the
global controls and AccessX options are modified. The <span class="emphasis"><em>
AccessX Options Mask</em></span>
 field specifies which values in the <span class="emphasis"><em>
AccessX Options</em></span>
 field are to be changed, and the <span class="emphasis"><em>
AccessX Options Values</em></span>
 field specifies the new values for those options. The <span class="emphasis"><em>
AccessX Controls Mask</em></span>
 field specifies which controls are to be changed in the global set of
<span class="emphasis"><em>
enabled controls</em></span>
, and the <span class="emphasis"><em>
AccessX Controls Values</em></span>
 field specifies the new values for those controls.
</p></div><div class="sect1" title="The AccessXFeedback Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_AccessXFeedback_Control"></a>The AccessXFeedback Control</h2></div></div></div><p>
If <span class="emphasis"><em>
AccessXFeedback</em></span>
 is enabled, special beep-codes indicate changes in keyboard controls (or some
key events when <span class="emphasis"><em>
SlowKeys</em></span>
 or <span class="emphasis"><em>
StickyKeys</em></span>
 are active). Many beep codes sound as multiple tones, but XKB reports a single
<span class="emphasis"><em>
XkbBellNotify</em></span>
 event for the entire sequence of tones.
</p><p>
All feedback tones are governed by the <span class="emphasis"><em>
AudibleBell</em></span>
 control. Individual feedback tones can be explicitly enabled or disabled using
the <span class="emphasis"><em>
accessX options mask</em></span>
 or set to deactivate after an idle period using the <span class="emphasis"><em>
accessX timeout options mask</em></span>
. XKB defines the following feedback tones:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Feedback Name</th><th align="left">Bell Name</th><th align="left">Default Sound</th><th align="left">Indicates</th></tr></thead><tbody><tr><td align="left">FeatureFB</td><td align="left">AX_FeatureOn</td><td align="left">rising tone</td><td align="left">Keyboard control enabled</td></tr><tr><td align="left"> </td><td align="left">AX_FeatureOff</td><td align="left">falling tone</td><td align="left">Keyboard control disabled</td></tr><tr><td align="left"> </td><td align="left">AX_FeatureChange</td><td align="left">two tones</td><td align="left">Several controls changed state</td></tr><tr><td align="left">IndicatorFB</td><td align="left">AX_IndicatorOn</td><td align="left">high tone</td><td align="left">Indicator Lit</td></tr><tr><td align="left"> </td><td align="left">AX_IndicatorOff</td><td align="left">low tone</td><td align="left">Indicator Extinguished</td></tr><tr><td align="left"> </td><td align="left">AX_IndicatorChange</td><td align="left">two high tones</td><td align="left">Several indicators changed state</td></tr><tr><td align="left">SlowWarnFB</td><td align="left">AX_SlowKeysWarning</td><td align="left">three high tones</td><td align="left">Shift key held for four seconds</td></tr><tr><td align="left">SKPressFB</td><td align="left">AX_SlowKeyPress</td><td align="left">single tone</td><td align="left">Key press while <span class="emphasis"><em>
SlowKeys</em></span>
 are on</td></tr><tr><td align="left">SKReleaseFB</td><td align="left">AX_SlowKeyRelease</td><td align="left">single tone</td><td align="left">Key release while <span class="emphasis"><em>
SlowKeys</em></span>
 are on</td></tr><tr><td align="left">SKAcceptFB</td><td align="left">AX_SlowKeyAccept</td><td align="left">single tone</td><td align="left">Key event accepted by <span class="emphasis"><em>
SlowKeys</em></span>
</td></tr><tr><td align="left">SKRejectFB</td><td align="left">AX_SlowKeyReject</td><td align="left">low tone</td><td align="left">Key event rejected by <span class="emphasis"><em>
SlowKeys</em></span>
</td></tr><tr><td align="left">StickyKeysFB</td><td align="left">AX_StickyLatch</td><td align="left">low tone then high tone</td><td align="left">Modifier latched by <span class="emphasis"><em>
StickyKeys</em></span>
</td></tr><tr><td align="left"> </td><td align="left">AX_StickyLock</td><td align="left">high tone</td><td align="left">Modifier locked by <span class="emphasis"><em>
StickyKeys</em></span>
</td></tr><tr><td align="left"> </td><td align="left">AX_StickyUnlock</td><td align="left">low tone</td><td align="left">Modifier unlocked by <span class="emphasis"><em>
StickyKeys</em></span>
</td></tr><tr><td align="left">BKRejectFB</td><td align="left">AX_BounceKeysReject</td><td align="left">low tone</td><td align="left">Key event rejected by <span class="emphasis"><em>
BounceKeys</em></span>
</td></tr></tbody></table></div><p>
Implementations that cannot generate continuous tones may generate multiple
beeps instead of falling and rising tones; for example, they can generate a
high-pitched beep followed by a low-pitched beep instead of a continuous
falling tone.
</p><p>
If the physical keyboard bell is not very capable, attempts to simulate a
continuous tone with multiple bells can sound horrible. Set the <span class="emphasis"><em>
DumbBellFB</em></span>
 AccessX option to inform the server that the keyboard bell is not very capable
and that XKB should use only simple bell combinations. Keyboard capabilities
vary wildly, so the sounds generated for the individual bells when the
<span class="emphasis"><em>
DumbBellFB</em></span>
 option is set are implementation specific.
</p></div><div class="sect1" title="The Overlay1 and Overlay2 Controls"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_Overlay1_and_Overlay2_Controls"></a>The Overlay1 and Overlay2 Controls</h2></div></div></div><p>
A keyboard overlay allows some subset of the keyboard to report alternate
keycodes when the overlay is enabled. For example a keyboard overlay can be
used to simulate a numeric or editing keypad on keyboard that does not actually
have one by generating alternate of keycodes for some keys when the overlay is
enabled. This technique is very common on portable computers and embedded
systems with small keyboards.
</p><p>
XKB includes direct support for two keyboard overlays, using the <span class="emphasis"><em>
Overlay1</em></span>
 and <span class="emphasis"><em>
Overlay2</em></span>
 controls. When <span class="emphasis"><em>
Overlay1</em></span>
 is enabled, all of the keys that are members of the first keyboard overlay
generate an alternate keycode. When <span class="emphasis"><em>
Overlay2</em></span>
 is enabled, all of the keys that are members of the second keyboard overlay
generate an alternate keycode.
</p><p>
To specify the overlay to which a key belongs and the alternate keycode it
should generate when that overlay is enabled, assign it either the <span class="emphasis"><em>
KB_Overlay1</em></span>
 or <span class="emphasis"><em>
KB_Overlay2</em></span>
 key behaviors, as described in <a class="link" href="#Key_Behavior" title="Key Behavior">
Key Behavior</a>.
</p></div><div class="sect1" title="&quot;Boolean&quot; Controls and The EnabledControls Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Boolean_Controls_and_The_EnabledControls_Control"></a>"Boolean" Controls and The EnabledControls Control</h2></div></div></div><p>
All of the controls described above, along with the <span class="emphasis"><em>
AudibleBell</em></span>
 control (described in <a class="link" href="#Disabling_Server_Generated_Bells" title="Disabling Server Generated Bells">Disabling
Server Generated Bells</a>) and the <span class="emphasis"><em>
IgnoreGroupLock</em></span>
 control (described in <a class="link" href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior" title="Server Internal Modifiers and Ignore Locks Behavior">Server
Internal Modifiers and Ignore Locks Behavior</a>) comprise the <span class="emphasis"><em>
boolean controls</em></span>
. In addition to any parameters listed in the descriptions of the individual
controls, the boolean controls can be individually enabled or disabled by
changing the value of the <span class="emphasis"><em>
EnabledControls</em></span>
 control.
</p><p>
The following <span class="emphasis"><em>
non-boolean</em></span>
 controls are always active and cannot be changed using the <span class="emphasis"><em>
EnabledControls</em></span>
 control or specified in any context that accepts only boolean controls:
<span class="emphasis"><em>
GroupsWrap</em></span>
 (<a class="link" href="#Computing_Effective_Modifier_and_Group" title="Computing Effective Modifier and Group">Computing Effective Modifier and
Group</a>), <span class="emphasis"><em>
EnabledControls</em></span>
, <span class="emphasis"><em>
InternalMods</em></span>
 (<a class="link" href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior" title="Server Internal Modifiers and Ignore Locks Behavior">Server Internal Modifiers and
Ignore Locks Behavior</a>), and <span class="emphasis"><em>
IgnoreLockMods</em></span>
 (<a class="link" href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior" title="Server Internal Modifiers and Ignore Locks Behavior">Server Internal Modifiers and
Ignore Locks Behavior</a>) and <span class="emphasis"><em>
PerKeyRepeat</em></span>
 (<a class="link" href="#The_RepeatKeys_Control" title="The RepeatKeys Control">The RepeatKeys Control</a>)
</p></div><div class="sect1" title="Automatic Reset of Boolean Controls"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Automatic_Reset_of_Boolean_Controls"></a>Automatic Reset of Boolean Controls</h2></div></div></div><p>
The <span class="emphasis"><em>
auto-reset controls</em></span>
 are a per-client value which consist of two masks that can contain any of the
boolean controls (see <a class="link" href="#Boolean_Controls_and_The_EnabledControls_Control" title="&quot;Boolean&quot; Controls and The EnabledControls Control">"Boolean"
Controls and The EnabledControls Control</a>). Whenever the client exits
for any reason, any boolean controls specified in the <span class="emphasis"><em>
auto-reset mask</em></span>
 are set to the corresponding value from the <span class="emphasis"><em>
auto-reset values</em></span>
 mask. This makes it possible for clients to "clean up after themselves"
automatically, even if abnormally terminated.
</p><p>
For example, a client that replace the keyboard bell with some other audible
cue might want to turn off the <span class="emphasis"><em>
AudibleBell</em></span>
 control (<a class="link" href="#Disabling_Server_Generated_Bells" title="Disabling Server Generated Bells">Disabling Server
Generated Bells</a>) to prevent the server from also generating a sound and
thus avoid cacophony. If the client were to exit without resetting the
<span class="emphasis"><em>
AudibleBell </em></span>
control, the user would be left without any feedback at all. Setting <span class="emphasis"><em>
AudibleBell</em></span>
 in both the auto-reset mask and auto-reset values guarantees that the audible
bell will be turned back on when the client exits.
</p></div><div class="footnotes"><br /><hr width="100" align="left" /><div class="footnote"><p><sup>[<a id="ftn.idp41728" href="#idp41728" class="para">1</a>] </sup>
AccessDOS provides access to the DOS operating system for people with physical
impairments and was developed by the Trace R&amp;D Center at the University of
Wisconsin. For more information on AccessDOS, contact the Trace R&amp;D Center,
Waisman Center and Department of Industrial Engineering, University of
Wisconsin-Madison WI 53705-2280. Phone: 608-262-6966. e-mail:
info@trace.wisc.edu.</p></div></div></div><div class="chapter" title="Chapter 5. Key Event Processing Overview"><div class="titlepage"><div><div><h2 class="title"><a id="Key_Event_Processing_Overview"></a>Chapter 5. Key Event Processing Overview</h2></div></div></div><p>
There are three steps to processing each key event in the X server, and at
least three in the client. This section describes each of these steps briefly;
the following sections describe each step in more detail.
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>First, the server applies global keyboard controls to determine whether
the key event should be processed immediately, deferred, or ignored. For
example, the <span class="emphasis"><em>
SlowKeys</em></span>
 control can cause a key event to be deferred until the slow keys delay has
elapsed while the <span class="emphasis"><em>
RepeatKeys</em></span>
 control can cause multiple X events from a single physical key press if the
key is held down for an extended period. The global keyboard controls affect
all of the keys on the keyboard and are described in
<a class="link" href="#Global_Keyboard_Controls" title="Chapter 4. Global Keyboard Controls">Global Keyboard Controls</a>.
  </p></li><li class="listitem"><p>Next, the server applies per-key behavior. Per key-behavior can be used
to simulate or indicate some special kinds of key behavior. For example,
keyboard overlays, in which a key generates an alternate keycode under certain
circumstances, can be implemented using per-key behavior. Every key has a
single behavior, so the effect of key behavior does not depend on keyboard
modifier or group state, though it might depend on global keyboard controls.
Per-key behaviors are described in detail in
<a class="link" href="#Key_Behavior" title="Key Behavior">Key Behavior</a>.
  </p></li><li class="listitem"><p>Finally, the server applies key actions. Logically, every keysym on the
keyboard has some action associated with it. The key action tells the server
what to do when an event which yields the corresponding keysym is generated.
Key actions might change or suppress the event, generate some other event, or
change some aspect of the server. Key actions are described in <a class="link" href="#Key_Actions" title="Key Actions">Key Actions</a>.
  </p></li></ol></div><p>
If the global controls, per-key behavior and key action combine to cause a key
event, the client which receives the event processes it in several steps.
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>First the client extracts the effective keyboard group and a set of
modifiers from the state field of the event. See <a class="link" href="#Computing_A_State_Field_from_an_XKB_State" title="Computing A State Field from an XKB State">Computing A State Field from an XKB
State</a> for details.
  </p></li><li class="listitem"><p>Using the modifiers and effective keyboard group, the client selects a
symbol from the list of keysyms bound to the key. <a class="link" href="#Determining_the_KeySym_Associated_with_a_Key_Event" title="Determining the KeySym Associated with a Key Event">Determining the KeySym Associated with a
Key Event</a> discusses symbol selection.
  </p></li><li class="listitem"><p>If necessary, the client transforms the symbol and resulting string
using any modifiers that are "left over" from the process of looking up a
symbol. For example, if the <span class="emphasis"><em>
Lock</em></span>
 modifier is left over, the resulting keysym is capitalized according to the
capitalization rules specified by the system. See
<a class="link" href="#Transforming_the_KeySym_Associated_with_a_Key_Event" title="Transforming the KeySym Associated with a Key Event">
Transforming the KeySym Associated with a
Key Event</a> for a more detailed discussion of the transformations defined
by XKB.
  </p></li><li class="listitem"><p>Finally, the client uses the keysym and remaining modifiers in an
application-specific way. For example, applications based on the X toolkit
might apply translations based on the symbol and modifiers reported by the
first three steps.
  </p></li></ol></div></div><div class="chapter" title="Chapter 6. Key Event Processing in the Server"><div class="titlepage"><div><div><h2 class="title"><a id="Key_Event_Processing_in_the_Server"></a>Chapter 6. Key Event Processing in the Server</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Applying_Global_Controls">Applying Global Controls</a></span></dt><dt><span class="sect1"><a href="#Key_Behavior">Key Behavior</a></span></dt><dt><span class="sect1"><a href="#Key_Actions">Key Actions</a></span></dt><dt><span class="sect1"><a href="#Delivering_a_Key_or_Button_Event_to_a_Client">Delivering a Key or Button Event to a Client</a></span></dt><dd><dl><dt><span class="sect2"><a href="#XKB_Interactions_With_Core_Protocol_Grabs">XKB Interactions With Core Protocol Grabs</a></span></dt></dl></dd></dl></div><p>
This section describes the steps involved in processing a key event within the
server when XKB is present. Key events can be generated due to keyboard
activity and passed to XKB by the DDX layer, or they can be synthesized by
another extension, such as XTEST.
</p><div class="sect1" title="Applying Global Controls"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Applying_Global_Controls"></a>Applying Global Controls</h2></div></div></div><p>
When the X Keyboard Extension receives a key event, it first checks the global
key controls to decide whether to process the event immediately or at all. The
global key controls which might affect the event, in descending order of
priority, are:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If a key is pressed while the <span class="emphasis"><em>
BounceKeys</em></span>
 control is enabled, the extension generates the event only if the key is
active. When a key is released, the server deactivates the key and starts a
<span class="emphasis"><em>
bounce keys timer</em></span>
 with an interval specified by the debounce delay.
  </p><p>
If the bounce keys timer expires or if some other key is pressed before the
timer expires, the server reactivates the corresponding key and deactivates the
timer. Neither expiration nor deactivation of a bounce keys timer causes an
event.</p></li><li class="listitem"><p>If the <span class="emphasis"><em>
SlowKeys</em></span>
 control is enabled, the extension sets a <span class="emphasis"><em>
slow keys timer</em></span>
 with an interval specified by the slow keys delay, but does not process the
key event immediately. The corresponding key release deactivates this timer.
  </p><p>
If the slow keys timer expires, the server generates a key press for the
corresponding key, sends an <span class="emphasis"><em>
XkbAccessXNotify</em></span>
 and deactivates the timer.
   </p></li><li class="listitem"><p>The extension processes key press events normally whether or not the
<span class="emphasis"><em>
RepeatKeys</em></span>
 control is active, but if <span class="emphasis"><em>
RepeatKeys</em></span>
 are enabled and per-key autorepeat is enabled for the event key, the extension
processes key press events normally, but it also initiates an <span class="emphasis"><em>
autorepeat timer</em></span>
 with an interval specified by the autorepeat delay. The corresponding key
release deactivates the timer.
  </p><p>
If the autorepeat timer expires, the server generates a key release and a key
press for the corresponding key and reschedules the timer according to the
autorepeat interval.
  </p></li></ul></div><p>
Key events are processed by each global control in turn: if the <span class="emphasis"><em>
BounceKeys</em></span>
 control accepts a key event, <span class="emphasis"><em>
SlowKeys</em></span>
 considers it. Once <span class="emphasis"><em>
SlowKeys</em></span>
 allows or synthesizes an event, the <span class="emphasis"><em>
RepeatKeys</em></span>
 control acts on it.
</p></div><div class="sect1" title="Key Behavior"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Key_Behavior"></a>Key Behavior</h2></div></div></div><p>
Once an event is accepted by all of the controls or generated by a timer, the
server checks the per-key behavior of the corresponding key. This extension
currently defines the following key behaviors:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Behavior</th><th align="left">Effect</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
KB_Default</em></span>
 </td><td align="left">Press and release events are processed normally.</td></tr><tr><td align="left"><span class="emphasis"><em>
KB_Lock</em></span>
 </td><td align="left">If a key is logically up (i.e. the corresponding bit of the core key
map is cleared) when it is pressed, the key press is processed normally and the
corresponding release is ignored. If the key is logically down when pressed,
the key press is ignored but the corresponding release is processed normally.
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
KB_RadioGroup
</em></span>
    </p>
    <p>
      flags: CARD8
    </p>
    <p>
      index: CARD8
    </p>
    </td><td align="left"><p>If another member of the radio group specified by <span class="emphasis"><em>
index</em></span>
 is logically down when a key is pressed, the server synthesizes a key release
for the member that is logically down and then processes the new key press
event normally. </p>
<p>
If the key itself is logically down when pressed, the key press event is
ignored, but the processing of the corresponding key release depends on the
value of the <span class="emphasis"><em>
RGAllowNone</em></span>
 bit in <span class="emphasis"><em>
flags</em></span>
. If it is set, the key release is processed normally; otherwise the key
release is also ignored.
</p>
<p>
All other key release events are ignored.</p>
  </td></tr><tr><td align="left">
   <p>
    <span class="emphasis"><em>
KB_Overlay1
</em></span>
   </p>
   <p>
      key: KEYCODE
   </p>
      </td><td align="left">If the <span class="emphasis"><em>
Overlay1</em></span>
 control is enabled, events from this key are reported as if they came from the
key specified in <span class="emphasis"><em>
key</em></span>
. Otherwise, press and release events are processed normally.</td></tr><tr><td align="left">
   <p>
    <span class="emphasis"><em>
KB_Overlay2
</em></span>
   </p>
   <p>
      key: KEYCODE
   </p>
      </td><td align="left">If the <span class="emphasis"><em>
Overlay2</em></span>
 control is enabled, events from this key are reported as if they came from the
key specified in <span class="emphasis"><em>
key</em></span>
. Otherwise, press and release events are processed normally.</td></tr></tbody></table></div><p>
The X server uses key behavior to determine whether to process or filter out
any given key event; key behavior is independent of keyboard modifier or group
state (each key has exactly one behavior.
</p><p>
Key behaviors can be used to simulate any of these types of keys or to indicate
an unmodifiable physical, electrical or software driver characteristic of a
key. An optional <span class="emphasis"><em>
permanent</em></span>
 flag can modify any of the supported behaviors and indicates that behavior
describes an unalterable physical, electrical or software aspect of the
keyboard. Permanent behaviors cannot be changed or set by the <span class="emphasis"><em>
XkbSetMap</em></span>
 request. The <span class="emphasis"><em>
permanent</em></span>
 flag indicates a characteristic of the underlying system that XKB cannot
affect, so XKB treats all permanent behaviors as if they were <span class="emphasis"><em>
KB_Default</em></span>
 and does not filter key events described in the table above.
</p></div><div class="sect1" title="Key Actions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Key_Actions"></a>Key Actions</h2></div></div></div><p>
Once the server has applied the global controls and per-key behavior and has
decided to process a key event, it applies <span class="emphasis"><em>
key actions</em></span>
 to determine the effects of the key on the internal state of the server. A key
action consists of an operator and some optional data. XKB supports actions
which:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>change base, latched or locked modifiers or group
  </p></li><li class="listitem"><p>move the core pointer or simulate core pointer button events
  </p></li><li class="listitem"><p>change most aspects of keyboard behavior
  </p></li><li class="listitem"><p>terminate or suspend the server
  </p></li><li class="listitem"><p>send a message to interested clients
  </p></li><li class="listitem"><p>simulate events on other keys
  </p></li></ul></div><p>
Each key has an optional list of actions. If present, this list parallels the
list of symbols associated with the key (i.e. it has one action per symbol
associated with the key). For key press events, the server looks up the action
to be applied from this list using the key symbol mapping associated with the
event key, just as a client looks up symbols as described in <a class="link" href="#Determining_the_KeySym_Associated_with_a_Key_Event" title="Determining the KeySym Associated with a Key Event">Determining the KeySym Associated with a
Key Event</a>; if the event key does not have any actions, the server uses
the <span class="emphasis"><em>
SA_NoAction</em></span>
 event for that key regardless of modifier or group state.
</p><p>
Key actions have essentially two halves; the effects on the server when the key
is pressed and the effects when the key is released. The action applied for a
key press event determines the further actions, if any, that are applied to the
corresponding release event or to events that occur while the key is held down.
Clients can change the actions associated with a key while the key is down
without changing the action applied next time the key is released; subsequent
press-release pairs will use the newly bound key action.
</p><p>
Most actions directly change the state of the keyboard or server; some actions
also modify other actions that occur simultaneously with them. Two actions
occur simultaneously if the keys which invoke the actions are both logically
down at the same time, regardless of the order in which they are pressed or
delay between the activation of one and the other.
</p><p>
Most actions which affect keyboard modifier state accept a modifier definition
(see <a class="link" href="#Virtual_Modifiers" title="Chapter 3. Virtual Modifiers">Virtual Modifiers</a>)
named <span class="emphasis"><em>
mods</em></span>
 and a boolean flag name <span class="emphasis"><em>
useModMap</em></span>
 among their arguments. These two fields combine to specify the modifiers
affected by the action as follows: If <span class="emphasis"><em>
useModMap</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the action sets any modifiers bound by the modifier mapping to the key that
initiated the action; otherwise, the action sets the modifiers specified by
<span class="emphasis"><em>
mods</em></span>
. For brevity in the text of the following definitions, we refer to this
combination of <span class="emphasis"><em>
useModMap</em></span>
 and <span class="emphasis"><em>
mods</em></span>
 as the "action modifiers."
</p><p>
The X Keyboard Extension supports the following actions:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Action</th><th align="left">Effect</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>SA_NoAction</em></span></td><td align="left">
      <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
No direct effect, though <span class="emphasis"><em>SA_NoAction</em></span>
 events may change the effect of other server actions (see below).
          </p></li></ul></div>
    </td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>SA_SetMods</em></span>
    </p>
    <p>
      mods: MOD_DEF
    </p>
    <p>
      useModMap: BOOL
    </p>
    <p>
      clearLocks: BOOL
    </p>
    </td><td align="left">
      <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Key press adds any action modifiers to the keyboard’s base modifiers<span class="emphasis"><em>.</em></span>
        </p></li><li class="listitem"><p>Key release clears any action modifiers in the keyboard’s base
modifiers, provided that no other key which affects the same modifiers is
logically down.
        </p></li><li class="listitem"><p>If no keys were operated simultaneously with this key and <span class="emphasis"><em>
clearLocks</em></span>
 is set, release unlocks any action modifiers.
        </p></li></ul></div>
    </td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_LatchMods
</em></span>
    </p>
    <p>
      mods: MOD_DEF
    </p>
    <p>
      useModMap: BOOL
    </p>
    <p>
      clearLocks: BOOL
    </p>
    <p>
      latchToLock: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Key press and release events have the same effect as for <span class="emphasis"><em>
SA_SetMods</em></span>
; if no keys were operated simultaneously with the latching modifier key, key
release events have the following additional effects:
  </p></li><li class="listitem"><p>Modifiers that were unlocked due to <span class="emphasis"><em>
clearLocks</em></span>
 have no further effect.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
latchToLock</em></span>
 is set, key release locks and then unlatches any remaining action modifiers
that are already latched.
  </p></li><li class="listitem"><p>Finally, key release latches any action modifiers that were not used by
the <span class="emphasis"><em>
clearLocks</em></span>
 or <span class="emphasis"><em>
latchToLock</em></span>
 flags.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_LockMods
    </em></span>
    </p>
    <p>
      mods: MOD_DEF
    </p>
    <p>
      useModMap: BOOL
    </p>
    <p>
      noLock: BOOL
    </p>
    <p>
      noUnlock: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Key press sets the base and possibly the locked state of any action
modifiers. If <span class="emphasis"><em>
noLock</em></span>
 is <span class="emphasis"><em>
True</em></span>
, only the base state is changed.
  </p></li><li class="listitem"><p>For key release events, clears any action modifiers in the keyboard’s
base modifiers, provided that no other key which affects the same modifiers is
down. If <span class="emphasis"><em>
noUnlock</em></span>
 is <span class="emphasis"><em>
False</em></span>
 and any of the action modifiers were locked before the corresponding key press
occurred, key release unlocks them.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_SetGroup
</em></span>
    </p>
    <p>
      group: INT8
    </p>
    <p>
      groupAbsolute: BOOL
    </p>
    <p>
      clearLocks: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
groupAbsolute</em></span>
 is set, key press events change the base keyboard group to <span class="emphasis"><em>
group</em></span>
; otherwise, they add <span class="emphasis"><em>
group</em></span>
 to the base keyboard group. In either case, the resulting effective keyboard
group is brought back into range depending on the value of the <span class="emphasis"><em>
GroupsWrap</em></span>
 control for the keyboard.
  </p></li><li class="listitem"><p>If an <span class="emphasis"><em>
SA_ISOLock</em></span>
 key is pressed while this key is held down, key release has no effect,
otherwise it cancels the effects of the press.
  </p></li><li class="listitem"><p>If no keys were operated simultaneously with this key and <span class="emphasis"><em>
clearLocks</em></span>
 is set, key release also sets the locked keyboard group to <span class="emphasis"><em>
Group1</em></span>
.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_LatchGroup
    </em></span>
    </p>
    <p>
      group: INT8
    </p>
    <p>
      groupAbsolute: BOOL
    </p>
    <p>
      clearLocks: BOOL
    </p>
    <p>
      latchToLock: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Key press and release events have the same effect as an <span class="emphasis"><em>
SA_SetGroup</em></span>
 action; if no keys were operated simultaneously with the latching group key
and the <span class="emphasis"><em>
clearLocks</em></span>
 flag was not set or had no effect, key release has the following additional
effects:
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
latchToLock</em></span>
 is set and the latched keyboard group is non-zero, the key release adds the
delta applied by the corresponding key press to the locked keyboard group and
subtracts it from the latched keyboard group. The locked and effective keyboard
group are brought back into range according to the value of the global
<span class="emphasis"><em>
GroupsWrap</em></span>
 control for the keyboard.
  </p></li><li class="listitem"><p>Otherwise, key release adds the key press delta to the latched keyboard
group.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_LockGroup
    </em></span>
    </p>
    <p>
      group: INT8
    </p>
    <p>
      groupAbsolute: BOOL
    </p>
    </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
groupAbsolute</em></span>
 is set, key press sets the locked keyboard group to <span class="emphasis"><em>
group</em></span>
. Otherwise, key press adds <span class="emphasis"><em>
group</em></span>
 to the locked keyboard group. In either case, the resulting locked and
effective group is brought back into range depending on the value of the
<span class="emphasis"><em>
GroupsWrap</em></span>
 control for the keyboard.
  </p></li><li class="listitem"><p>Key release has no effect.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_MovePtr
</em></span>
    </p>
    <p>
      x, y: INT16
    </p>
    <p>
      noAccel: BOOL
    </p>
    <p>
      absoluteX: BOOL
    </p>
    <p>
      absoluteY: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
MouseKeys</em></span>
 are not enabled, this action behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
, otherwise this action cancels any pending repeat key timers for this key and
has the following additional effects.
  </p></li><li class="listitem"><p>Key press generates a core pointer <span class="emphasis"><em>
MotionNotify</em></span>
 event instead of the usual <span class="emphasis"><em>
KeyPress</em></span>
. If <span class="emphasis"><em>
absoluteX</em></span>
 is <span class="emphasis"><em>
True</em></span>
, <span class="emphasis"><em>
x</em></span>
 specifies the new pointer X coordinate, otherwise <span class="emphasis"><em>
x</em></span>
 is added to the current pointer X coordinate; <span class="emphasis"><em>
absoluteY</em></span>
 and <span class="emphasis"><em>
y</em></span>
 specify the new Y coordinate in the same way.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
noAccel</em></span>
 is <span class="emphasis"><em>
False</em></span>
, and the <span class="emphasis"><em>
MouseKeysAccel</em></span>
 keyboard control is enabled, key press also initiates the mouse keys timer for
this key; every time this timer expires, the cursor moves again. The distance
the cursor moves in these subsequent events is determined by the mouse keys
acceleration as described in <a class="link" href="#The_MouseKeysAccel_Control" title="The MouseKeysAccel Control">The
MouseKeysAccel Control</a>.
  </p></li><li class="listitem"><p>Key release disables the mouse keys timer (if it was initiated by the
corresponding key press) but has no other effect and is ignored (does not
generate an event of any type).
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_PtrBtn
   </em></span>
    </p>
    <p>
      button: CARD8
    </p>
    <p>
      count: CARD8
    </p>
    <p>
      useDfltBtn: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
MouseKeys</em></span>
 are not enabled, this action behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
useDfltBtn</em></span>
 is set, the event is generated for the current default core button. Otherwise,
the event is generated for the button specified by <span class="emphasis"><em>
button</em></span>
.
  </p></li><li class="listitem"><p>If the mouse button specified for this action is logically down, the
key press and corresponding release are ignored and have no effect.
  </p></li><li class="listitem"><p>Otherwise, key press causes one or more core pointer button events
instead of the usual key press. If <span class="emphasis"><em>
count</em></span>
 is <span class="emphasis"><em>
0</em></span>
, key press generates a single <span class="emphasis"><em>
ButtonPress</em></span>
 event; if <span class="emphasis"><em>
count</em></span>
 is greater than <span class="emphasis"><em>
0</em></span>
, key press generates <span class="emphasis"><em>
count</em></span>
 pairs of <span class="emphasis"><em>
ButtonPress</em></span>
 and <span class="emphasis"><em>
ButtonRelease</em></span>
 events.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
count</em></span>
 is <span class="emphasis"><em>
0</em></span>
, key release generates a core pointer <span class="emphasis"><em>
ButtonRelease</em></span>
 which matches the event generated by the corresponding key press; if count is
non-zero, key release does not cause a <span class="emphasis"><em>
ButtonRelease</em></span>
 event. Key release never causes a key release event.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_LockPtrBtn
</em></span>
    </p>
    <p>
      button: BUTTON
    </p>
    <p>
      noLock: BOOL
    </p>
    <p>
      noUnlock: BOOL
    </p>
    <p>
      useDfltBtn: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
MouseKeys</em></span>
 are not enabled, this action behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li><li class="listitem"><p>Otherwise, if the button specified by <span class="emphasis"><em>
useDfltBtn</em></span>
 and <span class="emphasis"><em>
button</em></span>
 is not locked, key press causes a <span class="emphasis"><em>
ButtonPress</em></span>
 instead of a key press and locks the button. If the button is already locked
or if <span class="emphasis"><em>
noLock</em></span>
 is <span class="emphasis"><em>
True</em></span>
, key press is ignored and has no effect.
  </p></li><li class="listitem"><p>If the corresponding key press was ignored, and if <span class="emphasis"><em>
noUnlock</em></span>
 is <span class="emphasis"><em>
False</em></span>
, key release generates a <span class="emphasis"><em>
ButtonRelease</em></span>
 event instead of a key release event and unlocks the specified button. If the
corresponding key press locked a button, key release is ignored and has no
effect.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_SetPtrDflt
</em></span>
    </p>
    <p>
      affect: CARD8
    </p>
    <p>
      value: CARD8
    </p>
    <p>
      dfltBtnAbs: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
MouseKeys</em></span>
 are not enabled, this action behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li><li class="listitem"><p>Otherwise, both key press and key release are ignored, but key press
changes the pointer value specified by <span class="emphasis"><em>
affect </em></span>
to <span class="emphasis"><em>
value</em></span>
, as follows:
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
which</em></span>
 is <span class="emphasis"><em>
SA_AffectDfltBtn</em></span>
, <span class="emphasis"><em>
value</em></span>
 and <span class="emphasis"><em>
dfltBtnAbs</em></span>
 specify the default pointer button used by the various pointer actions as
follow: If <span class="emphasis"><em>
dfltBtnAbs </em></span>
is True, value specifies the button to be used, otherwise, <span class="emphasis"><em>
value</em></span>
 specifies the amount to be added to the current default button. In either
case, illegal button choices are wrapped back into range.
  </p></li></ul></div>
</td></tr><tr><td align="left">
      <p>
    <span class="emphasis"><em>
SA_ISOLock
</em></span>
      </p>
      <p>
      dfltIsGroup: <span class="emphasis"><em>
False
</em></span>
      </p>
      <p>
      mods: MOD_DEF
      </p>
      <p>
      useModMap: BOOL
      </p>
      <p>
      noLock: BOOL
      </p>
      <p>
      noUnlock: BOOL
      </p>
      <p>
      noAffectMods: BOOL
      </p>
      <p>
      noAffectGrp: BOOL
      </p>
      <p>
      noAffectPtr: BOOL
      </p>
      <p>
      noAffectCtrls: BOOL
      </p>
      <p>
or
      </p>
      <p>
      dfltIsGroup: <span class="emphasis"><em>
True
</em></span>
      </p>
      <p>
      group: INT8
      </p>
      <p>
      groupAbsolute: BOOL
      </p>
      <p>
      noAffectMods: BOOL
      </p>
      <p>
      noAffectGrp: BOOL
      </p>
      <p>
      noAffectPtr: BOOL
      </p>
      <p>
      noAffectCtrls: BOOL
      </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
dfltIsGroup</em></span>
 is <span class="emphasis"><em>
True</em></span>
, key press sets the base group specified by <span class="emphasis"><em>
groupAbsolute</em></span>
 and <span class="emphasis"><em>
group</em></span>
. Otherwise, key press sets the action modifiers in the keyboard’s base
modifiers.
  </p></li><li class="listitem"><p>Key release clears the base modifiers or group that were set by the key
press; it may have additional effects if no other appropriate actions occur
simultaneously with the <span class="emphasis"><em>
SA_ISOLock</em></span>
 operation.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
noAffectMods</em></span>
 is <span class="emphasis"><em>
False</em></span>
, any <span class="emphasis"><em>
SA_SetMods</em></span>
 or <span class="emphasis"><em>
SA_LatchMods</em></span>
 actions that occur simultaneously with the <span class="emphasis"><em>
ISOLock</em></span>
 action are treated as <span class="emphasis"><em>
SA_LockMods</em></span>
 instead.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
noAffectGrp</em></span>
 is <span class="emphasis"><em>
False</em></span>
, any <span class="emphasis"><em>
SA_SetGroup</em></span>
 or <span class="emphasis"><em>
SA_LatchGroup</em></span>
 actions that occur simultaneously with this action are treated as <span class="emphasis"><em>
SA_LockGroup</em></span>
 actions instead.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
noAffectPtr</em></span>
 is <span class="emphasis"><em>
False</em></span>
, <span class="emphasis"><em>
SA_PtrBtn</em></span>
 actions that occur simultaneously with the <span class="emphasis"><em>
SA_ISOLock</em></span>
 action are treated as <span class="emphasis"><em>
SA_LockPtrBtn</em></span>
 actions instead.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
noAffectCtrls</em></span>
 is <span class="emphasis"><em>
False</em></span>
, any <span class="emphasis"><em>
SA_SetControls</em></span>
 actions that occur simultaneously with the <span class="emphasis"><em>
SA_ISOLock</em></span>
 action are treated as <span class="emphasis"><em>
SA_LockControls</em></span>
 actions instead.
  </p></li><li class="listitem"><p>If no other actions were transformed by the <span class="emphasis"><em>
SA_ISOLock</em></span>
 action, key release locks the group or modifiers specified by the action
arguments.
  </p></li></ul></div>
</td></tr><tr><td align="left"><span class="emphasis"><em>
SA_TerminateServer</em></span>
 </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Key press terminates the server. Key release is ignored.
  </p></li><li class="listitem"><p>This action is optional; servers are free to ignore it. If ignored, it
behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_SwitchScreen
</em></span>
      </p>
      <p>
      num: INT8
      </p>
      <p>
      switchApp: BOOL
      </p>
      <p>
      screenAbs: BOOL
      </p>
</td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If the server supports this action and multiple screens or displays
(either virtual or real), this action changes to the active screen indicated by
<span class="emphasis"><em>
num</em></span>
 and <span class="emphasis"><em>
screenAbs</em></span>
. If <span class="emphasis"><em>
screenAbs</em></span>
 is <span class="emphasis"><em>
True</em></span>
, num specifies the index of the new screen; otherwise, num specifies an offset
from the current screen to the new screen.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
switchApp</em></span>
 is <span class="emphasis"><em>
False</em></span>
, it should switch to another screen on the same server. Otherwise it should
switch to another X server or application which shares the same physical
display.
  </p></li><li class="listitem"><p>This action is optional; servers are free to ignore the action or any
of its flags if they do not support the requested behavior. If the action is
ignored, it behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
, otherwise neither key press nor release generate an event.
  </p></li></ul></div>
</td></tr><tr><td align="left">
      <p><span class="emphasis"><em>SA_SetControls</em></span></p>
      <p>controls: KB_BOOLCTRLMASK</p>
    </td><td align="left">
      <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Key press enables any boolean controls that are specified in <span class="emphasis"><em>
controls</em></span>
 and not already enabled at the time of the key press. Key release disables any
controls that were enabled by the corresponding key press. This action can
cause <span class="emphasis"><em>
XkbControlsNotify</em></span>
 events.
          </p></li></ul></div>
     </td></tr><tr><td align="left">
      <p><span class="emphasis"><em>SA_LockControls</em></span></p>
      <p>
      controls: KB_BOOLCTRLMASK
      </p>
      <p>
      noLock: BOOL
      </p>
      <p>
      noUnlock: BOOL
      </p>
    </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
noLock</em></span>
 is <span class="emphasis"><em>
False</em></span>
, key press locks and enables any controls that are specified in <span class="emphasis"><em>
controls</em></span>
 and not already locked at the time of the key press.
</p><p>
If <span class="emphasis"><em>
noUnlock</em></span>
 is <span class="emphasis"><em>
False</em></span>
, key release unlocks and disables any controls that are specified in <span class="emphasis"><em>
controls</em></span>
 and were not enabled at the time of the corresponding key press.
  </p></li></ul></div>
</td></tr><tr><td align="left">
      <p>
    <span class="emphasis"><em>
SA_ActionMessage</em></span>
:
      pressMsg: BOOL
      </p>
      <p>
      releaseMsg: BOOL
      </p>
      <p>
      genEvent: BOOL
      </p>
      <p>
      message: STRING
      </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>if <span class="emphasis"><em>
pressMsg</em></span>
 is <span class="emphasis"><em>
True</em></span>
, key press generates an <span class="emphasis"><em>
XkbActionMessage</em></span>
 event which reports the keycode, event type and the contents of <span class="emphasis"><em>
message</em></span>
.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
releaseMsg</em></span>
 is <span class="emphasis"><em>
True</em></span>
, key release generates an <span class="emphasis"><em>
XkbActionMessage</em></span>
 event which reports the keycode, event type and contents of <span class="emphasis"><em>
message</em></span>
.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
genEvent</em></span>
 is <span class="emphasis"><em>
True</em></span>
, both press and release generate key press and key release events, regardless
of whether they also cause an <span class="emphasis"><em>
XkbActionMessage</em></span>
.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_RedirectKey
</em></span>
    </p>
    <p>
      newKey: KEYCODE
    </p>
    <p>
      modsMask: KEYMASK
    </p>
    <p>
      mods: KEYMASK
    </p>
    <p>
      vmodsMask: CARD16
    </p>
    <p>
      vmods: CARD16
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Key press causes a key press event for the key specified by <span class="emphasis"><em>
newKey</em></span>
 instead of for the actual key. The state reported in this event reports of the
current effective modifiers changed as follow: Any real modifiers specified in
<span class="emphasis"><em>
modsMask</em></span>
 are set to corresponding values from <span class="emphasis"><em>
mods</em></span>
. Any real modifiers bound to the virtual modifiers specified in <span class="emphasis"><em>
vmodsMask</em></span>
 are either set or cleared, depending on the corresponding value in <span class="emphasis"><em>
vmods</em></span>
. If the real and virtual modifier definitions specify conflicting values for a
single modifier, the real modifier definition has priority.
  </p></li><li class="listitem"><p>Key release causes a key release event for the key specified by
<span class="emphasis"><em>
newKey</em></span>
; the state field for this event consists of the effective keyboard modifiers
at the time of the release, changed as described above.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
SA_RedirectKey</em></span>
 action normally redirects to another key on the same device as the key or
button which caused the event, unless that device does not belong to the input
extension KEYCLASS, in which case this action causes an event on the core
keyboard device.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_DeviceBtn
</em></span>
    </p>
    <p>
      count: CARD8
    </p>
    <p>
      button: BUTTON
    </p>
    <p>
      device: CARD8
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
device</em></span>
 field specifies the ID of an extension device; the <span class="emphasis"><em>
button</em></span>
 field specifies the index of a button on that device. If the button specified
by this action is logically down, the key press and corresponding release are
ignored and have no effect. If the device or button specified by this action
are illegal, this action behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li><li class="listitem"><p>Otherwise, key press causes one or more input extension device button
events instead of the usual key press event. If <span class="emphasis"><em>
count</em></span>
 is <span class="emphasis"><em>
0</em></span>
, key press generates a single <span class="emphasis"><em>
DeviceButtonPress</em></span>
 event; if <span class="emphasis"><em>
count</em></span>
 is greater than <span class="emphasis"><em>
0</em></span>
, key press generates <span class="emphasis"><em>
count</em></span>
 pairs of <span class="emphasis"><em>
DeviceButtonPress</em></span>
 and <span class="emphasis"><em>
DeviceButtonRelease</em></span>
 events.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
count</em></span>
 is <span class="emphasis"><em>
0</em></span>
, key release generates an input extension <span class="emphasis"><em>
DeviceButtonRelease</em></span>
 which matches the event generated by the corresponding key press; if count is
non-zero, key release does not cause a <span class="emphasis"><em>
DeviceButtonRelease</em></span>
 event. Key release never causes a key release event.
  </p></li></ul></div>
</td></tr><tr><td align="left">
    <p>
    <span class="emphasis"><em>
SA_LockDeviceBtn
</em></span>
    </p>
    <p>
      button: BUTTON
    </p>
    <p>
      device: CARD8
    </p>
    <p>
      noLock: BOOL
    </p>
    <p>
      noUnlock: BOOL
    </p>
      </td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
device</em></span>
 field specifies the ID of an extension device; the <span class="emphasis"><em>
button</em></span>
 field specifies the index of a button on that device. If the device or button
specified by this action are illegal, it behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li><li class="listitem"><p>Otherwise, if the specified button is not locked and if <span class="emphasis"><em>
noLock</em></span>
 is <span class="emphasis"><em>
False</em></span>
, key press causes an input extension <span class="emphasis"><em>
DeviceButtonPress</em></span>
 event instead of a key press event and locks the button. If the button is
already locked or if <span class="emphasis"><em>
noLock</em></span>
 is <span class="emphasis"><em>
True</em></span>
, key press is ignored and has no effect.
  </p></li><li class="listitem"><p>If the corresponding key press was ignored, and if <span class="emphasis"><em>
noUnlock</em></span>
 is <span class="emphasis"><em>
False</em></span>
, key release generates an input extension <span class="emphasis"><em>
DeviceButtonRelease</em></span>
 event instead of a core protocol or input extension key release event and
unlocks the specified button. If the corresponding key press locked a button,
key release is ignored and has no effect.
  </p></li></ul></div>
</td></tr><tr><td align="left">
<p>
    <span class="emphasis"><em>
SA_DeviceValuator
</em></span>
</p>
<p>
      <span class="emphasis"><em>
device</em></span>
: CARD8
</p>
<p>
      <span class="emphasis"><em>
val1What</em></span>
: SA_DVOP
</p>
<p>
      <span class="emphasis"><em>
val1</em></span>
: CARD8
</p>
<p>
      <span class="emphasis"><em>
val1Value</em></span>
: INT8
</p>
<p>
      <span class="emphasis"><em>
val1Scale</em></span>
: 0...7
</p>
<p>
      <span class="emphasis"><em>
val2What</em></span>
: BOOL
</p>
<p>
      <span class="emphasis"><em>
val2</em></span>
: CARD8
</p>
<p>
      <span class="emphasis"><em>
val2Value</em></span>
: INT8
</p>
<p>
      <span class="emphasis"><em>
val2Scale</em></span>
: 0...7
</p>
</td><td align="left">
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
device</em></span>
 field specifies the ID of an extension device; <span class="emphasis"><em>
val1</em></span>
 and <span class="emphasis"><em>
val2</em></span>
 specify valuators on that device. If <span class="emphasis"><em>
device</em></span>
 is illegal or if neither <span class="emphasis"><em>
val1</em></span>
 nor <span class="emphasis"><em>
val2</em></span>
 specifies a legal valuator, this action behaves like <span class="emphasis"><em>
SA_NoAction</em></span>
.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
valn</em></span>
 specifies a legal valuator and <span class="emphasis"><em>
valnWhat</em></span>
 is not <span class="emphasis"><em>
SA_IgnoreVal</em></span>
, the specified value is adjusted as specified by <span class="emphasis"><em>
valnWhat</em></span>
:
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
valnWhat</em></span>
 is <span class="emphasis"><em>
SA_SetValMin</em></span>
, <span class="emphasis"><em>
valn</em></span>
 is set to its minimum legal value.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
valnWhat</em></span>
 is <span class="emphasis"><em>
SA_SetValCenter</em></span>
, <span class="emphasis"><em>
valn</em></span>
 is centered (to (max-min)/2).
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
valnWhat</em></span>
 is <span class="emphasis"><em>
SA_SetValMax</em></span>
, <span class="emphasis"><em>
valn</em></span>
 is set to its maximum legal value.
  </p></li><li class="listitem"><p>if <span class="emphasis"><em>
valnWhat</em></span>
 is <span class="emphasis"><em>
SA_SetValRelative</em></span>
, </p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-4.svg"></object></div><p>

 is added to <span class="emphasis"><em>
valn</em></span>
.
  </p></li><li class="listitem"><p>if <span class="emphasis"><em>
valnWhat</em></span>
 is <span class="emphasis"><em>
SA_SetValAbsolute</em></span>
, <span class="emphasis"><em>
valn</em></span>
 is set to </p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-5.svg"></object></div><p>

.
  </p></li><li class="listitem"><p>Illegal values for <span class="emphasis"><em>
SA_SetValRelative</em></span>
 or <span class="emphasis"><em>
SA_SetValAbsolute</em></span>
 are clamped into range.
  </p></li></ul></div>
</td></tr></tbody></table></div><p>
If <span class="emphasis"><em>
StickyKeys</em></span>
 are enabled, all <span class="emphasis"><em>
SA_SetMods</em></span>
 and <span class="emphasis"><em>
SA_SetGroup</em></span>
 actions act like <span class="emphasis"><em>
SA_LatchMods</em></span>
 and <span class="emphasis"><em>
SA_LatchGroup</em></span>
 respectively. If the <span class="emphasis"><em>
LatchToLock</em></span>
 AccessX option is set, either action behaves as if both the <span class="emphasis"><em>
SA_ClearLocks</em></span>
 and <span class="emphasis"><em>
SA_LatchToLock</em></span>
 flags are set.
</p><p>
Actions which cause an event from another key or from a button on another
device immediately generate the specified event. These actions do not consider
the behavior or actions (if any) that are bound to the key or button to which
the event is redirected.
</p><p>
Core events generated by server actions contain the keyboard state that was in
effect at the time the key event occurred; the reported state does not reflect
any changes in state that occur as a result of the actions bound to the key
event that caused them.
</p><p>
Events sent to clients that have not issued an <span class="emphasis"><em>
XkbUseExtension</em></span>
 request contain a compatibility state in place of the actual XKB keyboard
state. See <a class="link" href="#Effects_of_XKB_on_Core_Protocol_Events" title="Effects of XKB on Core Protocol Events">Effects of XKB on Core
Protocol Events</a> for a description of this compatibility mapping.
</p></div><div class="sect1" title="Delivering a Key or Button Event to a Client"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Delivering_a_Key_or_Button_Event_to_a_Client"></a>Delivering a Key or Button Event to a Client</h2></div></div></div><p>
The window and client that receive core protocol and input extension key or
button events are determined using the focus policy, window hierarchy and
passive grabs as specified by the core protocol and the input extension, with
the following changes:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A passive grab triggers if the modifier state specified in the grab
matches the grab compatibility state (described in <a class="link" href="#Compatibility_Components_of_Keyboard_State" title="Compatibility Components of Keyboard State">Compatibility Components of Keyboard
State</a>). Clients can choose to use the XKB grab state instead by setting
the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client flag. This flag affects all passive grabs that are requested by the
client which sets it but does not affect passive grabs that are set by any
other client.
  </p></li><li class="listitem"><p>The state field of events which trigger a passive grab reports the XKB
or compatibility grab state in effect at the time the grab is triggered; the
state field of the corresponding release event reports the corresponding grab
state in effect when the key or button is released.
  </p></li><li class="listitem"><p>If the <span class="emphasis"><em>
LookupStateWhenGrabbed</em></span>
 per-client flag is set, all key or button events that occur while a keyboard
or pointer grab is active contain the XKB or compatibility lookup state,
depending on the value of the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client flag. If <span class="emphasis"><em>
LookupStateWhenGrabbed</em></span>
 is not set, they include the XKB or compatibility grab state, instead.
  </p></li><li class="listitem"><p>Otherwise, the state field of events that do not trigger a passive grab
report is derived from the XKB effective modifiers and group, as described in
<a class="link" href="#Computing_A_State_Field_from_an_XKB_State" title="Computing A State Field from an XKB State">Computing A State Field from an
XKB State</a>.
  </p></li><li class="listitem"><p>If a key release event is the result of an autorepeating key that is
being held down, and the client to which the event is reported has requested
detectable autorepeat (see <a class="link" href="#Detectable_Autorepeat" title="Detectable Autorepeat">
Detectable Autorepeat</a>), the event is not delivered to the client.
  </p></li></ul></div><p>
The following section explains the intent of the XKB interactions with core
protocol grabs and the reason that the per-client flags are needed.
</p><div class="sect2" title="XKB Interactions With Core Protocol Grabs"><div class="titlepage"><div><div><h3 class="title"><a id="XKB_Interactions_With_Core_Protocol_Grabs"></a>XKB Interactions With Core Protocol Grabs</h3></div></div></div><p>
XKB provides the separate lookup and grab states to help work around some
difficulties with the way the core protocol specifies passive grabs.
Unfortunately, many clients work around those problems differently, and the way
that XKB handles grabs and reports keyboard state can sometimes interact with
those client workarounds in unexpected and unpleasant ways.
</p><p>
To provide more reasonable behavior for clients that are aware of XKB without
causing problems for clients that are unaware of XKB, this extension provides
two per-client flags that specify the way that XKB and the core protocol should
interact.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The largest problems arise from the fact that an XKB state field
encodes an explicit keyboard group in bits 13-14 (as described in <a class="link" href="#Computing_A_State_Field_from_an_XKB_State" title="Computing A State Field from an XKB State">Computing A State Field from an XKB
State</a>), while pre-XKB clients use one of the eight keyboard modifiers
to select an alternate keyboard group. To make existing clients behave
reasonably, XKB normally uses the compatibility grab state instead of the XKB
grab state to determine whether or not a passive grab is triggered. XKB-aware
clients can set the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client flag to indicate that they are specifying passive grabs using an
XKB state.
  </p></li><li class="listitem"><p>Some toolkits start an active grab when a passive grab is triggered, in
order to have more control over the conditions under which the grab is
terminated. Unfortunately, the fact that XKB reports a different state in
events that trigger or terminate grabs means that this grab simulation can fail
to terminate the grab under some conditions. To work around this problem, XKB
normally reports the grab state in all events whenever a grab is active.
Clients which do not use active grabs like this can set the <span class="emphasis"><em>
LookupStateWhenGrabbed</em></span>
 per-client flag in order to receive the same state component whether or not a
grab is active.
  </p><p>
The <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client flag also applies to the state of events sent while a grab is
active. If it is set, events during a grab contain the XKB lookup or grab
state; by default, events during a grab contain the compatibility lookup or
grab state.</p></li></ul></div><p>
The state used to trigger a passive grab is controlled by the setting of the
<span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client flag at the time the grab is registered. Changing this flag does
not affect existing passive grabs.
</p></div></div></div><div class="chapter" title="Chapter 7. Key Event Processing in the Client"><div class="titlepage"><div><div><h2 class="title"><a id="Key_Event_Processing_in_the_Client"></a>Chapter 7. Key Event Processing in the Client</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Notation_and_Terminology">Notation and Terminology</a></span></dt><dt><span class="sect1"><a href="#Determining_the_KeySym_Associated_with_a_Key_Event">Determining the KeySym Associated with a Key Event</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Key_Types">Key Types</a></span></dt><dt><span class="sect2"><a href="#Key_Symbol_Map">Key Symbol Map</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Transforming_the_KeySym_Associated_with_a_Key_Event">Transforming the KeySym Associated with a Key Event</a></span></dt><dt><span class="sect1"><a href="#Client_Map_Example">Client Map Example</a></span></dt></dl></div><p>
The XKB <span class="emphasis"><em>
client map</em></span>
 for a keyboard is the collection of information a client needs to interpret
key events that come from that keyboard. It contains a global list of <span class="emphasis"><em>
key types</em></span>
, described in <a class="link" href="#Key_Types" title="Key Types">Key Types</a>,
and an array of <span class="emphasis"><em>
key symbol map</em></span>
s, each of which describes the symbols bound to one particular key and the
rules to be used to interpret those symbols.
</p><div class="sect1" title="Notation and Terminology"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Notation_and_Terminology"></a>Notation and Terminology</h2></div></div></div><p>
XKB associates a two-dimensional array of symbols with each key. Symbols are
addressed by keyboard group (see <a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">
Keyboard State</a>) and shift level, where level is defined as in the
ISO9995 standard:
</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term">Level</span></p></td><td><p>
One of several states (normally 2 or 3) which govern which graphic
character is produced when a graphic key is actuated. In certain cases the
level may also affect function keys.
      </p></td></tr></tbody></table></div><p>
Note that shift level is derived from the modifier state, but not necessarily
in the same way for all keys. For example, the <span class="emphasis"><em>
Shift</em></span>
 modifier selects shift level 2 on most keys, but for keypad keys the modifier
bound to <span class="emphasis"><em>
Num_Lock</em></span>
 (i.e. the <span class="emphasis"><em>
NumLock</em></span>
 virtual modifier) also selects shift level 2.gray symbols on a key
</p><p>
We use the notation G<span class="emphasis"><em>
n</em></span>
L<span class="emphasis"><em>
n</em></span>
 to specify the position of a symbol on a key or in memory:
</p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-6.svg"></object></div><p>
The gray characters indicate symbols that are implied or expected but are not
actually engraved on the key.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Unfortunately, the "natural" orientation of symbols on a key and
the natural orientation in memory are reversed from one another, so keyboard
group refers to a column on the key and a row in memory. There’s no real help
for it, but we try to minimize confusion by using "group" and "level" (or
"shift level") to refer to symbols regardless of context.</p></div></div><div class="sect1" title="Determining the KeySym Associated with a Key Event"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Determining_the_KeySym_Associated_with_a_Key_Event"></a>Determining the KeySym Associated with a Key Event</h2></div></div></div><p>
To look up the symbol associated with an XKB key event, we need to know the
group and shift level that correspond to the event.
</p><p>
Group is reported in bits 13-14 of the state field of the key event, as
described in <a class="link" href="#Computing_A_State_Field_from_an_XKB_State" title="Computing A State Field from an XKB State">Computing A State
Field from an XKB State</a>. The keyboard group reported in the event might
be out-of-range for any particular key because the number of groups can vary
from key to key. The XKB description of each key contains a <span class="emphasis"><em>
group info</em></span>
 field which is interpreted identically to the global groups wrap control (see
<a class="link" href="#Computing_Effective_Modifier_and_Group" title="Computing Effective Modifier and Group">Computing Effective Modifier and
Group</a>) and which specifies the interpretation of groups that are
out-of-range for that key.
</p><p>
Once we have determined the group to be used for the event, we have to
determine the shift level. The description of a key includes a <span class="emphasis"><em>
key type</em></span>
 for each group of symbols bound to the key. Given the modifiers from the key
event, this key type yields a shift level and a set of "leftover" modifiers, as
described in <a class="link" href="#Key_Types" title="Key Types">Key Types</a>
below.
</p><p>
Finally, we can use the effective group and the shift level returned by the
type of that group to look up a symbol in a two-dimensional array of symbols
associated with the key.
</p><div class="sect2" title="Key Types"><div class="titlepage"><div><div><h3 class="title"><a id="Key_Types"></a>Key Types</h3></div></div></div><p>
Each entry of a key type’s <span class="emphasis"><em>
map</em></span>
 field specifies the shift level that corresponds to some XKB modifier
definition; any combination of modifiers that is not explicitly listed
somewhere in the map yields shift level one. Map entries which specify unbound
virtual modifiers (see <a class="link" href="#Inactive_Modifier_Definitions" title="Inactive Modifier Definitions">Inactive
Modifier Definitions</a>) are not considered; each entry contains an
automatically-updated <span class="emphasis"><em>
active</em></span>
 field which indicates whether or not it should be used.
</p><p>
Each key type includes a few fields that are derived from the contents of the
map and which report some commonly used values so they don’t have to be
constantly recalculated. The <span class="emphasis"><em>
numLevels</em></span>
 field contains the highest shift level reported by any of its map entries; XKB
uses <span class="emphasis"><em>
numLevels</em></span>
 to insure that the array of symbols bound to a key is large enough (the number
of levels reported by a key type is also referred to as its width). The
<span class="emphasis"><em>
modifiers</em></span>
 field reports all real modifiers considered by any of the map entries for the
type. Both <span class="emphasis"><em>
modifiers</em></span>
<span class="emphasis"><em>
 </em></span>
and <span class="emphasis"><em>
numLevels</em></span>
 are updated automatically by XKB and neither can be changed explicitly.
</p><p>
Any modifiers specified in <span class="emphasis"><em>
modifiers</em></span>
 are normally <span class="emphasis"><em>
consumed</em></span>
 (see <a class="link" href="#Transforming_the_KeySym_Associated_with_a_Key_Event" title="Transforming the KeySym Associated with a Key Event">Transforming the KeySym
Associated with a Key Event</a>), which means that they are not considered
during any of the later stages of event processing. For those rare occasions
that a modifier <span class="emphasis"><em>
should</em></span>
 be considered despite having been used to look up a symbol, key types include
an optional <span class="emphasis"><em>
preserve</em></span>
 field. If a <span class="emphasis"><em>
preserve</em></span>
 list is present, each entry corresponds to one of the key type’s map entries
and lists the modifiers that should <span class="emphasis"><em>
not</em></span>
 be consumed if the matching map entry is used to determine shift level.
</p><p>
For example, the following key type implements caps lock as defined by the core
protocol (using the second symbol bound to the key):
</p><pre class="literallayout">
type "ALPHABETIC" {
	modifiers = Shift+Lock;
	map[Shift]= Level2;
	map[Lock]= Level2;
	map[Shift+Lock]= Level2;
};
</pre><p>
The problem with this kind of definition is that we could assign completely
unrelated symbols to the two shift levels, and "Caps Lock" would choose the
second symbol. Another definition for alphabetic keys uses system routines to
capitalize the keysym:
</p><pre class="literallayout">
type "ALPHABETIC" {
	modifiers= Shift;
	map[Shift]= Level2;
};
</pre><p>
When caps lock is applied using this definition, we take the symbol from shift
level one and capitalize it using system-specific capitalization rules. If
shift and caps lock are both set, we take the symbol from shift level two and
try to capitalize it, which usually has no effect.
</p><p>
The following key type implements shift-cancels-caps lock behavior for
alphabetic keys:
</p><pre class="literallayout">
type "ALPHABETIC" {
	modifiers = Shift+Lock;
	map[Shift] = Level2;
	preserve[Lock]= Lock;
};
</pre><p>
Consider the four possible states that can affect alphabetic keys: no
modifiers, shift alone, caps lock alone or shift and caps lock together. The
map contains no explicit entry for <span class="emphasis"><em>
None</em></span>
 (no modifiers), so if no modifiers are set, any group with this type returns
the first keysym. The map entry for <span class="emphasis"><em>
Shift</em></span>
 reports <span class="emphasis"><em>
Level2</em></span>
, so any group with this type returns the second symbol when <span class="emphasis"><em>
Shift</em></span>
 is set. There is no map entry for <span class="emphasis"><em>
Lock</em></span>
 alone, but the type specifies that the <span class="emphasis"><em>
Lock</em></span>
 modifier should be preserved in this case, so <span class="emphasis"><em>
Lock</em></span>
 alone returns the first symbol in the group but first applies the
capitalization transformation, yielding the capital form of the symbol. In the
final case, there is no map entry for <span class="emphasis"><em>
Shift+Lock</em></span>
, so it returns the first symbol in the group; there is no preserve entry, so
the <span class="emphasis"><em>
Lock</em></span>
 modifier is consumed and the symbol is not capitalized.
</p></div><div class="sect2" title="Key Symbol Map"><div class="titlepage"><div><div><h3 class="title"><a id="Key_Symbol_Map"></a>Key Symbol Map</h3></div></div></div><p>
The <span class="emphasis"><em>
key symbol map</em></span>
 for a key contains all of the information that a client needs to process
events generated by that key. Each key symbol mapping reports:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The number of groups of symbols bound to the key (<span class="emphasis"><em>
numGroups</em></span>
).
  </p></li><li class="listitem"><p>The treatment of out-of-range groups (<span class="emphasis"><em>
groupInfo</em></span>
).
  </p></li><li class="listitem"><p>The index of the key type to for each <span class="emphasis"><em>
possible</em></span>
 group (<span class="emphasis"><em>
kt_index[MaxKbdGroups]</em></span>
).
  </p></li><li class="listitem"><p>The width of the widest type associated with the key (<span class="emphasis"><em>
groupsWidth</em></span>
).
  </p></li><li class="listitem"><p>The two-dimensional (numGroups <span class="emphasis"><em>
×</em></span>
 groupsWidth) array of symbols bound to the key.
  </p></li></ul></div><p>
It is legal for a key to have zero groups, in which case it also has zero
symbols and all events from that key yield <span class="emphasis"><em>
NoSymbol</em></span>
. The array of key types is of fixed width and is large enough to hold key
types for the maximum legal number of groups (<span class="emphasis"><em>
MaxKbdGroups</em></span>
, currently four); if a key has fewer than <span class="emphasis"><em>
MaxKbdGroups</em></span>
 groups, the extra key types are reported but ignored. The <span class="emphasis"><em>
groupsWidth</em></span>
 field cannot be explicitly changed; it is updated automatically whenever the
symbols or set of types bound to a key are changed.
</p><p>
If, when looking up a symbol, the effective keyboard group is out-of-range for
the key, the <span class="emphasis"><em>
groupInfo</em></span>
 field of the key symbol map specifies the rules for determining the
corresponding legal group as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If the <span class="emphasis"><em>
RedirectIntoRange</em></span>
 flag is set, the two least significant bits of <span class="emphasis"><em>
groupInfo</em></span>
 specify the index of a group to which all illegal groups correspond. If the
specified group is also out of range, all illegal groups map to <span class="emphasis"><em>
Group1</em></span>
.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
ClampIntoRange</em></span>
 flag is set, out-of-range groups correspond to the nearest legal group.
Effective groups larger than the highest supported group are mapped to the
highest supported group; effective groups less than <span class="emphasis"><em>
Group1</em></span>
 are mapped to <span class="emphasis"><em>
Group1</em></span>
. For example, a key with two groups of symbols uses <span class="emphasis"><em>
Group2</em></span>
 type and symbols if the global effective group is either <span class="emphasis"><em>
Group3</em></span>
 or <span class="emphasis"><em>
Group4</em></span>
.
  </p></li><li class="listitem"><p>If neither flag is set, group is wrapped into range using integer
modulus. For example, a key with two groups of symbols for which groups wrap
uses <span class="emphasis"><em>
Group1</em></span>
 symbols if the global effective group is <span class="emphasis"><em>
Group3</em></span>
 or <span class="emphasis"><em>
Group2</em></span>
 symbols if the global effective group is <span class="emphasis"><em>
Group4</em></span>
.
  </p></li></ul></div><p>
The client map contains an array of key symbol mappings, with one entry for
each key between the minimum and maximum legal keycodes, inclusive. All
keycodes which fall in that range have key symbol mappings, whether or not any
key actually yields that code.
</p></div></div><div class="sect1" title="Transforming the KeySym Associated with a Key Event"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Transforming_the_KeySym_Associated_with_a_Key_Event"></a>Transforming the KeySym Associated with a Key Event</h2></div></div></div><p>
Any modifiers that were not used to look up the keysym, or which were
explicitly preserved, might indicate further transformations to be performed on
the keysym or the character string that is derived from it. For example, If the
<span class="emphasis"><em>
Lock</em></span>
 modifier is set, the symbol and corresponding string should be capitalized
according to the locale-sensitive capitalization rules specified by the system.
If the <span class="emphasis"><em>
Control</em></span>
 modifier is set, the keysym is not affected, but the corresponding character
should be converted to a control character as described in <a class="link" href="#default_symbol_transformations" title="Appendix A. Default Symbol Transformations">Default Symbol Transformations</a>.
</p><p>
This extension specifies the transformations to be applied when the <span class="emphasis"><em>
Control</em></span>
 or <span class="emphasis"><em>
Lock</em></span>
 modifiers are active but were not used to determine the keysym to be used:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Modifier</th><th align="left">Transformation</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
Control</em></span>
    </td><td align="left">Report the control character associated with the symbol. This
extension defines the control characters associated with the ASCII alphabetic
characters (both upper and lower case) and for a small set of punctuation
characters (see
<a class="link" href="#default_symbol_transformations" title="Appendix A. Default Symbol Transformations">Default Symbol Transformations</a>).
Applications are
free to associate control characters with any symbols that are not specified by
this extension.</td></tr><tr><td align="left"><span class="emphasis"><em>
Lock</em></span>
    </td><td align="left">Capitalize the symbol either according to capitalization rules
appropriate to the application locale or using the capitalization rules defined
by this extension (see <a class="link" href="#default_symbol_transformations" title="Appendix A. Default Symbol Transformations">Default Symbol Transformations</a>).</td></tr></tbody></table></div><p>
Interpretation of other modifiers is application dependent.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This definition of capitalization is fundamentally different from
the core protocol’s, which uses the lock modifier to select from the symbols
bound to the key. Consider key 9 in the
<a class="link" href="#Client_Map_Example" title="Client Map Example">client map example</a>;
the core protocol provides no way to generate the capital form
of either symbol bound to this key. XKB specifies that we first look up the
symbol and then capitalize, so XKB yields the capital form of the two symbols
when caps lock is active. </p></div><p>
XKB specifies the behavior of <span class="emphasis"><em>
Lock</em></span>
 and <span class="emphasis"><em>
Control</em></span>
, but interpretation of other modifiers is left to the application.
</p></div><div class="sect1" title="Client Map Example"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Client_Map_Example"></a>Client Map Example</h2></div></div></div><p>
Consider a simple, if unlikely, keyboard with the following keys (gray
characters indicate symbols that are implied or expected but are not actually
engraved on the key):
</p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-7.svg"></object></div><p>
The core protocol represents this keyboard as a simple array with one row per
key and four columns (the widest key, key 10, determines the width of the
entire array).
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></colgroup><thead><tr><th align="left">Key</th><th align="left">G1L1</th><th align="left">G1L2</th><th align="left">G2L1</th><th align="left">G2L2</th></tr></thead><tbody><tr><td align="left">8</td><td align="left">Q</td><td align="left">NoSymbol</td><td align="left">at</td><td align="left">NoSymbol</td></tr><tr><td align="left">9</td><td align="left">odiaeresis</td><td align="left">egrave</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td></tr><tr><td align="left">10</td><td align="left">A</td><td align="left">NoSymbol</td><td align="left">Æ</td><td align="left">NoSymbol</td></tr><tr><td align="left">11</td><td align="left">ssharp</td><td align="left">question</td><td align="left">backslash</td><td align="left">questiondown</td></tr><tr><td align="left">12</td><td align="left">KP_End</td><td align="left">KP_1</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td></tr><tr><td align="left">13</td><td align="left">Num_Lock</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td></tr><tr><td align="left">14</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td></tr><tr><td align="left">15</td><td align="left">Return</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td><td align="left">NoSymbol</td></tr></tbody></table></div><p>
The row to be used for a given key event is determined by keycode; the column
to be used is determined by the symbols bound to the key, the state of the
<span class="emphasis"><em>
Shift</em></span>
 and <span class="emphasis"><em>
Lock</em></span>
 Modifiers and the state of the modifiers bound to the <span class="emphasis"><em>
Num_Lock</em></span>
 and <span class="emphasis"><em>
Mode_switch</em></span>
 keys as specified by the core protocol.
</p><p>
The XKB description of this keyboard consists of six key symbol maps, each of
which specifies the types and symbols associated with each keyboard group for
one key:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Key</th><th align="left">Group: Type</th><th align="left">L1</th><th align="left">L2</th></tr></thead><tbody><tr><td align="left">8</td><td align="left">G1:	ALPHABETIC</td><td align="left">q</td><td align="left">Q</td></tr><tr><td align="left">G2:	ONE_LEVEL</td><td align="left">@</td><td align="left">NoSymbol</td><td class="auto-generated"> </td></tr><tr><td align="left">9</td><td align="left">G1:	TWO_LEVEL</td><td align="left">odiaeresis</td><td align="left">egrave</td></tr><tr><td align="left">10</td><td align="left">G1:	ALPHABETIC</td><td align="left">a</td><td align="left">A</td></tr><tr><td align="left">G2:	ALPHABETIC</td><td align="left">ae</td><td align="left">AE</td><td class="auto-generated"> </td></tr><tr><td align="left">11</td><td align="left">G1:	TWO_LEVEL</td><td align="left">ssharp</td><td align="left">question</td></tr><tr><td align="left">G2:	ONE_LEVEL</td><td align="left">backslash</td><td align="left">questiondown</td><td class="auto-generated"> </td></tr><tr><td align="left">12</td><td align="left">G1:	KEYPAD</td><td align="left">KP_End</td><td align="left">KP_1</td></tr><tr><td align="left">13</td><td align="left">G1:	ONE_LEVEL</td><td align="left">Num_Lock</td><td align="left"> </td></tr><tr><td align="left">14</td><td align="left">No Groups</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">15</td><td align="left">G1:	ONE_LEVEL</td><td align="left">Return</td><td align="left"> </td></tr></tbody></table></div><p>
The keycode reported in a key event determines the row to be used for that
event; the effective keyboard group determines the list of symbols and key type
to be used. The key type determines which symbol is chosen from the list.
</p><p>
<a class="link" href="#Determining_the_KeySym_Associated_with_a_Key_Event" title="Determining the KeySym Associated with a Key Event">Determining the KeySym Associated
with a Key Event</a> details the procedure to map from a key event to a
symbol and/or a string.
</p></div></div><div class="chapter" title="Chapter 8. Symbolic Names"><div class="titlepage"><div><div><h2 class="title"><a id="Symbolic_Names"></a>Chapter 8. Symbolic Names</h2></div></div></div><p>
The core protocol does not provide any information to clients other than that
actually used to interpret events. This makes it difficult to write a client
which presents the keyboard to a user in an easy-to-understand way. Such
applications have to examine the vendor string and keycodes to determine the
type of keyboard connected to the server and have to examine keysyms and
modifier mappings to determine the effects of most modifiers (the <span class="emphasis"><em>
Shift</em></span>
, <span class="emphasis"><em>
Lock</em></span>
 and <span class="emphasis"><em>
Control</em></span>
 modifiers are defined by the core protocol but no semantics are implied for
any other modifiers).
</p><p>
This extension provides such applications with symbolic names for most
components of the keyboard extension and a description of the physical layout
of the keyboard.
</p><p>
The <span class="emphasis"><em>
keycodes</em></span>
 name describes the range and meaning of the keycodes returned by the keyboard
in question; the <span class="emphasis"><em>
keyboard</em></span>
 <span class="emphasis"><em>
geometry </em></span>
name describes the physical location, size and shape of the various keys on the
keyboard. As an example to distinguish between these two names, consider
function keys on PC-compatible keyboards. Function keys are sometimes above the
main keyboard and sometimes to the left of the main keyboard, but the same
keycode is used for the key that is logically <span class="emphasis"><em>
F1</em></span>
 regardless of physical position. Thus, all PC-compatible keyboards might share
a keycodes name but different geometry names.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The keycodes name is intended to be a very general description of
the keycodes returned by a keyboard; A single keycodes name might cover
keyboards with differing numbers of keys provided that the keys that all keys
have the same semantics when present. For example, 101 and 102 key PC keyboards
might use the same name. Applications can use the keyboard geometry to
determine which subset of the named keyboard type is in use.</p></div><p>
The <span class="emphasis"><em>
symbols</em></span>
 name identifies the symbols bound to the keys. The symbols name is a human or
application-readable description of the intended locale or usage of the
keyboard with these symbols. The <span class="emphasis"><em>
physical symbols</em></span>
 name describes the symbols actually engraved on the keyboard, which might be
different than the symbols currently being used.
</p><p>
The <span class="emphasis"><em>
types</em></span>
 name provides some information about the set of key types that can be
associated with the keyboard keys. The <span class="emphasis"><em>
compat</em></span>
 name provides some information about the rules used to bind actions to keys
changed using core protocol requests.
</p><p>
The <span class="emphasis"><em>
compat</em></span>
, <span class="emphasis"><em>
types</em></span>
, <span class="emphasis"><em>
keycodes</em></span>
, <span class="emphasis"><em>
symbols</em></span>
 and <span class="emphasis"><em>
geometry</em></span>
 names typically correspond to the keyboard components from which the current
keyboard description was assembled. These components are stored individually in
the server’s database of keyboard components, described in
<a class="link" href="#The_Server_Database_of_Keyboard_Components" title="Chapter 13. The Server Database of Keyboard Components">
The Server Database of Keyboard
Components</a>, and can be combined to assemble a complete keyboard
description.
</p><p>
Each key has a four-byte symbolic name. The key name links keys with similar
functions or in similar positions on keyboards that report different scan
codes. <span class="emphasis"><em>
Key aliases</em></span>
 allow the keyboard layout designer to assign multiple names to a single key,
to make it easier to refer to keys using either their position <span class="emphasis"><em>
or</em></span>
 their "function."
</p><p>
For example, consider the common keyboard customizations:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Set the "key to the left of the letter a" to be a control key.
  </p></li><li class="listitem"><p>Change the "caps lock" key, wherever it might be, to a control key.
  </p></li></ul></div><p>
If we specify key names by position, the first customization is simple but the
second is impossible; if we specify key names by function, the second
customization is simple but the first is impossible. Using key aliases, we can
specify both function and position for "troublesome" keys, and both
customizations are straightforward.
</p><p>
Key aliases can be specified both in the symbolic names component and in the
keyboard geometry (see <a class="link" href="#Keyboard_Geometry" title="Chapter 11. Keyboard Geometry">Keyboard
Geometry</a>). Both sets of aliases are always valid, but key alias
definitions in the keyboard geometry have priority; if both symbolic names and
geometry include aliases, applications should consider the definitions from the
geometry before considering the definitions from the symbolic names section.
</p><p>
XKB provides symbolic names for each of the four keyboard groups, sixteen
virtual modifiers, thirty-two keyboard indicators, and up to <span class="emphasis"><em>
MaxRadioGroups</em></span>
 (32) radio groups.
</p><p>
XKB allows keyboard layout designers or editors to assign names to each key
type and to each of the levels in a key type. For example, the second position
on an alphabetic key might be called the "Caps" level while the second position
on a numeric keypad key might be called the "Num Lock" level.
</p></div><div class="chapter" title="Chapter 9. Keyboard Indicators"><div class="titlepage"><div><div><h2 class="title"><a id="Keyboard_Indicators"></a>Chapter 9. Keyboard Indicators</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Global_Information_About_Indicators">Global Information About Indicators</a></span></dt><dt><span class="sect1"><a href="#Per_Indicator_Information">Per-Indicator Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Indicator_Maps">Indicator Maps</a></span></dt></dl></dd></dl></div><p>
Although the core X protocol supports thirty-two LEDs on a keyboard, it does
not provide any way to link the state of the LEDs and the logical state of the
keyboard. For example, most keyboards have a "Caps Lock" LED, but X does not
provide any standard way to make the LED automatically follow the logical state
of the modifier bound to the <span class="emphasis"><em>
Caps Lock</em></span>
 key.
</p><p>
The core protocol also gives no way to determine which bits in the <span class="emphasis"><em>
led_mask</em></span>
 field of the keyboard state map to the particular LEDs on the keyboard. For
example, X does not provide a method for a client to determine which bit to set
in the <span class="emphasis"><em>
led_mask</em></span>
 to turn on the "Scroll Lock" LED, or even if the keyboard has a "Scroll Lock"
LED.
</p><p>
Most X servers implement some kind of automatic behavior for one or more of the
keyboard LEDs, but the details of that automatic behavior are
implementation-specific and can be difficult or impossible to control.
</p><p>
XKB provides indicator names and programmable indicators to help solve these
problems. Using XKB, clients can determine the names of the various indicators,
determine and control the way that the individual indicators should be updated
to reflect keyboard changes, and determine which of the 32 keyboard indicators
reported by the protocol are actually present on the keyboard. Clients may also
request immediate notification of changes to the state of any subset of the
keyboard indicators, which makes it straightforward to provide an on-screen
"virtual" LED panel.
</p><div class="sect1" title="Global Information About Indicators"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Global_Information_About_Indicators"></a>Global Information About Indicators</h2></div></div></div><p>
XKB provides only two pieces of information about the indicators as a group.
</p><p>
The <span class="emphasis"><em>
physical indicators</em></span>
 mask reports which of the 32 logical keyboard indicators supported by the core
protocol and XKB corresponds to some actual indicator on the keyboard itself.
Because the physical indicators mask describes a physical characteristic of the
keyboard, it cannot be directly changed under program control. It is possible,
however, for the set of physical indicators to be change if a new keyboard is
attached or if a completely new keyboard description is loaded by the <span class="emphasis"><em>
XkbGetKeyboardByName</em></span>
 request (see <a class="link" href="#Using_the_Servers_Database_of_Keyboard_Components" title="Using the Server’s Database of Keyboard Components">Using the Server’s
Database of Keyboard Components</a>).
</p><p>
The <span class="emphasis"><em>
indicator state</em></span>
 mask reports the current state of the 32 logical keyboard indicators. This
field and the core protocol indicator state (as reported by the <span class="emphasis"><em>
led-mask</em></span>
 field of the core protocol <span class="emphasis"><em>
GetKeyboardControl</em></span>
 request) are always identical.
</p></div><div class="sect1" title="Per-Indicator Information"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Per_Indicator_Information"></a>Per-Indicator Information</h2></div></div></div><p>
Each of the thirty-two keyboard indicators has a symbolic name, of type ATOM.
The <span class="emphasis"><em>
XkbGetNames</em></span>
 request reports the symbolic names for all keyboard components, including the
indicators. Use the <span class="emphasis"><em>
XkbSetNames</em></span>
 request to change symbolic names. Both requests are described in <a class="link" href="#Querying_and_Changing_Symbolic_Names" title="Querying and Changing Symbolic Names">Querying and Changing Symbolic
Names</a>.
</p><div class="sect2" title="Indicator Maps"><div class="titlepage"><div><div><h3 class="title"><a id="Indicator_Maps"></a>Indicator Maps</h3></div></div></div><p>
XKB also provides an <span class="emphasis"><em>
indicator map</em></span>
 for each of the thirty-two keyboard indicators; an indicator map specifies:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The conditions under which the keyboard modifier state affects the
indicator.
  </p></li><li class="listitem"><p>The conditions under which the keyboard group state affects the
indicator.
  </p></li><li class="listitem"><p>The conditions under which the state of the boolean controls affects
the indicator.
  </p></li><li class="listitem"><p>The effect (if any) of attempts to explicitly change the state of the
indicator using the core protocol <span class="emphasis"><em>
SetKeyboardControl</em></span>
 request.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
IM_NoAutomatic</em></span>
 is set in the <span class="emphasis"><em>
flags</em></span>
 field of an indicator map, that indicator never changes in response to changes
in keyboard state or controls, regardless of the values for the other fields of
the indicator map. If <span class="emphasis"><em>
IM_NoAutomatic</em></span>
 is not set in <span class="emphasis"><em>
flags</em></span>
, the other fields of the indicator map specify the automatic changes to the
indicator in response to changes in the keyboard state or controls.
</p><p>
The <span class="emphasis"><em>
which_groups</em></span>
 and the <span class="emphasis"><em>
groups</em></span>
 fields of an indicator map determine how the keyboard group state affects the
corresponding indicator. The <span class="emphasis"><em>
which_groups</em></span>
 field controls the interpretation of <span class="emphasis"><em>
groups</em></span>
 and may contain any one of the following values:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Value</th><th align="left">Interpretation of the Groups Field</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
IM_UseNone</em></span>
</td><td align="left">The <span class="emphasis"><em>
groups</em></span>
 field and the current keyboard group state are ignored.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseBase</em></span>
</td><td align="left">If <span class="emphasis"><em>
groups</em></span>
 is non-zero, the indicator is lit whenever the base keyboard group is
non-zero. If <span class="emphasis"><em>
groups</em></span>
 is zero, the indicator is lit whenever the base keyboard group is zero.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLatched</em></span>
</td><td align="left">If <span class="emphasis"><em>
groups</em></span>
 is non-zero, the indicator is lit whenever the latched keyboard group is
non-zero. If <span class="emphasis"><em>
groups</em></span>
 is zero, the indicator is lit whenever the latched keyboard group is
zero.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLocked</em></span>
</td><td align="left">The <span class="emphasis"><em>
groups</em></span>
 field is interpreted as a mask. The indicator is lit when the current locked
keyboard group matches one of the bits that are set in <span class="emphasis"><em>
groups</em></span>
.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseEffective</em></span>
</td><td align="left">The <span class="emphasis"><em>
groups</em></span>
 field is interpreted as a mask. The indicator is lit when the current
effective keyboard group matches one of the bits that are set in <span class="emphasis"><em>
groups</em></span>
.</td></tr></tbody></table></div><p>
The <span class="emphasis"><em>
which_mods</em></span>
 and <span class="emphasis"><em>
mods</em></span>
 fields of an indicator map determine how the state of the keyboard modifiers
affect the corresponding indicator. The <span class="emphasis"><em>
mods</em></span>
 field is an XKB modifier definition, as described in <a class="link" href="#Modifier_Definitions" title="Modifier Definitions">Modifier Definitions</a>, which can
specify both real and virtual modifiers. The mods field takes effect even if
some or all of the virtual indicators specified in <span class="emphasis"><em>
mods</em></span>
 are unbound.
</p><p>
The <span class="emphasis"><em>
which_mods</em></span>
 field can specify one or more components of the XKB keyboard state. The
corresponding indicator is lit whenever any of the real modifiers specified in
the <span class="emphasis"><em>
mask</em></span>
 field of the <span class="emphasis"><em>
mods</em></span>
 modifier definition are also set in any of the current keyboard state
components specified by the <span class="emphasis"><em>
which_mods</em></span>
. The <span class="emphasis"><em>
which_mods</em></span>
 field may have any combination of the following values:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Value</th><th align="left">Keyboard State Component To Be Considered</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
IM_UseBase</em></span>
</td><td align="left">Base modifier state</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLatched</em></span>
</td><td align="left">Latched modifier state</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLocked</em></span>
</td><td align="left">Locked modifier state</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseEffective</em></span>
</td><td align="left">Effective modifier state</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseCompat</em></span>
</td><td align="left">Modifier compatibility state</td></tr></tbody></table></div><p>
The <span class="emphasis"><em>
controls</em></span>
 field specifies a subset of the boolean keyboard controls (see <a class="link" href="#Boolean_Controls_and_The_EnabledControls_Control" title="&quot;Boolean&quot; Controls and The EnabledControls Control">"Boolean" Controls and The
EnabledControls Control</a>). The indicator is lit whenever any of the
boolean controls specified in <span class="emphasis"><em>
controls</em></span>
 are enabled.
</p><p>
An indicator is lit whenever any of the conditions specified by its indicator
map are met, unless overridden by the <span class="emphasis"><em>
IM_NoAutomatic</em></span>
 flag (described above) or an explicit indicator change (described below).
</p><div class="sect3" title="Effects of Explicit Changes on Indicators"><div class="titlepage"><div><div><h4 class="title"><a id="Effects_of_Explicit_Changes_on_Indicators"></a>Effects of Explicit Changes on Indicators</h4></div></div></div><p>
If the <span class="emphasis"><em>
IM_NoExplicit</em></span>
 flag is set in an indicator map, attempts to change the state of the indicator
are ignored.
</p><p>
If both <span class="emphasis"><em>
IM_NoExplicit</em></span>
 and <span class="emphasis"><em>
IM_NoAutomatic</em></span>
 are both absent from an indicator map, requests to change the state of the
indicator are honored but might be immediately superseded by automatic changes
to the indicator state which reflect changes to keyboard state or controls.
</p><p>
If the <span class="emphasis"><em>
IM_LEDDrivesKB</em></span>
 flag is set and the <span class="emphasis"><em>
IM_NoExplicit</em></span>
 flag is not, the keyboard state and controls are changed to reflect the other
fields of the indicator map, as described in the remainder of this section.
Attempts to explicitly change the value of an indicator for which <span class="emphasis"><em>
IM_LEDDrivesKB</em></span>
 is absent or for which <span class="emphasis"><em>
IM_NoExplicit</em></span>
 is present do not affect keyboard state or controls.
</p><p>
The effect on group state of changing an explicit indicator which drives the
keyboard is determined by the value of <span class="emphasis"><em>
which_groups</em></span>
 and <span class="emphasis"><em>
groups</em></span>
, as follows:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left"> which_groups</th><th align="left">New State</th><th align="left">Effect on Keyboard Group State</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
IM_UseNone</em></span>
, or <span class="emphasis"><em>
IM_UseBase</em></span>
</td><td align="left">On or Off</td><td align="left">No Effect</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLatched</em></span>
</td><td align="left">On</td><td align="left">The <span class="emphasis"><em>
groups</em></span>
 field is treated as a group mask. The keyboard group latch is changed to the
lowest numbered group specified in <span class="emphasis"><em>
groups</em></span>
; if <span class="emphasis"><em>
groups</em></span>
 is empty, the keyboard group latch is changed to zero.</td></tr><tr><td align="left">IM_UseLatched</td><td align="left">Off</td><td align="left">The <span class="emphasis"><em>
groups</em></span>
 field is treated as a group mask. If the indicator is explicitly extinguished,
keyboard group latch is changed to the lowest numbered group not specified in
<span class="emphasis"><em>
groups</em></span>
; if <span class="emphasis"><em>
groups</em></span>
 is zero, the keyboard group latch is set to the index of the highest legal
keyboard group.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLocked</em></span>
, or <span class="emphasis"><em>
IM_UseEffective</em></span>
</td><td align="left">On</td><td align="left">If the <span class="emphasis"><em>
groups</em></span>
 mask is empty, group is not changed, otherwise the locked keyboard group is
changed to the lowest numbered group specified in <span class="emphasis"><em>
groups</em></span>
.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLocked</em></span>
, or <span class="emphasis"><em>
IM_UseEffective</em></span>
</td><td align="left">Off</td><td align="left">Locked keyboard group is changed to the lowest numbered group that
is not specified in the <span class="emphasis"><em>
groups</em></span>
 mask, or to <span class="emphasis"><em>
Group1</em></span>
 if the <span class="emphasis"><em>
groups</em></span>
 mask contains all keyboard groups.</td></tr></tbody></table></div><p>
The effect on the keyboard modifiers of changing an explicit indicator which
drives the keyboard is determined by the values that are set in of <span class="emphasis"><em>
which_mods</em></span>
 and <span class="emphasis"><em>
mods</em></span>
, as follows:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">Set in which_mods</th><th align="left">New State</th><th align="left">Effect on Keyboard Modifiers</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
IM_UseBase</em></span>
</td><td align="left">On or Off</td><td align="left">No Effect</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLatched</em></span>
</td><td align="left">On</td><td align="left">Any modifiers specified in the <span class="emphasis"><em>
mask</em></span>
 field of <span class="emphasis"><em>
mods</em></span>
 are added to the latched modifiers.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLatched</em></span>
</td><td align="left">Off</td><td align="left">Any modifiers specified in the <span class="emphasis"><em>
mask</em></span>
 field of <span class="emphasis"><em>
mods</em></span>
 are removed from the latched modifiers.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLocked</em></span>
, <span class="emphasis"><em>
IM_UseCompat</em></span>
, or <span class="emphasis"><em>
IM_UseEffective</em></span>
</td><td align="left">On</td><td align="left">Any modifiers specified in the <span class="emphasis"><em>
mask</em></span>
 field of <span class="emphasis"><em>
mods</em></span>
 are added to the locked modifiers.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseLocked</em></span>
</td><td align="left">Off</td><td align="left">Any modifiers specified in the <span class="emphasis"><em>
mask</em></span>
 field of <span class="emphasis"><em>
mods</em></span>
 are removed from the locked modifiers.</td></tr><tr><td align="left"><span class="emphasis"><em>
IM_UseCompat</em></span>
, or <span class="emphasis"><em>
IM_UseEffective</em></span>
</td><td align="left">Off</td><td align="left">Any modifiers specified in the <span class="emphasis"><em>
mask</em></span>
 field of <span class="emphasis"><em>
mods</em></span>
 are removed from both the locked and latched modifiers.</td></tr></tbody></table></div><p>
Lighting an explicit indicator which drives the keyboard also enables all of
the boolean controls specified in the <span class="emphasis"><em>
controls</em></span>
 field of its indicator map. Explicitly extinguishing such an indicator
disables all of the boolean controls specified in <span class="emphasis"><em>
controls</em></span>
.
</p><p>
The effects of changing an indicator which drives the keyboard are cumulative;
it is possible for a single change to affect keyboard group, modifiers and
controls simultaneously.
</p><p>
If an indicator for which both the <span class="emphasis"><em>
IM_LEDDrivesKB</em></span>
 and <span class="emphasis"><em>
IM_NoAutomatic</em></span>
 flags are specified is changed, the keyboard changes specified above are
applied and the indicator is changed to reflect the state that was explicitly
requested. The indicator will remain in the new state until it is explicitly
changed again.
</p><p>
If the <span class="emphasis"><em>
IM_NoAutomatic</em></span>
 flag is not set for an indicator which drives the keyboard, the changes
specified above are applied and the state of the indicator is set to the values
specified by the indicator map. Note that it is possible in this case for the
indicator to end up in a different state than the one that was explicitly
requested. For example, an indicator with <span class="emphasis"><em>
which_mods</em></span>
 of <span class="emphasis"><em>
IM_UseBase</em></span>
 and <span class="emphasis"><em>
mods</em></span>
 of <span class="emphasis"><em>
Shift</em></span>
 is not extinguished if one of the <span class="emphasis"><em>
Shift</em></span>
 keys is physically depressed when the request to extinguish the indicator is
processed.
</p></div></div></div></div><div class="chapter" title="Chapter 10. Keyboard Bells"><div class="titlepage"><div><div><h2 class="title"><a id="Keyboard_Bells"></a>Chapter 10. Keyboard Bells</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Client_Notification_of_Bells">Client Notification of Bells</a></span></dt><dt><span class="sect1"><a href="#Disabling_Server_Generated_Bells">Disabling Server Generated Bells</a></span></dt><dt><span class="sect1"><a href="#Generating_Named_Bells">Generating Named Bells</a></span></dt><dt><span class="sect1"><a href="#Generating_Optional_Named_Bells">Generating Optional Named Bells</a></span></dt><dt><span class="sect1"><a href="#Forcing_a_Server_Generated_Bell">Forcing a Server Generated Bell</a></span></dt></dl></div><p>
The core protocol provides requests to control the pitch, volume and duration
of the keyboard bell and a request to explicitly sound the bell.
</p><p>
The X Keyboard Extension allows clients to disable the audible bell, attach a
symbolic name to a bell request or receive an event when the keyboard bell is
rung.
</p><div class="sect1" title="Client Notification of Bells"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Client_Notification_of_Bells"></a>Client Notification of Bells</h2></div></div></div><p>
Clients can ask to receive <span class="emphasis"><em>
XkbBellNotify</em></span>
 event when a bell is requested by a client or generated by the server. Bells
can be sounded due to core protocol <span class="emphasis"><em>
Bell</em></span>
 requests, X Input Extension <span class="emphasis"><em>
DeviceBell</em></span>
 requests, X Keyboard Extension <span class="emphasis"><em>
XkbBell</em></span>
 requests or for reasons internal to the server such as the XKB <span class="emphasis"><em>
AccessXFeedback</em></span>
 control.
</p><p>
Bell events caused by the <span class="emphasis"><em>
XkbBell</em></span>
 request or by the <span class="emphasis"><em>
AccessXFeedback</em></span>
 control include an optional window and symbolic name for the bell. If present,
the window makes it possible to provide some kind of visual indication of which
window caused the sound. The symbolic name can report some information about
the reason the bell was generated and makes it possible to generate a distinct
sound for each type of bell.
</p></div><div class="sect1" title="Disabling Server Generated Bells"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Disabling_Server_Generated_Bells"></a>Disabling Server Generated Bells</h2></div></div></div><p>
The global <span class="emphasis"><em>
AudibleBell</em></span>
 boolean control for a keyboard indicates whether bells sent to that device
should normally cause the server to generate a sound. Applications which
provide "sound effects" for the various named bells will typically disable the
server generation of bells to avoid burying the user in sounds.
</p><p>
When the <span class="emphasis"><em>
AudibleBell</em></span>
 control is active, all bells caused by core protocol <span class="emphasis"><em>
Bell</em></span>
 and X Input Extension <span class="emphasis"><em>
DeviceBell</em></span>
 requests cause the server to generate a sound, as do all bells generated by
the XKB <span class="emphasis"><em>
AccessXFeedback</em></span>
 control. Bells requested via the X<span class="emphasis"><em>
kbBell</em></span>
 request normally cause a server-generated sound, but clients can ask the
server not to sound the default keyboard bell.
</p><p>
When the <span class="emphasis"><em>
AudibleBell</em></span>
 control is disabled, the server generates a sound only for bells that are
generated using the <span class="emphasis"><em>
XkbBell</em></span>
 request and which specify forced delivery of the bell.
</p></div><div class="sect1" title="Generating Named Bells"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Generating_Named_Bells"></a>Generating Named Bells</h2></div></div></div><p>
The <span class="emphasis"><em>
XkbBell</em></span>
 request allows clients to specify a symbolic name which is reported in the
bell events they cause. Bells generated by the <span class="emphasis"><em>
AccessXFeedback</em></span>
 control of this extension also include a symbolic name, but all kinds of
feedback cause a single event even if they sound multiple tones.
</p><p>
The X server is permitted to use symbolic bell names (when present) to generate
sounds other than simple tones, but it is not required to do so.
</p><p>
Aside from those used by the XKB <span class="emphasis"><em>
AccessXFeedback</em></span>
 control (see <a class="link" href="#The_AccessXFeedback_Control" title="The AccessXFeedback Control">The AccessXFeedback
Control</a>), this extension does not specify bell names or their
interpretation.
</p></div><div class="sect1" title="Generating Optional Named Bells"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Generating_Optional_Named_Bells"></a>Generating Optional Named Bells</h2></div></div></div><p>
Under some circumstances, some kind of quiet audio feedback is useful, but a
normal keyboard bell is not. For example, a quiet "launch effect" can be
helpful to let the user know that an application has been started, but a loud
bell would simply be annoying.
</p><p>
To simplify generation of these kinds of effects, the <span class="emphasis"><em>
XkbBell</em></span>
 request allows clients to specify "event only" bells. The X server never
generates a normal keyboard bell for "event only" bells, regardless of the
setting of the global <span class="emphasis"><em>
AudibleBell</em></span>
 control.
</p><p>
If the X server generates different sounds depending bell name, it is permitted
to generate a sound even for "event only" bells. This field is intended simply
to weed out "normal" keyboard bells.
</p></div><div class="sect1" title="Forcing a Server Generated Bell"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Forcing_a_Server_Generated_Bell"></a>Forcing a Server Generated Bell</h2></div></div></div><p>
Occasionally, it is useful to force the server to generate a sound. For
example, a client could "filter" server bells, generating sound effects for
some but sounding the normal server bell for others. Such a client needs a way
to tell the server that the requested bell should be generated regardless of
the setting of the <span class="emphasis"><em>
AudibleBell</em></span>
 control.
</p><p>
To simplify this process, clients which call the <span class="emphasis"><em>
XkbBell</em></span>
 request can specify that a bell is forced. A forced bell always causes a
server generated sound and never causes a <span class="emphasis"><em>
XkbBellNotify</em></span>
 event. Because forced bells do not cause bell notify events, they have no
associated symbolic name or event window.
</p></div></div><div class="chapter" title="Chapter 11. Keyboard Geometry"><div class="titlepage"><div><div><h2 class="title"><a id="Keyboard_Geometry"></a>Chapter 11. Keyboard Geometry</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Shapes_and_Outlines">Shapes and Outlines</a></span></dt><dt><span class="sect1"><a href="#Sections">Sections</a></span></dt><dt><span class="sect1"><a href="#Doodads">Doodads</a></span></dt><dt><span class="sect1"><a href="#Keyboard_Geometry_Example">Keyboard Geometry Example</a></span></dt></dl></div><p>
The XKB description of a keyboard includes an optional keyboard geometry which
describes the physical appearance of the keyboard. Keyboard geometry describes
the shape, location and color of all keyboard keys or other visible keyboard
components such as indicators. The information contained in a keyboard geometry
is sufficient to allow a client program to draw an accurate two-dimensional
image of the keyboard.
</p><p>
The components of the keyboard geometry include the following:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A <span class="emphasis"><em>
symbolic name</em></span>
 to help users identify the keyboard.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
width</em></span>
 and <span class="emphasis"><em>
height</em></span>
 of the keyboard, in </p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-8.svg"></object></div><p>
. For non-rectangular keyboards, the width and height describe the smallest
bounding-box that encloses the outline of the keyboard.
  </p></li><li class="listitem"><p>A list of up to <span class="emphasis"><em>
MaxColors</em></span>
 (<span class="emphasis"><em>
32</em></span>
) <span class="emphasis"><em>
color names</em></span>
. A color name is a string whose interpretation is not specified by XKB. Other
geometry components refer to colors using their indices in this list.
  </p></li><li class="listitem"><p>The<span class="emphasis"><em>
 base color</em></span>
 of the keyboard is the predominant color on the keyboard and is used as the
default color for any components whose color is not explicitly specified.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
label color</em></span>
 is the color used to draw the labels on most of the keyboard keys.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
label font</em></span>
 is a string which describes the font used to draw labels on most keys; XKB
does not specify a format or name space for font names.
  </p></li><li class="listitem"><p>A list of <span class="emphasis"><em>
geometry properties</em></span>
. A geometry property associates an arbitrary string with an equally arbitrary
name. Geometry properties can be used to provide hints to programs that display
images of keyboards, but they are not interpreted by XKB. No other geometry
structures refer to geometry properties.
  </p></li><li class="listitem"><p>A list of <span class="emphasis"><em>
key aliases</em></span>
, as described in <a class="link" href="#Symbolic_Names" title="Chapter 8. Symbolic Names">Symbolic
Names</a>.
  </p></li><li class="listitem"><p>A list of <span class="emphasis"><em>
shapes</em></span>
; other keyboard components refer to shapes by their index in this list. A
shape consists of a name and one or more closed-polygons called <span class="emphasis"><em>
outlines</em></span>
. Shapes and outlines are described in detail in <a class="link" href="#Shapes_and_Outlines" title="Shapes and Outlines">Shapes and Outlines</a>.
  </p></li></ul></div><p>
Unless otherwise specified, geometry measurements are in </p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-9.svg"></object></div><p>

 units. The origin (0,0) is in the top left corner of the keyboard image. Some
geometry components can be drawn rotated; all such objects rotate about their
origin in </p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-10.svg"></object></div><p>

 increments.
</p><p>
All geometry components include a <span class="emphasis"><em>
priority</em></span>
, which indicates the order in which overlapping objects should be drawn.
Objects are drawn in order from highest priority (<span class="emphasis"><em>
0</em></span>
) to lowest (<span class="emphasis"><em>
255</em></span>
).
</p><p>
The description of the actual appearance of the keyboard is subdivided into
named <span class="emphasis"><em>
sections</em></span>
 of related keys and <span class="emphasis"><em>
doodads</em></span>
. A a <span class="emphasis"><em>
doodad</em></span>
 describes some visible aspect of the keyboard that is not a key. A section is
a collection of keys and doodads that are physically close together and
logically related.
</p><div class="sect1" title="Shapes and Outlines"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Shapes_and_Outlines"></a>Shapes and Outlines</h2></div></div></div><p>
An outline is a list of one or more points which describes a single
closed-polygon, as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A list with a single point describes a rectangle with one corner at the
origin of the shape (<span class="emphasis"><em>
0</em></span>
,<span class="emphasis"><em>
0</em></span>
) and the opposite corner at the specified point.
  </p></li><li class="listitem"><p>A list of two points describes a rectangle with one corner at the
position specified by the first point and the opposite corner at the position
specified by the second point.
  </p></li><li class="listitem"><p>A list of three or more points describes an arbitrary polygon. If
necessary, the polygon is automatically closed by connecting the last point in
the list with the first.
  </p></li><li class="listitem"><p>A non-zero value for the <span class="emphasis"><em>
cornerRadius</em></span>
 field specifies that the corners of the polygon should be drawn as circles
with the specified radius.
  </p></li></ul></div><p>
All points in an outline are specified relative to the origin of the enclosing
shape. Points in an outline may have negative values for the X and Y coordinate.
</p><p>
One outline (usually the first) is the primary outline; a keyboard display
application can generate a simpler but still accurate keyboard image by
displaying only the primary outlines for each shape. Non-rectangular keys must
include a rectangular <span class="emphasis"><em>
approximation</em></span>
 as one of the outlines associated with the shape; the approximation is not
normally displayed but can be used by very simple keyboard display applications
to generate a recognizable but degraded image of the keyboard.
</p></div><div class="sect1" title="Sections"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sections"></a>Sections</h2></div></div></div><p>
Each section has its own coordinate system — if a section is rotated, the
coordinates of any components within the section are interpreted relative to
the edges that were on the top and left before rotation. The components that
make up a section include:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A list of <span class="emphasis"><em>
rows</em></span>
. A row is a list of horizontally or vertically adjacent keys. Horizontal rows
parallel the (pre-rotation) top of the section and vertical rows parallel the
(pre-rotation) left of the section. All keys in a horizontal row share a common
top coordinate; all keys in a vertical row share a left coordinate.
  </p><p>
A key description consists of a key <span class="emphasis"><em>
name</em></span>
, a <span class="emphasis"><em>
shape</em></span>
, a key <span class="emphasis"><em>
color</em></span>
, and a <span class="emphasis"><em>
gap</em></span>
. The key <span class="emphasis"><em>
name</em></span>
 should correspond to one of the keys named in the keyboard names description,
the <span class="emphasis"><em>
shape</em></span>
 specifies the appearance of the key, and the key <span class="emphasis"><em>
color</em></span>
 specifies the color of the key (not the label on the key). Keys are normally
drawn immediately adjacent to one another from left-to-right (or top-to-bottom)
within a row. The <span class="emphasis"><em>
gap</em></span>
 field specifies the distance between a key and its predecessor.
  </p></li><li class="listitem"><p>An optional list of doodads; any type of doodad can be enclosed within
a section. Position and angle of rotation are relative to the origin and angle
of rotation of the sections that contain them. Priority is relative to the
other components of the section, not to the keyboard as a whole.
  </p></li><li class="listitem"><p>An optional list of <span class="emphasis"><em>
overlay keys</em></span>
. Each overlay key definition indicates a key that can yield multiple scan
codes and consists of a field named <span class="emphasis"><em>
under</em></span>
, which specifies the primary name of the key and a field named <span class="emphasis"><em>
over</em></span>
, which specifies the name for the key when the overlay keycode is selected.
The key specified in <span class="emphasis"><em>
under</em></span>
 must be a member of the section that contains the overlay key definition,
while the key specified in over must not.
  </p></li></ul></div></div><div class="sect1" title="Doodads"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Doodads"></a>Doodads</h2></div></div></div><p>
Doodads can be global to the keyboard or part of a section. Doodads have
symbolic names of arbitrary length. The only doodad name whose interpretation
is specified by XKB is "Edges", which describes the outline of the entire
keyboard, if present.
</p><p>
All doodads report their origin in fields named <span class="emphasis"><em>
left</em></span>
 and <span class="emphasis"><em>
top</em></span>
. XKB supports five kinds of doodads:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>An <span class="emphasis"><em>
indicator doodad</em></span>
 describes one of the physical keyboard indicators. Indicator doodads specify
the shape of the indicator, the indicator color when it is lit (<span class="emphasis"><em>
on_color</em></span>
) and the indicator color when it is dark (<span class="emphasis"><em>
off_color</em></span>
).
  </p></li><li class="listitem"><p>An <span class="emphasis"><em>
outline doodad</em></span>
 describes some aspect of the keyboard to be drawn as one or more hollow,
closed polygons. Outline doodads specify the shape, color, and angle of
rotation about the doodad origin at which they should be drawn.
  </p></li><li class="listitem"><p>A <span class="emphasis"><em>
solid doodad</em></span>
 describes some aspect of the keyboard to be drawn as one or more filled
polygons. Solid doodads specify the shape, color and angle of rotation about
the doodad origin at which they should be drawn.
  </p></li><li class="listitem"><p>A <span class="emphasis"><em>
text doodad</em></span>
 describes a text label somewhere on the keyboard. Text doodads specify the
label string, the font and color to use when drawing the label, and the angle
of rotation of the doodad about its origin.
  </p></li><li class="listitem"><p>A <span class="emphasis"><em>
logo doodad</em></span>
 is a catch-all, which describes some other visible element of the keyboard. A
logo doodad is essentially an outline doodad with an additional symbolic name
that describes the element to be drawn.
  </p><p>
If a keyboard display program recognizes the symbolic name, it can draw
something appropriate within the bounding region of the shape specified in the
doodad. If the symbolic name does not describe a recognizable image, it should
draw an outline using the specified shape, outline, and angle of rotation.
  </p><p>
The XKB extension does not specify the interpretation of logo names.
  </p></li></ul></div></div><div class="sect1" title="Keyboard Geometry Example"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Keyboard_Geometry_Example"></a>Keyboard Geometry Example</h2></div></div></div><p>
Consider the following example keyboard:
</p><div class="mediaobject"><object type="image/svg+xml" data="XKBproto-11.svg"></object></div><p>
This keyboard has six sections: The left and right function sections (at the
very top) each have one horizontal row with eight keys. The left and right
alphanumeric sections (the large sections in the middle) each have six vertical
rows, with four or five keys in each row. The left and right editing sections
each have three vertical rows with one to three keys per row; the left editing
section is rotated 20° clockwise about its origin while the right editing
section is rotated 20° counterclockwise.
</p><p>
This keyboard has four global doodads: Three small, round indicators and a
rectangular logo. The program which generated this image did not recognize the
logo, so it displays an outline with an appropriate shape in its place.
</p><p>
This keyboard has seven shapes: All of the keys in the two function sections
use the "FKEY" shape. Most of the keys in the alphanumeric sections, as well as
four of the keys in each of the editing sections use the "NORM" shape. The keys
in the first column of the left alphanumeric section and the last column of the
right alphanumeric section all use the "WIDE" shape. Two keys in each of the
editing sections use the "TALL" shape. The "LED" shape describes the three
small, round indicators between the function and alphabetic sections. The
"LOGO" shape describes the keyboard logo, and the "EDGE" shape describes the
outline of the keyboard as a whole.
</p><p>
The keyboard itself is white, as are all of the keys except for the eight keys
that make up the home row, which use the "grey20" color. It isn’t really
visible in this picture, but the three indicators have an "on" color of "green"
and are "green30" when they are turned off. The keys in the alphanumeric and
editing sections all have a (vertical) gap of 0.5mm; the keys in the two
function sections have a (horizontal) gap of 3mm.
</p><p>
Many of the keys in the right alphanumeric section, and the rightmost key in
the right editing section are drawn with two names in this image. Those are
overlay keys; the bottom key name is the normal name while the overlay name is
printed at the top. For example, the right editing section has a single overlay
key entry, which specifies an <span class="emphasis"><em>
under</em></span>
 name of <span class="emphasis"><em>
&lt;SPCE&gt;</em></span>
 and an <span class="emphasis"><em>
over</em></span>
 name of <span class="emphasis"><em>
&lt;KP0&gt;</em></span>
, which indicates that the key in question is usually the shift key, but can
behave like the <span class="emphasis"><em>
0</em></span>
 key on the numeric keypad when an overlay is active.
</p></div></div><div class="chapter" title="Chapter 12. Interactions Between XKB and the Core Protocol"><div class="titlepage"><div><div><h2 class="title"><a id="Interactions_Between_XKB_and_the_Core_Protocol"></a>Chapter 12. Interactions Between XKB and the Core Protocol</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Group_Compatibility_Map">Group Compatibility Map</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Setting_a_Passive_Grab_for_an_XKB_State">Setting a Passive Grab for an XKB State</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Changing_the_Keyboard_Mapping_Using_the_Core_Protocol">Changing the Keyboard Mapping Using the Core Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Explicit_Keyboard_Mapping_Components">Explicit Keyboard Mapping Components</a></span></dt><dt><span class="sect2"><a href="#Assigning_Symbols_To_Groups">Assigning Symbols To Groups</a></span></dt><dt><span class="sect2"><a href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key">Assigning Types To Groups of Symbols for a Key</a></span></dt><dt><span class="sect2"><a href="#Assigning_Actions_To_Keys">Assigning Actions To Keys</a></span></dt><dt><span class="sect2"><a href="#Updating_Everything_Else">Updating Everything Else</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Effects_of_XKB_on_Core_Protocol_Events">Effects of XKB on Core Protocol Events</a></span></dt><dt><span class="sect1"><a href="#Effect_of_XKB_on_Core_Protocol_Requests">Effect of XKB on Core Protocol Requests</a></span></dt><dt><span class="sect1"><a href="#Sending_Events_to_Clients">Sending Events to Clients</a></span></dt></dl></div><p>
In addition to providing a number of new requests, XKB replaces or extends
existing core protocol requests and events. Some aspects of the this extension,
such as the ability to lock any key or modifier, are visible even to clients
that are unaware of the XKB extension. Other capabilities, such as control of
keysym selection on a per-key basis, are available only to XKB-aware clients.
</p><p>
Though they do not have access to some advanced extension capabilities, the XKB
extension includes compatibility mechanisms to ensure that non-XKB clients
behave as expected and operate at least as well with an XKB-capable server as
they do today.
</p><p>
There are a few significant areas in which XKB state and mapping differences
might be visible to XKB-unaware clients:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The core protocol uses a modifier to choose between two keyboard
groups, while this extension provides explicit support for multiple groups.
  </p></li><li class="listitem"><p>The order of the symbols associated with any given key by XKB might not
match the ordering demanded by the core protocol.
  </p></li></ul></div><p>
To minimize problems that might result from these differences, XKB includes
ways to specify the correspondence between core protocol and XKB modifiers and
symbols.
</p><p>
This section describes the differences between the core X protocol’s notion
of a keyboard mapping and XKB and explains the ways they can interact.
</p><div class="sect1" title="Group Compatibility Map"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Group_Compatibility_Map"></a>Group Compatibility Map</h2></div></div></div><p>
As described in <a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">Keyboard
State</a>, the current keyboard group is reported to XKB-aware clients in
bits 13-14 of the state field of many core protocol events. XKB-unaware clients
cannot interpret those bits, but they might use a keyboard modifier to
implement support for a single keyboard group. To ensure that pre-XKB clients
continue to work when XKB is present, XKB makes it possible to map an XKB state
field, which includes both keyboard group and modifier state into a pre-XKB
state field which contains only modifiers.
</p><p>
A keyboard description includes one <span class="emphasis"><em>
group compatibility map</em></span>
 per keyboard group (four in all). Each such map is a modifier definition (i.e.
specifies both real and virtual modifiers) which specifies the modifiers to be
set in the compatibility states when the corresponding keyboard group is
active. Here are a few examples to illustrate the application of the group
compatibility map:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /></colgroup><thead><tr><th align="left">Group</th><th align="left">GroupCompat Map</th><th align="left">Effective Modifiers</th><th align="left"> State for XKB Clients</th><th align="left">Compatibility Modifiers</th><th align="left">State for non-XKB Clients</th></tr></thead><tbody><tr><td align="left">1</td><td align="left">Group1=None</td><td align="left">Shift</td><td align="left">x00xxxxx00000001</td><td align="left">Shift</td><td align="left">xxxxxxxx00000001</td></tr><tr><td align="left">2</td><td align="left">Group2=Mod3</td><td align="left">None</td><td align="left">x01xxxxx00000000</td><td align="left">Mod3</td><td align="left">xxxxxxxx00100000</td></tr><tr><td align="left">3</td><td align="left">Group3=Mod2</td><td align="left">Shift</td><td align="left">x10xxxxx00000001</td><td align="left">Shift+Mod2</td><td align="left">xxxxxxxx00010001</td></tr><tr><td align="left">4</td><td align="left">Group4=None</td><td align="left">Control</td><td align="left">x11xxxxx00000100</td><td align="left">Control</td><td align="left">xxxxxxxx00000100</td></tr></tbody></table></div><p>
Note that non-XKB clients (i.e. clients that are linked with a version of the X
library that does not support XKB) cannot detect the fact that <span class="emphasis"><em>
Group4</em></span>
 is active in this example because the group compatibility map for <span class="emphasis"><em>
Group4</em></span>
 does not specify any modifiers.
</p><div class="sect2" title="Setting a Passive Grab for an XKB State"><div class="titlepage"><div><div><h3 class="title"><a id="Setting_a_Passive_Grab_for_an_XKB_State"></a>Setting a Passive Grab for an XKB State</h3></div></div></div><p>
The fact that the <span class="emphasis"><em>
state</em></span>
 field of an event might look different when XKB is present can cause problems
with passive grabs. Existing clients specify the modifiers they wish to grab
using the rules defined by the core protocol, which use a normal modifier to
indicate keyboard group. If we used an XKB state field, the high bits of the
state field would be non-zero whenever the keyboard was in any group other than
<span class="emphasis"><em>
Group1</em></span>
, and none of the passive grabs set by clients could ever be triggered.
</p><p>
To avoid this behavior, the X server normally uses the compatibility grab state
to decide whether or not to activate a passive grab, even for XKB-aware
clients. The group compatibility map attempts to encode the keyboard group in
one or more modifiers of the compatibility state, so existing clients continue
to work exactly the way they do today. By default, there is no way to directly
specify a keyboard group in a <span class="emphasis"><em>
Grabbed</em></span>
 or <span class="emphasis"><em>
GrabButton</em></span>
 request, but groups can be specified indirectly by correctly adjusting the
group compatibility map.
</p><p>
Clients that wish to specify an XKB keyboard state, including a separate
keyboard group, can set the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client flag which indicates that all subsequent key and button grabs from
the requesting clients are specified using an XKB state.
</p><p>
Whether the XKB or core state should be used to trigger a grab is determined by
the setting of the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 flag for the requesting client at the time the key or button is grabbed. There
is no way to change the state to be used for a grab that is already registered
or for grabs that are set by some other client.
</p></div></div><div class="sect1" title="Changing the Keyboard Mapping Using the Core Protocol"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Changing_the_Keyboard_Mapping_Using_the_Core_Protocol"></a>Changing the Keyboard Mapping Using the Core Protocol</h2></div></div></div><p>
An XKB keyboard description includes a lot of information that is not present
in the core protocol description of a keyboard. Whenever a client remaps the
keyboard using core protocol requests, XKB examines the map to determine likely
default values for the components that cannot be specified using the core
protocol.
</p><p>
Some aspects of this automatic mapping are configurable, and make it fairly
easy to take advantage of many XKB features using existing tools like <span class="emphasis"><em>
xmodmap</em></span>
, but much of the process of mapping a core keyboard description into an XKB
description is designed to preserve compatible behavior for pre-XKB clients and
cannot be redefined by the user. Clients or users that want behavior that
cannot be described using this mapping should use XKB functions directly.
</p><div class="sect2" title="Explicit Keyboard Mapping Components"><div class="titlepage"><div><div><h3 class="title"><a id="Explicit_Keyboard_Mapping_Components"></a>Explicit Keyboard Mapping Components</h3></div></div></div><p>
This automatic remapping might accidentally replace definitions that were
explicitly requested by an application, so the XKB keyboard description defines
a set of <span class="emphasis"><em>
explicit components</em></span>
 for each key; any components that are listed in the explicit components for a
key are not changed by the automatic keyboard mapping. The explicit components
field for a key can contain any combination of the following values:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Bit in Explicit Mask</th><th align="left">Protects Against</th></tr></thead><tbody><tr><td align="left">ExplicitKeyType1</td><td align="left">Automatic determination of the key type associated with <span class="emphasis"><em>
Group1</em></span>
 (see <a class="link" href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key" title="Assigning Types To Groups of Symbols for a Key">Assigning Types To Groups of
Symbols for a Key</a>)</td></tr><tr><td align="left">ExplicitKeyType2</td><td align="left">Automatic determination of the key type associated with <span class="emphasis"><em>
Group2 </em></span>
(see <a class="link" href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key" title="Assigning Types To Groups of Symbols for a Key">Assigning Types To Groups of
Symbols for a Key</a>)</td></tr><tr><td align="left">ExplicitKeyType3</td><td align="left">Automatic determination of the key type associated with <span class="emphasis"><em>
Group3 </em></span>
(see <a class="link" href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key" title="Assigning Types To Groups of Symbols for a Key">Assigning Types To Groups of
Symbols for a Key</a>).</td></tr><tr><td align="left">ExplicitKeyType4</td><td align="left">Automatic determination of the key type associated with <span class="emphasis"><em>
Group4 </em></span>
(see <a class="link" href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key" title="Assigning Types To Groups of Symbols for a Key">Assigning Types To Groups of
Symbols for a Key</a>).</td></tr><tr><td align="left">ExplicitInterpret</td><td align="left">Application of any of the fields of a symbol interpretation to the
key in question (see <a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning
Actions To Keys</a>).</td></tr><tr><td align="left">ExplicitAutoRepeat</td><td align="left">Automatic determination of autorepeat status for the key, as
specified in a symbol interpretation (see <a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning Actions To
Keys</a>).</td></tr><tr><td align="left">ExplicitBehavior</td><td align="left">Automatic assignment of the <span class="emphasis"><em>
KB_Lock</em></span>
 behavior to the key, if the <span class="emphasis"><em>
LockingKey</em></span>
 flag is set in a symbol interpretation (see <a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning Actions To
Keys</a>).</td></tr><tr><td align="left">ExplicitVModMap</td><td align="left">Automatic determination of the virtual modifier map for the key
based on the actions assigned to the key and the symbol interpretations which
match the key (see <a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning
Actions To Keys</a>).</td></tr></tbody></table></div></div><div class="sect2" title="Assigning Symbols To Groups"><div class="titlepage"><div><div><h3 class="title"><a id="Assigning_Symbols_To_Groups"></a>Assigning Symbols To Groups</h3></div></div></div><p>
The first step in applying the changes specified by a core protocol <span class="emphasis"><em>
ChangeKeyboardMapping</em></span>
 request to the XKB description of a keyboard is to determine the number of
groups that are defined for the key and the width of each group. The XKB
extension does not change key types in response to core protocol <span class="emphasis"><em>
SetModifierMapping</em></span>
 requests, but it does choose key actions as described in <a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning Actions To Keys</a>.
</p><p>
Determining the number of symbols required for each group is straightforward.
If the key type for some group is not protected by the corresponding <span class="emphasis"><em>
ExplicitKeyType</em></span>
 component, that group has two symbols. If any of the explicit components for
the key include <span class="emphasis"><em>
ExplicitKeyType3</em></span>
 or <span class="emphasis"><em>
ExplicitKeyType4</em></span>
, the width of the key type currently assigned to that group determines the
number of symbols required for the group in the core protocol keyboard
description. The explicit type components for <span class="emphasis"><em>
Group1</em></span>
 and <span class="emphasis"><em>
Group2</em></span>
 behave similarly, but for compatibility reasons the first two groups must have
at least two symbols in the core protocol symbol mapping. Even if an explicit
type assigned to either of the first two keyboard groups has fewer than two
symbols, XKB requires two symbols for it in the core keyboard description.
</p><p>
If the core protocol request contains fewer symbols than XKB needs, XKB adds
trailing <span class="emphasis"><em>
NoSymbol</em></span>
 keysyms to the request to pad it to the required length. If the core protocol
request includes more symbols than it needs, XKB truncates the list of keysyms
to the appropriate length.
</p><p>
Finally, XKB divides the symbols from the (possibly padded or truncated) list
of symbols specified by the core protocol request among the four keyboard
groups. In most cases, the symbols for each group are taken from the core
protocol definition in sequence (i.e. the first pair of symbols is assigned to
<span class="emphasis"><em>
Group1</em></span>
, the second pair of symbols is assigned to <span class="emphasis"><em>
Group2</em></span>
, and so forth). If either <span class="emphasis"><em>
Group1</em></span>
 or <span class="emphasis"><em>
Group2</em></span>
 has an explicitly defined key type with a width other than two, it gets a
little more complicated.
</p><div class="sect3" title="Assigning Symbols to Groups One and Two with Explicitly Defined Key Types"><div class="titlepage"><div><div><h4 class="title"><a id="Assigning_Symbols_to_Groups_One_and_Two_with_Explicitly_Defined_Key_Types"></a>Assigning Symbols to Groups One and Two with Explicitly Defined Key Types</h4></div></div></div><p>
The server assigns the first four symbols from the expanded or truncated map to
the symbol positions <span class="emphasis"><em>G1L1</em></span> , <span class="emphasis"><em>G1L2</em></span>,
<span class="emphasis"><em>G2L1</em></span> and <span class="emphasis"><em>G2L2</em></span>, respectively. If the key
type assigned to <span class="emphasis"><em>Group1</em></span> reports more than two shift levels,
the fifth and following symbols contain
the extra keysyms for <span class="emphasis"><em>
Group2</em></span>
. If the key type assigned to <span class="emphasis"><em>
Group2</em></span>
 reports more than two shift levels, the extra symbols follow the symbols (if
any) for <span class="emphasis"><em>
Group1</em></span>
 in the core protocol list of symbols. Symbols for <span class="emphasis"><em>
Group3</em></span>
 and <span class="emphasis"><em>
Group4</em></span>
 are contiguous and follow the extra symbols, if any, for <span class="emphasis"><em>
Group1</em></span>
 and <span class="emphasis"><em>
Group2</em></span>
.
</p><p>
For example, consider a key with a key type that returns three shift levels
bound to each group. The symbols bound to the core protocol are assigned in
sequence to the symbol positions:
</p><pre class="literallayout">
<span class="emphasis"><em>G1L1</em></span>, <span class="emphasis"><em>G1L2</em></span>, <span class="emphasis"><em>G2L1</em></span>, <span class="emphasis"><em>G2L2</em></span>, <span class="emphasis"><em>G1L3</em></span>, <span class="emphasis"><em>G2L3</em></span>, <span class="emphasis"><em>G3L1</em></span>, <span class="emphasis"><em>G3L2</em></span>, <span class="emphasis"><em>G3L3</em></span>, <span class="emphasis"><em>G4L1</em></span>, <span class="emphasis"><em>G4L2</em></span>, and <span class="emphasis"><em>G4L3</em></span>
</pre><p>
For a key with a width one key type on group one, a width two key type on group
two and a width three key type on group three, the symbols bound to the key by
the core protocol are assigned to the following key positions:
</p><pre class="literallayout">
<span class="emphasis"><em>G1L1</em></span>, (<span class="emphasis"><em>G1L2</em></span>), <span class="emphasis"><em>G2L1</em></span>, <span class="emphasis"><em>G2L2</em></span>, <span class="emphasis"><em>G3L1</em></span>, <span class="emphasis"><em>G3L2</em></span>, <span class="emphasis"><em>G3L3</em></span>
</pre><p>
Note that the second and fourth symbols (positions <span class="emphasis"><em>
G1L2 and G2L2</em></span>
) can never be generated if the key type associated with the group yields only
one symbol. XKB accepts and ignores them in order to maintain compatibility
with the core protocol.
</p></div></div><div class="sect2" title="Assigning Types To Groups of Symbols for a Key"><div class="titlepage"><div><div><h3 class="title"><a id="Assigning_Types_To_Groups_of_Symbols_for_a_Key"></a>Assigning Types To Groups of Symbols for a Key</h3></div></div></div><p>
Once the symbols specified by <span class="emphasis"><em>
ChangeKeyboardMapping</em></span>
 have been assigned to the four keyboard groups for a key, the X server assigns
a key type to each group on the key from a canonical list of key types. The
first four key types in any keyboard map are reserved for these standard key
types:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Key Type Name</th><th align="left">Standard Definition</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
ONE_LEVEL</em></span>
</td><td align="left">Describes keys that have exactly one symbol per group. Most special
or function keys (such as <span class="emphasis"><em>
Return</em></span>
) are <span class="emphasis"><em>
ONE_LEVEL</em></span>
 keys. Any combination of modifiers yields level <span class="emphasis"><em>
0</em></span>
. Index <span class="emphasis"><em>
0</em></span>
 in any key symbol map specifies key type <span class="emphasis"><em>
ONE_LEVEL</em></span>
.</td></tr><tr><td align="left"><span class="emphasis"><em>
TWO_LEVEL</em></span>
</td><td align="left">Describes non-keypad and non-alphabetic keys that have exactly two
symbols per group. By default, the <span class="emphasis"><em>
TWO_LEVEL</em></span>
 type yields column <span class="emphasis"><em>
1</em></span>
 if the Shift modifier is set, column <span class="emphasis"><em>
0</em></span>
 otherwise. Index <span class="emphasis"><em>
1</em></span>
 in any key symbol map specifies key type <span class="emphasis"><em>
TWO_LEVEL</em></span>
.</td></tr><tr><td align="left"><span class="emphasis"><em>
ALPHABETIC</em></span>
</td><td align="left">Describes alphabetic keys that have exactly two symbols per group.
The default definition of the <span class="emphasis"><em>
ALPHABETIC</em></span>
 type provides shift-cancels-caps behavior as described in <a class="link" href="#Key_Types" title="Key Types">Key Types</a>. Index <span class="emphasis"><em>
2</em></span>
 in any key symbol map specifies key type <span class="emphasis"><em>
ALPHABETIC</em></span>
.</td></tr><tr><td align="left"><span class="emphasis"><em>
KEYPAD</em></span>
</td><td align="left">Describes numeric keypad keys with two symbols per group. Yields
column <span class="emphasis"><em>
1</em></span>
 if either of the <span class="emphasis"><em>
Shift</em></span>
 modifier or the real modifier bound to the virtual modifier named <span class="emphasis"><em>
NumLock</em></span>
 are set. Yields column <span class="emphasis"><em>
0</em></span>
 if neither or both modifiers are set. Index <span class="emphasis"><em>
3</em></span>
 in any key symbol map specifies key type <span class="emphasis"><em>
KEYPAD</em></span>
.</td></tr></tbody></table></div><p>
Users or applications may change these key types to get different default
behavior (to make shift cancel caps lock, for example) but they must always
have the specified number of symbols per group.
</p><p>
Before assigning key types to groups, the X server expands any alphanumeric
symbol definitions as follows:
</p><p>
If the second symbol of either group is <span class="emphasis"><em>
NoSymbol</em></span>
 and the first symbol of that group is an alphabetic keysym for which both
lowercase and uppercase forms are defined, the X server treats the key as if
the first element of the group were the lowercase form of the symbol and the
second element were the uppercase form of the symbol. For the purposes of this
expansion, XKB ignores the locale and uses the capitalization rules defined in
<a class="link" href="#default_symbol_transformations" title="Appendix A. Default Symbol Transformations">Default Symbol Transformations</a>.
</p><p>
For each keyboard group that does not have an explicit type definition, XKB
chooses a key type from the canonical key types. If the second symbol assigned
to a group is <span class="emphasis"><em>
NoSymbol</em></span>
 (after alphabetic expansion), the server assigns key type <span class="emphasis"><em>
ONE_LEVEL</em></span>
. If the group contains the lowercase and uppercase forms of a single glyph
(after alphanumeric expansion), the server assigns key type <span class="emphasis"><em>
ALPHABETIC</em></span>
. If either of the symbols in a group is a numeric keypad keysym (<span class="emphasis"><em>
KP_*</em></span>
), the server assigns key type <span class="emphasis"><em>
KEYPAD</em></span>
. Otherwise, it assigns key type <span class="emphasis"><em>
TWO_LEVEL</em></span>
.
</p><p>
Finally, XKB determines the number of groups of symbols that are actually
defined for the key. Trailing empty groups (i.e. groups that have <span class="emphasis"><em>
NoSymbol</em></span>
 in all symbol positions) are ignored.
</p><p>
There are two last special cases for compatibility with the core protocol: If,
after trailing empty groups are excluded, all of the groups of symbols bound to
the key have identical type and symbol bindings, XKB assigns only one group to
the key. If <span class="emphasis"><em>
Group2</em></span>
 is empty and either of <span class="emphasis"><em>
Group3</em></span>
 or <span class="emphasis"><em>
Group4</em></span>
 are not, and if neither <span class="emphasis"><em>
Group1</em></span>
 nor <span class="emphasis"><em>
Group2</em></span>
 have explicit key types, XKB copies the symbols and key type from <span class="emphasis"><em>
Group1</em></span>
 into <span class="emphasis"><em>
Group2</em></span>
.
</p></div><div class="sect2" title="Assigning Actions To Keys"><div class="titlepage"><div><div><h3 class="title"><a id="Assigning_Actions_To_Keys"></a>Assigning Actions To Keys</h3></div></div></div><p>
Once symbols have been divided into groups and key types chosen for the keys
affected by a <span class="emphasis"><em>
ChangeKeyboardMapping</em></span>
 request, XKB examines the symbols and modifier mapping for each changed key
and assigns server actions where appropriate. XKB also automatically assigns
server actions to changed keys if the client issues a core protocol <span class="emphasis"><em>
SetModifierMapping</em></span>
 request, and does so optionally in response to <span class="emphasis"><em>
XkbSetMap</em></span>
 and <span class="emphasis"><em>
XkbSetCompatMap</em></span>
 requests.
</p><p>
The compatibility map includes a list of <span class="emphasis"><em>
symbol interpretations</em></span>
, which XKB compares to each symbol associated with any changed keys in turn,
unless the <span class="emphasis"><em>
ExplicitInterp</em></span>
 component is set for a key. Setting the <span class="emphasis"><em>
ExplicitInterp</em></span>
 component prevents the application of symbol interpretations to that key.
</p><p>
If the modifiers and keysym specified in a symbol interpretation match the
modifier mapping and a symbol bound to a changed key that is not protected by
<span class="emphasis"><em>
ExplicitInterp</em></span>
, the server applies the symbol interpretation to the symbol position. The
server considers all symbol interpretations which specify an explicit keysym
before considering any that do not. The server uses the first interpretation
which matches the given combination of keysym and modifier mapping; other
matching interpretations are ignored.
</p><p>
XKB uses four of the fields of a symbol interpretation to decide if it matches
one of the symbols bound to some changed key:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
symbol</em></span>
 field is a keysym which matches if it has the value <span class="emphasis"><em>
NoSymbol</em></span>
 or is identical to the symbol in question.
  </p></li><li class="listitem"><p>The modifiers specified in the <span class="emphasis"><em>
mods</em></span>
 field are compared to the modifiers affected by the key in question as
indicated by <span class="emphasis"><em>
match</em></span>
.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
match</em></span>
 field can specify any of the comparisons: <span class="emphasis"><em>
NoneOf</em></span>
, <span class="emphasis"><em>
AnyOfOrNone</em></span>
, <span class="emphasis"><em>
AnyOf</em></span>
, <span class="emphasis"><em>
AllOf</em></span>
 or <span class="emphasis"><em>
Exactly</em></span>
.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
levelOneOnly</em></span>
 setting, indicates that the interpretation in question should only use the
modifiers bound to this key by the modifier mapping if the symbol that matches
in level one of its group. Otherwise, if the symbol being considered is not in
shift level one of its group, the server behaves as if the modifier map for the
key were empty. Note that it is still possible for such an interpretation to
apply to a symbol in a shift level other than one if it matches a key without
modifiers; the <span class="emphasis"><em>
levelOneOnly</em></span>
 flag only controls the way that matches are determined and that the key
modifiers are applied when an interpretation does match.
  </p></li></ul></div><p>
Applying a symbol interpretation can affect several aspects of the XKB
definition of the key symbol mapping to which it is applied:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
action</em></span>
 specified in the symbol interpretation is bound to the symbol position; any
key event which yields that symbol will also activate the new action.
  </p></li><li class="listitem"><p>If the matching symbol is in position G1L1, the autorepeat behavior of
the key is set from the <span class="emphasis"><em>
autorepeat</em></span>
 field of the symbol interpretation. The <span class="emphasis"><em>
ExplicitAutoRepeat</em></span>
 component protects the autorepeat status of a key from symbol interpretation
initiated changes.
  </p></li><li class="listitem"><p>If the symbol interpretation specifies an associated virtual modifier,
that virtual modifier is added to the virtual modifier map for the key. The
<span class="emphasis"><em>
ExplicitVModMap</em></span>
 component guards the virtual modifier map for a key from automatic changes. If
the <span class="emphasis"><em>
levelOneOnly</em></span>
 flag is set for the interpretation, and the symbol in question is not in
position G1L1, the virtual modifier map is not updated.
  </p></li><li class="listitem"><p>If the matching symbol is in position G1L1, and the <span class="emphasis"><em>
locking key</em></span>
 field is set in the symbol interpretation, the behavior of the key is changed
to <span class="emphasis"><em>
KB_Lock</em></span>
 (see <a class="link" href="#Key_Behavior" title="Key Behavior">Key Behavior</a>). The
<span class="emphasis"><em>
ExplicitBehavior</em></span>
 component prevents this change.
  </p></li></ul></div><p>
If no interpretations match a given symbol or key, the server uses: <span class="emphasis"><em>
SA_NoAction</em></span>
, autorepeat enabled, non-locking key. with no virtual modifiers.
</p><p>
If all of the actions computed for a key are <span class="emphasis"><em>
SA_NoAction</em></span>
, the server assigns an length zero list of actions to the key.
</p><p>
If the core protocol modifier mapping is changed, the server regenerates
actions for the affected keys. The <span class="emphasis"><em>
XkbSetMap</em></span>
 and <span class="emphasis"><em>
XkbSetCompatMap</em></span>
 requests can also cause actions for some or all keyboard keys to be recomputed.
</p></div><div class="sect2" title="Updating Everything Else"><div class="titlepage"><div><div><h3 class="title"><a id="Updating_Everything_Else"></a>Updating Everything Else</h3></div></div></div><p>
Changes to the symbols or modifier mapping can affect the bindings of virtual
modifiers. If any virtual modifiers change, XKB updates all of its data
structures to reflect the change. Applying virtual modifier changes to the
keyboard mapping night result in changes to types, the group compatibility map,
indicator maps, internal modifiers or ignore locks modifiers.
</p></div></div><div class="sect1" title="Effects of XKB on Core Protocol Events"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Effects_of_XKB_on_Core_Protocol_Events"></a>Effects of XKB on Core Protocol Events</h2></div></div></div><p>
After applying server actions which modify the base, latched or locked modifier
or group state of the keyboard, the X server recomputes the effective group and
state. Several components of the keyboard state are reported to XKB-aware
clients depending on context (see <a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">
Keyboard State</a> for a detailed description of each of the keyboard state
components):
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The effective modifier state is reported in <span class="emphasis"><em>
XkbStateNotify</em></span>
 events and in response to <span class="emphasis"><em>
XkbGetState</em></span>
 requests.
  </p></li><li class="listitem"><p>The symbol lookup state is reported to XKB-aware clients in the state
field of core protocol and input extension key press and release events that do
not activate passive grabs. Unless the <span class="emphasis"><em>
LookupStateWhenGrabbed</em></span>
 per-client flag is set, the lookup state is only reported in these events when
no grabs are active.
  </p></li><li class="listitem"><p>The grab state is reported to XKB-aware clients in the state field of
all core protocol events that report keyboard state, except <span class="emphasis"><em>
KeyPress</em></span>
 and <span class="emphasis"><em>
KeyRelease</em></span>
 events that do not activate passive grabs.
  </p></li><li class="listitem"><p>The effective group is the sum of the base, latched and locked keyboard
groups. An out of range effective group is wrapped or truncated into range
according to the setting of the <span class="emphasis"><em>
groupsWrap</em></span>
 flag for the keyboard.
  </p></li></ul></div><p>
The server reports compatibility states to any clients that have not issued a
successful <span class="emphasis"><em>
XkbUseExtension</em></span>
 request. The server computes the compatibility symbol lookup state and the
compatibility effective grab state by applying the compatibility modifier map
to the corresponding computed XKB states.
</p><p>
The compatibility symbol lookup state is reported to non-XKB clients whenever
an XKB-aware client would receive the XKB lookup state. The compatibility grab
state is reported to XKB-unaware clients whenever an XKB client would receive
the XKB grab state.
</p><p>
If the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 per-client option is not set, even XKB-aware clients receive the compatibility
grab state in events that trigger or terminate passive grabs. If this flag is
not set, XKB clients also receive the compatibility grab or lookup state
whenever any keyboard grab is active.
</p><p>
If the <span class="emphasis"><em>
LookupStateWhenGrabbed</em></span>
 per-client option is set, clients receive either the XKB or compatibility
lookup state when the keyboard is grabbed, otherwise they receive either the
XKB or compatibility grab state. All non-XKB clients receive the compatibility
form of the appropriate state component; the form that is sent to an XKB-aware
client depends on the setting of the <span class="emphasis"><em>
GrabsUseXKBState</em></span>
 option for that client.
</p></div><div class="sect1" title="Effect of XKB on Core Protocol Requests"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Effect_of_XKB_on_Core_Protocol_Requests"></a>Effect of XKB on Core Protocol Requests</h2></div></div></div><p>
Whenever a client updates the keyboard mapping using a core protocol request,
the server saves the requested core protocol keyboard mapping and reports it to
any clients that issue <span class="emphasis"><em>
GetKeyboardMapping</em></span>
 or <span class="emphasis"><em>
GetModifierMapping</em></span>
 requests. Whenever a client updates the keyboard mapping using XKB requests,
the server discards the affected portion of the stored core keyboard
description and regenerates it based on the XKB description of the keyboard.
</p><p>
The symbols associated with the XKB keyboard description appear in the order:
</p><pre class="literallayout">
G1L1 G1L2 G2L1 G2L2 G1L3-n G2L3-n G3L* G4L*
</pre><p>
If the type associated with <span class="emphasis"><em>
Group1</em></span>
 is width one, the second symbol is <span class="emphasis"><em>
NoSymbol</em></span>
; if the type associated with <span class="emphasis"><em>
Group2</em></span>
 is width one, the fourth symbol is <span class="emphasis"><em>
NoSymbol</em></span>
.
</p><p>
If a key has only one group but the keyboard has several, the symbols for
<span class="emphasis"><em>
Group1</em></span>
 are repeated for each group. For example, given a keyboard with three groups
and a key with one group that contains the symbols { <span class="emphasis"><em>
a A</em></span>
 }, the core protocol description would contain the six symbols: { <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
A</em></span>
 <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
A</em></span>
 <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
A</em></span>
 }. As a slightly more complicated example, an XKB key which had a single width
three group with the symbols { <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
b</em></span>
 <span class="emphasis"><em>
c</em></span>
 } would show up in the generated core protocol keyboard description with the
symbols { <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
b</em></span>
 <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
b</em></span>
 <span class="emphasis"><em>
c</em></span>
 <span class="emphasis"><em>
c</em></span>
 <span class="emphasis"><em>
a</em></span>
 <span class="emphasis"><em>
b</em></span>
 <span class="emphasis"><em>
c</em></span>
 } for a keyboard with three groups.
</p><p>
The generated modifier mapping for a key contains all of the modifiers affected
by all of the actions associated with the key plus all of the modifiers
associated with any virtual modifiers bound to the key by the virtual modifier
mapping. If any of the actions associated with a key affect any component of
the keyboard group, any modifiers specified in any entry of the group
compatibility map (see <a class="link" href="#Group_Compatibility_Map" title="Group Compatibility Map">Group
Compatibility Map</a>) are reported in the modifier mask. The <span class="emphasis"><em>
SA_ISOLock</em></span>
 action can theoretically affect any modifier, but the modifier map of an
<span class="emphasis"><em>
SA_ISOLock</em></span>
 key contains only the modifiers or group state that it sets by default.
</p><p>
The server notifies interested clients of keyboard map changes in one of two
ways. It sends <span class="emphasis"><em>
XkbMapNotify</em></span>
 to clients that have explicitly selected them and core protocol <span class="emphasis"><em>
MappingNotify</em></span>
 events to clients that have not. Once a client requests <span class="emphasis"><em>
XkbMapNotify</em></span>
 events, the server stops sending it <span class="emphasis"><em>
MappingNotify</em></span>
 events to inform it of keyboard changes.
</p></div><div class="sect1" title="Sending Events to Clients"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sending_Events_to_Clients"></a>Sending Events to Clients</h2></div></div></div><p>
XKB normally assumes that events sent to clients using the core protocol
<span class="emphasis"><em>
SendEvent</em></span>
 request contain a core protocol state, if applicable. If the client which will
receive the event is not XKB-capable, XKB attempts to convert the core state to
an XKB state as follows: if any of the modifiers bound to <span class="emphasis"><em>
Group2</em></span>
 in the group compatibility map are set in the event state, XKB clears them in
the resulting event but sets the effective group in the event state to
<span class="emphasis"><em>
Group2</em></span>
.
</p><p>
If the <span class="emphasis"><em>
PCF_SendEventUsesXKBState</em></span>
 per-client flag is set at the time of the SendEvent request, XKB instead
assumes that the event reported in the event is an XKB state. If the receiving
client is not XKB-aware, the extension converts the XKB state (which contains
the effective state in bits 13-14) to a core state by applying the group
compatibility map just as it would for actual key events.
</p></div></div><div class="chapter" title="Chapter 13. The Server Database of Keyboard Components"><div class="titlepage"><div><div><h2 class="title"><a id="The_Server_Database_of_Keyboard_Components"></a>Chapter 13. The Server Database of Keyboard Components</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Component_Names">Component Names</a></span></dt><dt><span class="sect1"><a href="#Partial_Components_and_Combining_Multiple_Components">Partial Components and Combining Multiple Components</a></span></dt><dt><span class="sect1"><a href="#Component_Hints">Component Hints</a></span></dt><dt><span class="sect1"><a href="#Keyboard_Components">Keyboard Components</a></span></dt><dt><span class="sect1"><a href="#The_Keycodes_Component">The Keycodes Component</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_Types_Component">The Types Component</a></span></dt><dt><span class="sect2"><a href="#The_Compatibility_Map_Component">The Compatibility Map Component</a></span></dt><dt><span class="sect2"><a href="#The_Symbols_Component">The Symbols Component</a></span></dt><dt><span class="sect2"><a href="#The_Geometry_Component">The Geometry Component</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Complete_Keymaps">Complete Keymaps</a></span></dt></dl></div><p>
The X server maintains a database of keyboard components and common keyboard
mappings. This database contains five kinds of components; when combined, these
five components provide a complete description of a keyboard and its behavior.
</p><p>
The X Keyboard Extension provides requests to list the contents of this
database, to assemble and complete keyboard descriptions by merging the current
keyboard description with the contents of this database, or to replace the
current keyboard description with a complete keyboard description assembled as
described below.
</p><div class="sect1" title="Component Names"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Component_Names"></a>Component Names</h2></div></div></div><p>
Component and keymap names have the form "<span class="emphasis"><em>
class</em></span>
(<span class="emphasis"><em>
member</em></span>
)" where <span class="emphasis"><em>
class</em></span>
 describes a subset of the available components for a particular type and the
optional <span class="emphasis"><em>
member</em></span>
 identifies a specific component from that subset. For example, the name
"atlantis(acme)" might specify the symbols used for the atlantis national
keyboard layout by the vendor "acme." Each class has an optional <span class="emphasis"><em>
default</em></span>
 member — references which specify a class but not a member refer to the
default member of the class, if one exists.
</p><p>
The <span class="emphasis"><em>
class</em></span>
 and <span class="emphasis"><em>
member</em></span>
 names are both specified using characters from the Latin-1 character set. XKB
implementations must accept all alphanumeric characters, minus (‘-’) and
underscore (‘_’) in class or member names, and must not accept parentheses,
plus, vertical bar, percent sign, asterisk, question mark or white space. The
use of other characters is implementation-dependent.
</p></div><div class="sect1" title="Partial Components and Combining Multiple Components"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Partial_Components_and_Combining_Multiple_Components"></a>Partial Components and Combining Multiple Components</h2></div></div></div><p>
Some of the elements in the server database contain describe only a piece of
the corresponding keyboard component. These <span class="emphasis"><em>
partial</em></span>
 components should be combined with other components of the same type to be
useful.
</p><p>
For example, a partial symbols map might describe the differences between a
common ASCII keyboard and some national layout. Such a partial map is not
useful on its own because it does not include those symbols that are the same
on both the ASCII and national layouts (such as function keys). On the other
hand, this partial map can configure <span class="emphasis"><em>
any</em></span>
 ASCII keyboard to use a national layout.
</p><p>
Two components can be combined in two ways:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If the second component <span class="emphasis"><em>
overrides</em></span>
 the first, any definitions that are present in both components are taken from
the second.
  </p></li><li class="listitem"><p>If the second component <span class="emphasis"><em>
augments</em></span>
 the first, any definitions that are present in both components are taken from
the first.
  </p></li></ul></div><p>
Applications can use a <span class="emphasis"><em>
component expression</em></span>
 to combine multiple components of some time into a complete description of
some aspect of the keyboard. A component expression is a string which lists the
components to be combined separated by operators which specify the rules for
combining them. A complete description is assembled from the listed components,
left to right, as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If the new elements are being merged with an existing map, the special
component name ‘%’ refers to the unmodified value of the map.
  </p></li><li class="listitem"><p>The ‘+’ operator specifies that the next specified component should
override the current assembled definition.
  </p></li><li class="listitem"><p>The ‘|’ operator specifies that the next specified component should
augment the currently assembled definition.
  </p></li><li class="listitem"><p>If the new elements are being merged with an existing map and the
component expression begins with an operator, a leading ‘%’ is implied.
  </p></li><li class="listitem"><p>If any unknown or illegal characters appear anywhere in the string, the
entire expression is invalid and is ignored.
  </p></li></ul></div><p>
For example, the component expression "+de" specifies that the default element
of the "de" map should be applied to the current keyboard mapping, overriding
any existing definitions.
</p><p>
A slightly more involved example: the expression
"acme(ascii)+de(basic)|iso9995-3" constructs a German (de) mapping for the
ASCII keyboard supplied by the "acme" vendor. The new definition begins with
the symbols for the default ASCII keyboard for Acme, overrides them with any
keys that are defined for the default German keyboard layout and then applies
the definitions from the iso9995-3 to any undefined keys or groups of keys
(part three of the iso9995 standard defines a common set of bindings for the
secondary group, but allows national layouts to override those definitions
where necessary).
</p></div><div class="sect1" title="Component Hints"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Component_Hints"></a>Component Hints</h2></div></div></div><p>
Each component has a set of flags that provide some additional hints about that
component. XKB provides these hints for clients that present the keyboard
database to users and specifies their interpretation only loosely. Clients can
use these hints to constrain the list of components or to control the way that
components are presented to the user.
</p><p>
Hints for a component are reported with its name. The least significant byte of
the hints field has the same meaning for all five types of keyboard components,
and can contain any combination of the following values:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Flag</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
LC_Hidden</em></span>
</td><td align="left">Indicates a component that should not normally be presented to the
user.</td></tr><tr><td align="left"><span class="emphasis"><em>
LC_Default</em></span>
</td><td align="left">Indicates a component that is the default member of its
class.</td></tr><tr><td align="left"><span class="emphasis"><em>
LC_Partial</em></span>
</td><td align="left">Indicates a partial component.</td></tr></tbody></table></div><p>
The interpretation of the most significant byte of the hints field is dependent
on the type of component. The hints defined for each kind of component are
listed in the section below that describes that kind of component.
</p></div><div class="sect1" title="Keyboard Components"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Keyboard_Components"></a>Keyboard Components</h2></div></div></div><p>
The five types of components stored in the server database of keyboard
components correspond to the <span class="emphasis"><em>
symbols</em></span>
, <span class="emphasis"><em>
geometry</em></span>
, <span class="emphasis"><em>
keycodes</em></span>
, <span class="emphasis"><em>
compat</em></span>
 and <span class="emphasis"><em>
types</em></span>
 symbolic names associated with a keyboard.
</p></div><div class="sect1" title="The Keycodes Component"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="The_Keycodes_Component"></a>The Keycodes Component</h2></div></div></div><p>
The <span class="emphasis"><em>
keycodes</em></span>
 component of a keyboard mapping specifies the range and interpretation of the
raw keycodes reported by the device. It sets the <span class="emphasis"><em>
keycodes</em></span>
 symbolic name, the minimum and maximum legal keycodes for the keyboard, and
the symbolic name for each key. The keycodes component might also contain
aliases for some keys, symbolic names for some indicators, and a description of
which indicators are physically present.
</p><p>
The special keycodes component named "computed" indicates that XKB should
assign unused keycodes to any unknown keys referenced by name by any of the
other components. The computed keycodes component is useful primarily when
browsing keymaps because it makes it possible to use the symbols and geometry
components without having to find a set of keycodes that includes keycode
definitions for all of the keys listed in the two components.
</p><p>
XKB defines no hints that are specific to the keycodes component.
</p><div class="sect2" title="The Types Component"><div class="titlepage"><div><div><h3 class="title"><a id="The_Types_Component"></a>The Types Component</h3></div></div></div><p>
The <span class="emphasis"><em>
types</em></span>
 component of a keyboard mapping specifies the key types that can be associated
with the various keyboard keys. It affects the <span class="emphasis"><em>
types</em></span>
 symbolic name and the list of types associated with the keyboard (see
<a class="link" href="#Key_Types" title="Key Types">Key Types</a>). The types component
of a keyboard mapping can also optionally contain real modifier bindings and
symbolic names for one or more virtual modifiers.
</p><p>
The special types component named "canonical" always contains the types and
definitions listed in <a class="link" href="#canonical_key_types" title="Appendix B. Canonical Key Types">Canonical Key Types</a> of this document.
</p><p>
XKB defines no hints that are specific to the types component.
</p></div><div class="sect2" title="The Compatibility Map Component"><div class="titlepage"><div><div><h3 class="title"><a id="The_Compatibility_Map_Component"></a>The Compatibility Map Component</h3></div></div></div><p>
The <span class="emphasis"><em>
compatibility map</em></span>
 component of a keyboard mapping primarily specifies the rules used to assign
actions to keysyms. It affects the <span class="emphasis"><em>
compat</em></span>
 symbolic name, the symbol compatibility map and the group compatibility map.
The compat component might also specify maps for some indicators and the real
modifier bindings and symbolic names of some virtual modifiers.
</p><p>
XKB defines no hints that are specific to the compatibility map component.
</p></div><div class="sect2" title="The Symbols Component"><div class="titlepage"><div><div><h3 class="title"><a id="The_Symbols_Component"></a>The Symbols Component</h3></div></div></div><p>
The <span class="emphasis"><em>
symbols</em></span>
 component of a keyboard mapping specifies primarily the symbols bound to each
keyboard key. It affects the <span class="emphasis"><em>
symbols</em></span>
 symbolic name, a key symbol mapping for each key, they keyboard modifier
mapping, and the symbolic names for the keyboard symbol groups. Optionally, the
<span class="emphasis"><em>
symbols</em></span>
 component can contain explicit actions and behaviors for some keys, or the
real modifier bindings and symbolic names for some virtual modifiers.
</p><p>
XKB defines the following additional hints for the symbols component:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Flag</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
LC_AlphanumericKeys</em></span>
</td><td align="left">Indicates a symbol component that contains bindings primarily for an
alphanumeric section of the keyboard.</td></tr><tr><td align="left"><span class="emphasis"><em>
LC_ModifierKeys</em></span>
</td><td align="left">Indicates a symbol component that contains bindings primarily for
modifier keys.</td></tr><tr><td align="left"><span class="emphasis"><em>
LC_KeypadKeys</em></span>
</td><td align="left">Indicates a symbol component that contains bindings primarily for
numeric keypad keys.</td></tr><tr><td align="left">LC_FunctionKeys</td><td align="left">Indicates a symbol component that contains bindings primarily for
function keys.</td></tr><tr><td align="left">LC_AlternateGroup</td><td align="left">Indicates a symbol component that contains bindings for an alternate
keyboard group.</td></tr></tbody></table></div><p>
These hints only apply to partial symbols components; full symbols components
are assumed to specify all of the pieces listed above.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The alphanumeric, modifier, keypad or function keys hints should
describe the primary intent of the component designer and should not simply an
exhaustive list of the kinds of keys that are affected. For example, national
keyboard layouts affect primarily alphanumeric keys, but many affect a few
modifier keys too; such mappings should set only <span class="emphasis"><em>
LC_AlphanumericKeys</em></span>
 hint. In general, symbol components should set only one of those four flags
(though <span class="emphasis"><em>
LC_AlternateGroup</em></span>
 may be combined with any of the other flags).</p></div></div><div class="sect2" title="The Geometry Component"><div class="titlepage"><div><div><h3 class="title"><a id="The_Geometry_Component"></a>The Geometry Component</h3></div></div></div><p>
The <span class="emphasis"><em>
geometry</em></span>
 component of a keyboard mapping specifies primarily the geometry of the
keyboard. It contains the geometry symbolic name and the keyboard geometry
description. The geometry component might also contain aliases for some keys or
symbolic names for some indicators and might affect the set of indicators that
are physically present. Key aliases defined in the geometry component of a
keyboard mapping override those defined in the keycodes component.
</p><p>
XKB defines no hints that are specific to the geometry component.
</p></div></div><div class="sect1" title="Complete Keymaps"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Complete_Keymaps"></a>Complete Keymaps</h2></div></div></div><p>
The X server also reports a set of fully specified keymaps. The keymaps
specified in this list are usually assembled from the components stored in the
rest of the database and typically represent the most commonly used keymaps for
a particular system.
</p><p>
XKB defines no hints that are specific to complete keymaps.
</p></div></div><div class="chapter" title="Chapter 14. Replacing the Keyboard &quot;On-the-Fly&quot;"><div class="titlepage"><div><div><h2 class="title"><a id="Replacing_the_Keyboard_On_the_Fly"></a>Chapter 14. Replacing the Keyboard "On-the-Fly"</h2></div></div></div><p>
XKB supports the <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event, which reports a change in keyboard geometry or the range of supported
keycodes. The server can generate an <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event when it detects a new keyboard, or in response to an <span class="emphasis"><em>
XkbGetKeyboardByName</em></span>
 request (see <a class="link" href="#Using_the_Servers_Database_of_Keyboard_Components" title="Using the Server’s Database of Keyboard Components">Using the Server’s
Database of Keyboard Components</a>) which loads a new keyboard description.
</p><p>
When a client opens a connection to the X server, the server reports the
minimum and maximum keycodes. If the range of supported keycodes is changed,
XKB keeps track of the minimum and maximum keycodes that were reported to each
client and filters out any events that fall outside of that range. Note that
these events are simply ignored; they are not delivered to some other client.
</p><p>
When the server sends an <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event to a client to inform it of the new keycode range, XKB resets the stored
range of legal keycodes to the keycode range reported in the event. Non-XKB
clients and XKB-aware clients that do not request <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 events never receive events from keys that fall outside of the legal range
that XKB maintains for that client.
</p><p>
When a client requests <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 events, the server compares the range of keycodes for the current keyboard to
the range of keycodes that are valid for the client. If they are not the same,
the server immediately sends that client an <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event. Even if the "new" keyboard is not new to the server, it is new to this
particular client.
</p><p>
In addition to filtering out-of-range key events, XKB:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Adjusts core protocol <span class="emphasis"><em>
MappingNotify</em></span>
 events to refer only to keys that match the stored legal range.
  </p></li><li class="listitem"><p>Reports keyboard mappings for keys that match the stored legal range to
clients that issue a core protocol <span class="emphasis"><em>
GetKeyboardMapping</em></span>
 request.
  </p></li><li class="listitem"><p>Reports modifier mappings only for keys that match the stored legal
range to clients that issue a core protocol <span class="emphasis"><em>
GetModifierMapping</em></span>
 request.
  </p></li><li class="listitem"><p>Restricts the core protocol <span class="emphasis"><em>
ChangeKeyboardMapping</em></span>
 and <span class="emphasis"><em>
SetModifierMapping</em></span>
 requests to keys that fall inside the stored legal range.
  </p></li></ul></div><p>
In short, XKB does everything possible to hide the fact that the range of legal
keycodes has changed from clients non-XKB clients, which cannot be expected to
deal with it. The corresponding XKB events and requests do <span class="emphasis"><em>
not</em></span>
 pay attention to the legal keycode range in the same way because XKB makes it
possible for clients to track changes to the keycode range for a device and
respond to them.
</p></div><div class="chapter" title="Chapter 15. Interactions Between XKB and the X Input Extension"><div class="titlepage"><div><div><h2 class="title"><a id="Interactions_Between_XKB_and_the_X_Input_Extension"></a>Chapter 15. Interactions Between XKB and the X Input Extension</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Using_XKB_Functions_with_Input_Extension_Keyboards">Using XKB Functions with Input Extension Keyboards</a></span></dt><dt><span class="sect1"><a href="#Pointer_and_Device_Button_Actions">Pointer and Device Button Actions</a></span></dt><dt><span class="sect1"><a href="#Indicator_Maps_for_Extension_Devices">Indicator Maps for Extension Devices</a></span></dt><dt><span class="sect1"><a href="#Indicator_Names_for_Extension_Devices">Indicator Names for Extension Devices</a></span></dt></dl></div><p>
All XKB interactions with the input extension are optional; implementors are
free to restrict the effects of the X Keyboard Extension to the core keyboard
device. The <span class="emphasis"><em>
XkbGetExtensionDeviceInfo</em></span>
 request reports whether or not an XKB implementation supports a particular
capability for input extension devices.
</p><p>
XKB recognizes the following interactions with the X Input Extension:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Name</th><th align="left">Capability</th></tr></thead><tbody><tr><td align="left">XI_Keyboards</td><td align="left">If set, applications can use all XKB requests and events with
extension keyboards.</td></tr><tr><td align="left">XI_ButtonActions</td><td align="left">If set, clients can assign key actions to buttons, even on input
extension devices that are not keyboards.</td></tr><tr><td align="left">XI_IndicatorNames</td><td align="left">If set, clients can assign names to indicators on non-keyboard
extension devices.</td></tr><tr><td align="left">XI_IndicatorMaps</td><td align="left">If set, clients can assign indicator maps to indicators on
non-keyboard extension devices. </td></tr><tr><td align="left">XI_IndicatorState</td><td align="left">If set, clients can change the state of device indicators using the
<span class="emphasis"><em>
XkbSetExtensionDeviceInfo</em></span>
 request.</td></tr></tbody></table></div><p>
Attempts to use an XKB feature with an extension device fail with a <span class="emphasis"><em>
Keyboard</em></span>
 error if the server does not support the <span class="emphasis"><em>
XkbXI_Keyboards</em></span>
 optional feature. If a capability particular capability other than <span class="emphasis"><em>
XkbXI_Keyboards</em></span>
 is not supported, attempts to use it fail silently. The replies for most
requests that can use one of the other optional features include a field to
report whether or not the request was successful, but such requests do not
cause an error condition.
</p><p>
Clients can also request an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event. This event notifies interested clients of changes to any of the
supported XKB features for extension devices, or if a request from the client
that is receiving the event attempted to use an unsupported feature.
</p><div class="sect1" title="Using XKB Functions with Input Extension Keyboards"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Using_XKB_Functions_with_Input_Extension_Keyboards"></a>Using XKB Functions with Input Extension Keyboards</h2></div></div></div><p>
All XKB requests and events include a device identifier which can refer to an
input extension <span class="emphasis"><em>
KeyClass</em></span>
 device, if the implementation allows XKB to control extension devices. If the
implementation does not support XKB manipulation of extension devices, the
device identifier is ignored but it must be either <span class="emphasis"><em>
0</em></span>
 or <span class="emphasis"><em>
UseCoreKbd</em></span>
.
</p><p>
Implementations which do not support the use of XKB functions with extension
keyboards must not set the <span class="emphasis"><em>
XkbXI_Keyboards</em></span>
 flag. Attempts to use XKB features on an extension keyboard with an
implementation that does not support this feature yield a <span class="emphasis"><em>
Keyboard</em></span>
 error.
</p></div><div class="sect1" title="Pointer and Device Button Actions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Pointer_and_Device_Button_Actions"></a>Pointer and Device Button Actions</h2></div></div></div><p>
The XKB extension optionally allows clients to assign any key action (see
<a class="link" href="#Key_Actions" title="Key Actions">Key Actions</a>) to core
pointer or input extension device buttons. This makes it possible to control
the keyboard or generate keyboard key events from extension devices or from the
core pointer.
</p><p>
XKB implementations are required to support actions for the buttons of the core
pointer device, but support for actions on extension devices is optional.
Implementations which do not support button actions for extension devices must
not set the <span class="emphasis"><em>
XkbXI_ButtonActions</em></span>
 flag.
</p><p>
Attempts to query or assign button actions with an implementation that does not
support this feature report failure in the request reply and might cause the
server to send an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event to the client which issued the request that failed. Such requests never
cause an error condition.
</p></div><div class="sect1" title="Indicator Maps for Extension Devices"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Indicator_Maps_for_Extension_Devices"></a>Indicator Maps for Extension Devices</h2></div></div></div><p>
The XKB extension allows applications to assign indicator maps to the
indicators of non-keyboard extension devices. If supported, maps can be
assigned to all extension device indicators, whether they are part of a
keyboard feedback or part of an indicator feedback.
</p><p>
Implementations which do not support indicator maps for extension devices must
not set the <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 flag.
</p><p>
Attempts to query or assign indicator maps with an implementation that does not
support this feature report failure in the request reply and might cause the
server to send an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event to the client which issued the request that failed. Such requests never
cause an error condition.
</p><p>
If this feature is supported, the maps for the default indicators on the core
keyboard device are visible both as extension indicators and as the core
indicators. Changes made with <span class="emphasis"><em>
XkbSetDeviceInfo</em></span>
 are visible via <span class="emphasis"><em>
XkbGetIndicatorMap</em></span>
 and changes made with <span class="emphasis"><em>
XkbSetIndicatorMap</em></span>
 are visible via <span class="emphasis"><em>
XkbGetDeviceInfo</em></span>
.
</p></div><div class="sect1" title="Indicator Names for Extension Devices"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Indicator_Names_for_Extension_Devices"></a>Indicator Names for Extension Devices</h2></div></div></div><p>
The XKB extension allows applications to assign symbolic names to the
indicators of non-keyboard extension devices. If supported, symbolic names can
be assigned to all extension device indicators, whether they are part of a
keyboard feedback or part of an indicator feedback.
</p><p>
Implementations which do not support indicator maps for extension devices must
not set the <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 flag.
</p><p>
Attempts to query or assign indicator names with an implementation that does
not support this feature report failure in the request reply and might cause
the server to send an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event to the client which issued the request that failed. Such requests never
cause an error condition.
</p><p>
If this feature is supported, the names for the default indicators on the core
keyboard device are visible both as extension indicators and as the core
indicators. Changes made with <span class="emphasis"><em>
XkbSetDeviceInfo</em></span>
 are visible via <span class="emphasis"><em>
XkbGetNames</em></span>
 and changes made with <span class="emphasis"><em>
XkbSetNames</em></span>
 are visible via <span class="emphasis"><em>
XkbGetDeviceInfo</em></span>
.
</p></div></div><div class="chapter" title="Chapter 16. XKB Protocol Requests"><div class="titlepage"><div><div><h2 class="title"><a id="XKB_Protocol_Requests"></a>Chapter 16. XKB Protocol Requests</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Errors">Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Keyboard_Errors">Keyboard Errors</a></span></dt><dt><span class="sect2"><a href="#Side_Effects_of_Errors">Side-Effects of Errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Common_Types">Common Types</a></span></dt><dt><span class="sect1"><a href="#Requests">Requests</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Initializing_the_X_Keyboard_Extension">Initializing the X Keyboard Extension</a></span></dt><dt><span class="sect2"><a href="#Selecting_Events">Selecting Events</a></span></dt><dt><span class="sect2"><a href="#Generating_Named_Keyboard_Bells">Generating Named Keyboard Bells</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Keyboard_State">Querying and Changing Keyboard State</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Keyboard_Controls">Querying and Changing Keyboard Controls</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_the_Keyboard_Mapping">Querying and Changing the Keyboard Mapping</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_the_Compatibility_Map">Querying and Changing the Compatibility Map</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Indicators">Querying and Changing Indicators</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Symbolic_Names">Querying and Changing Symbolic Names</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Keyboard_Geometry">Querying and Changing Keyboard Geometry</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Per_Client_Flags">Querying and Changing Per-Client Flags</a></span></dt><dt><span class="sect2"><a href="#Using_the_Servers_Database_of_Keyboard_Components">Using the Server’s Database of Keyboard Components</a></span></dt><dt><span class="sect2"><a href="#Querying_and_Changing_Input_Extension_Devices">Querying and Changing Input Extension Devices</a></span></dt><dt><span class="sect2"><a href="#Debugging_the_X_Keyboard_Extension">Debugging the X Keyboard Extension</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Events">Events</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Tracking_Keyboard_Replacement">Tracking Keyboard Replacement</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Mapping_Changes">Tracking Keyboard Mapping Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_State_Changes">Tracking Keyboard State Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Control_Changes">Tracking Keyboard Control Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Indicator_State_Changes">Tracking Keyboard Indicator State Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Indicator_Map_Changes">Tracking Keyboard Indicator Map Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Keyboard_Name_Changes">Tracking Keyboard Name Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Compatibility_Map_Changes">Tracking Compatibility Map Changes</a></span></dt><dt><span class="sect2"><a href="#Tracking_Application_Bell_Requests">Tracking Application Bell Requests</a></span></dt><dt><span class="sect2"><a href="#Tracking_Messages_Generated_by_Key_Actions">Tracking Messages Generated by Key Actions</a></span></dt><dt><span class="sect2"><a href="#Tracking_Changes_to_AccessX_State_and_Keys">Tracking Changes to AccessX State and Keys</a></span></dt><dt><span class="sect2"><a href="#Tracking_Changes_To_Extension_Devices">Tracking Changes To Extension Devices</a></span></dt></dl></dd></dl></div><p>
This document uses the syntactic conventions and common types defined by the
specification of the core X protocol with a number of additions, which are
detailed below.
</p><div class="sect1" title="Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Errors"></a>Errors</h2></div></div></div><p>
If a client attempts to use any other XKB request except <span class="emphasis"><em>
XkbUseExtension</em></span>
 before the extension is properly initialized, XKB reports an <span class="emphasis"><em>
Access</em></span>
 error and ignores the request. XKB is properly initialized once <span class="emphasis"><em>
XkbUseExtension</em></span>
 reports that the client has asked for a supported or compatible version of the
extension.
</p><div class="sect2" title="Keyboard Errors"><div class="titlepage"><div><div><h3 class="title"><a id="Keyboard_Errors"></a>Keyboard Errors</h3></div></div></div><p>
In addition to all of the errors defined by the core protocol, the X Keyboard
Extension defines a single error, <span class="emphasis"><em>
Keyboard</em></span>
, which indicates that some request specified an illegal device identifier or
an extension device that is not a member of an appropriate. Unless otherwise
noted, any request with an argument of type KB_DEVICESPEC can cause <span class="emphasis"><em>
Keyboard</em></span>
 errors if an illegal or inappropriate device is specified.
</p><p>
When the extension reports a Keyboard error, the most significant byte of the
<span class="emphasis"><em>
resource_id</em></span>
 is a further refinement of the error cause, as defined in the table below. The
least significant byte contains the device, class, or feedback id as indicated:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">high-order byte</th><th align="left">value</th><th align="left">meaning</th><th align="left">low-order byte</th></tr></thead><tbody><tr><td align="left">XkbErr_BadDevice</td><td align="left">0xff</td><td align="left">device not found</td><td align="left">device id</td></tr><tr><td align="left">XkbErr_BadClass</td><td align="left">0xfe</td><td align="left">device found, but is the wrong class</td><td align="left">class id</td></tr><tr><td align="left">XkbErr_BadId</td><td align="left">0xfd</td><td align="left">device found, class ok, but device does not have a feedback with the
indicated id</td><td align="left">feedback id</td></tr></tbody></table></div></div><div class="sect2" title="Side-Effects of Errors"><div class="titlepage"><div><div><h3 class="title"><a id="Side_Effects_of_Errors"></a>Side-Effects of Errors</h3></div></div></div><p>
With the exception of <span class="emphasis"><em>
Alloc</em></span>
 or <span class="emphasis"><em>
Implementation</em></span>
 errors, which might result in an inconsistent internal state, no XKB request
that reports an error condition has any effect. Unless otherwise stated,
requests which update some aspect of the keyboard description will not apply
only part of a request — if part of a request fails, the whole thing is
ignored.
</p></div></div><div class="sect1" title="Common Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Common_Types"></a>Common Types</h2></div></div></div><p>
The following types are used in the request and event definitions in subsequent
sections:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Name</th><th align="left">Value</th></tr></thead><tbody><tr><td align="left">LISTofITEMs</td><td align="left">	The type LISTofITEMs is special. It is similar to the
LISTofVALUE defined by the core protocol, but the elements of a LISTofITEMs are
not necessarily all the same size. The use of a BITMASK to indicate which
members are present is optional for a LISTofITEMs — it is possible for the
set of elements to be derived from one or more fields of the request.</td></tr><tr><td align="left">KB_DEVICESPEC</td><td align="left">8 bit unsigned integer, <span class="emphasis"><em>
UseCoreKbd, or UseCorePtr</em></span>
</td></tr><tr><td align="left">KB_LEDCLASSSPEC</td><td align="left">{	<span class="emphasis"><em>
KbdFeedbackClass</em></span>
, <span class="emphasis"><em>
LedFeedbackClass</em></span>
, <span class="emphasis"><em>
DfltXIClass</em></span>
, <span class="emphasis"><em>
AllXIClasses</em></span>
, <span class="emphasis"><em>
XINone</em></span>
 }</td></tr><tr><td align="left">KB_BELLCLASSSPEC</td><td align="left">{	<span class="emphasis"><em>
KbdFeedbackClass</em></span>
, <span class="emphasis"><em>
BellFeedbackClass</em></span>
, <span class="emphasis"><em>
DfltXIClass</em></span>
, <span class="emphasis"><em>
AllXIClasses</em></span>
 }</td></tr><tr><td align="left">KB_IDSPEC</td><td align="left">8 bit unsigned integer or <span class="emphasis"><em>
DfltXIId</em></span>
</td></tr><tr><td align="left">KB_VMODMASK</td><td align="left">	CARD16, each bit corresponds to a virtual modifier</td></tr><tr><td align="left">KB_GROUPMASK</td><td align="left">{	<span class="emphasis"><em>
Group1</em></span>
, <span class="emphasis"><em>
Group2</em></span>
, <span class="emphasis"><em>
Group3</em></span>
, <span class="emphasis"><em>
Group4</em></span>
 }</td></tr><tr><td align="left">KB_GROUPSWRAP</td><td align="left">{	<span class="emphasis"><em>
WrapIntoRange</em></span>
, <span class="emphasis"><em>
ClampIntoRange</em></span>
, <span class="emphasis"><em>
RedirectIntoRange</em></span>
 }</td></tr><tr><td align="left">KB_GROUPINFO</td><td align="left">{	groupsWrap: KB_GROUPSWRAP
redirectGroup: 1…4,
numGroups: 1…4 }</td></tr><tr><td align="left">KB_NKNDETAILSMASK</td><td align="left">{	<span class="emphasis"><em>
NKN_Keycodes</em></span>
, NKN_Geometry, <span class="emphasis"><em>
NKN_DeviceID</em></span>
 }</td></tr><tr><td align="left">KB_STATEMASK</td><td align="left">	KEYBUTMASK or KB_GROUPMASK</td></tr><tr><td align="left">KB_STATEPARTMASK</td><td align="left">{	<span class="emphasis"><em>
ModifierState</em></span>
, <span class="emphasis"><em>
ModifierBase</em></span>
, <span class="emphasis"><em>
ModifierLatch</em></span>
, <span class="emphasis"><em>
ModifierLock</em></span>
, <span class="emphasis"><em>
GroupState</em></span>
, <span class="emphasis"><em>
GroupBase</em></span>
, <span class="emphasis"><em>
GroupLatch</em></span>
, <span class="emphasis"><em>
GroupLock</em></span>
, <span class="emphasis"><em>
CompatState</em></span>
, <span class="emphasis"><em>
GrabMods</em></span>
, <span class="emphasis"><em>
CompatGrabMods</em></span>
, <span class="emphasis"><em>
LookupMods</em></span>
, <span class="emphasis"><em>
CompatLookupMods</em></span>
, <span class="emphasis"><em>
PointerButtons</em></span>
 }</td></tr><tr><td align="left">KB_BOOLCTRLMASK</td><td align="left">{	<span class="emphasis"><em>
RepeatKeys</em></span>
, <span class="emphasis"><em>
SlowKeys</em></span>
, <span class="emphasis"><em>
BounceKeys</em></span>
, <span class="emphasis"><em>
StickyKeys</em></span>
, <span class="emphasis"><em>
MouseKeys</em></span>
, <span class="emphasis"><em>
MouseKeysAccel</em></span>
, <span class="emphasis"><em>
AccessXKeys</em></span>
, <span class="emphasis"><em>
AccessXTimeout</em></span>
, <span class="emphasis"><em>
AccessXFeedback</em></span>
, <span class="emphasis"><em>
AudibleBell</em></span>
, <span class="emphasis"><em>
Overlay1</em></span>
, <span class="emphasis"><em>
Overlay2</em></span>
, <span class="emphasis"><em>
IgnoreGroupLock</em></span>
 }</td></tr><tr><td align="left">KB_CONTROLSMASK</td><td align="left">{	<span class="emphasis"><em>
GroupsWrap, InternalMods</em></span>
, <span class="emphasis"><em>
IgnoreLockMods</em></span>
, <span class="emphasis"><em>
PerKeyRepeat</em></span>
, <span class="emphasis"><em>
ControlsEnabled</em></span>
 } or KB_BOOLCTRLMASK</td></tr><tr><td align="left">KB_MAPPARTMASK</td><td align="left">{	<span class="emphasis"><em>
KeyTypes</em></span>
, <span class="emphasis"><em>
KeySyms</em></span>
, <span class="emphasis"><em>
ModifierMap</em></span>
, <span class="emphasis"><em>
ExplicitComponents</em></span>
, <span class="emphasis"><em>
KeyActions</em></span>
, <span class="emphasis"><em>
KeyBehaviors</em></span>
, <span class="emphasis"><em>
VirtualMods</em></span>
, <span class="emphasis"><em>
VirtualModMap</em></span>
}</td></tr><tr><td align="left">KB_CMDETAILMASK</td><td align="left">{	<span class="emphasis"><em>
SymInterp</em></span>
, <span class="emphasis"><em>
GroupCompat</em></span>
 }</td></tr><tr><td align="left">KB_NAMEDETAILMASK</td><td align="left">{	<span class="emphasis"><em>
KeycodesName</em></span>
, <span class="emphasis"><em>
GeometryName</em></span>
, <span class="emphasis"><em>
SymbolsName</em></span>
,
	<span class="emphasis"><em>
PhysSymbolsName</em></span>
, <span class="emphasis"><em>
TypesName</em></span>
, <span class="emphasis"><em>
CompatName</em></span>
, <span class="emphasis"><em>
KeyTypeNames</em></span>
, <span class="emphasis"><em>
KTLevelNames</em></span>
, <span class="emphasis"><em>
IndicatorNames</em></span>
, <span class="emphasis"><em>
KeyNames</em></span>
, <span class="emphasis"><em>
KeyAliases</em></span>
, <span class="emphasis"><em>
VirtualModNames</em></span>
, <span class="emphasis"><em>
GroupNames</em></span>
, <span class="emphasis"><em>
RGNames</em></span>
}</td></tr><tr><td align="left">KB_AXNDETAILMASK</td><td align="left">{	<span class="emphasis"><em>
AXN_SKPress</em></span>
, <span class="emphasis"><em>
AXN_SKAccept</em></span>
, <span class="emphasis"><em>
AXN_SKReject</em></span>
, <span class="emphasis"><em>
AXN_SKRelease, AXN_BKAccept, AXN_BKReject, AXN_AXKWarning </em></span>
}</td></tr><tr><td align="left">KB_AXSKOPTSMASK</td><td align="left">{	<span class="emphasis"><em>
AX_TwoKeys</em></span>
, <span class="emphasis"><em>
AX_LatchToLock</em></span>
 }</td></tr><tr><td align="left">KB_AXFBOPTSMASK</td><td align="left">{	<span class="emphasis"><em>
AX_SKPressFB</em></span>
, <span class="emphasis"><em>
AX_SKAcceptFB</em></span>
, <span class="emphasis"><em>
AX_FeatureFB</em></span>
, <span class="emphasis"><em>
AX_SlowWarnFB</em></span>
, <span class="emphasis"><em>
AX_IndicatorFB</em></span>
, <span class="emphasis"><em>
AX_StickyKeysFB</em></span>
, <span class="emphasis"><em>
AX_SKReleaseFB</em></span>
,<span class="emphasis"><em>
 AX_SKRejectFB</em></span>
, <span class="emphasis"><em>
AX_BKRejectFB</em></span>
, <span class="emphasis"><em>
AX_DumbBellFB</em></span>
 }</td></tr><tr><td align="left">KB_AXOPTIONSMASK</td><td align="left">	KB_AXFBOPTSMASK or KB_AXSKOPTSMASK</td></tr><tr><td align="left">KB_GBNDETAILMASK</td><td align="left">{	<span class="emphasis"><em>
GBN_Types</em></span>
, <span class="emphasis"><em>
GBN_CompatMap</em></span>
, <span class="emphasis"><em>
GBN_ClientSymbols</em></span>
, <span class="emphasis"><em>
GBN_ServerSymbols</em></span>
, <span class="emphasis"><em>
GBN_IndicatorMap</em></span>
, <span class="emphasis"><em>
GBN_KeyNames</em></span>
, <span class="emphasis"><em>
GBN_Geometry</em></span>
, <span class="emphasis"><em>
GBN_OtherNames</em></span>
 }</td></tr><tr><td align="left">KB_BELLDETAILMASK</td><td align="left">{	<span class="emphasis"><em>
XkbAllBellNotifyEvents</em></span>
 }</td></tr><tr><td align="left">KB_MSGDETAILMASK</td><td align="left">{	<span class="emphasis"><em>
XkbAllActionMessages</em></span>
 }</td></tr><tr><td align="left">KB_EVENTTYPE</td><td align="left">{	<span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
, <span class="emphasis"><em>
XkbMapNotify</em></span>
, <span class="emphasis"><em>
XkbStateNotify</em></span>
, <span class="emphasis"><em>
XkbControlsNotify</em></span>
, <span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
, <span class="emphasis"><em>
XkbIndicatorMapNotify</em></span>
, <span class="emphasis"><em>
XkbNamesNotify</em></span>
, <span class="emphasis"><em>
XkbCompatMapNotify</em></span>
, <span class="emphasis"><em>
XkbBellNotify</em></span>
, <span class="emphasis"><em>
XkbActionMessage</em></span>
, <span class="emphasis"><em>
XkbAccessXNotify</em></span>
, <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 }</td></tr><tr><td align="left">KB_ACTION</td><td align="left">[	type: CARD8
data: LISTofCARD8 ]</td></tr><tr><td align="left">KB_BEHAVIOR</td><td align="left">[	type: CARD8, data: CARD 8 ]</td></tr><tr><td align="left">KB_MODDEF</td><td align="left">[	mask: KEYMASK,
mods: KEYMASK,
vmods: KB_VMODMASK ]</td></tr><tr><td align="left">KB_KTMAPENTRY</td><td align="left">[	active: BOOL,
level: CARD8,
mods: KB_MODDEF ]</td></tr><tr><td align="left">KB_KTSETMAPENTRY</td><td align="left">[	level: CARD8,
mods: KB_MODDEF ]</td></tr><tr><td align="left">KB_KEYTYPE</td><td align="left">[	mods: KB_MODDEF,
numLevels: CARD8,
map: LISTofKB_KTMAPENTRY,
preserve: LISTofKB_MODDEF ]</td></tr><tr><td align="left">KB_SETKEYTYPE</td><td align="left">[	 realMods: KEYMASK,
vmods: CARD16,
numLevels: CARD8,
map: LISTofKB_KTSETMAPENTRY,
preserve: LISTofKB_MODDEF ]</td></tr><tr><td align="left">KB_KEYSYMMAP</td><td align="left">[	 ktIndex: LISTofCARD8, width: CARD8
	 numGroups: 0…4,
	 groupsWrap: KB_GROUPSWRAP,
	 redirectGroup: 0…3,
	syms: LISTofKEYSYM ]</td></tr><tr><td align="left">KB_KEYVMODMAP</td><td align="left">[	key: KEYCODE, vmods: CARD16 ]</td></tr><tr><td align="left">KB_KEYMODMAP</td><td align="left">[	key: KEYCODE, mods: KEYMASK ]</td></tr><tr><td align="left">KB_EXPLICITMASK</td><td align="left">{	<span class="emphasis"><em>
ExplicitKeyType1</em></span>
, <span class="emphasis"><em>
ExplicitKeyType2</em></span>
, <span class="emphasis"><em>
ExplicitKeyType3</em></span>
, <span class="emphasis"><em>
ExplicitKeyType4</em></span>
, <span class="emphasis"><em>
ExplicitInterpret</em></span>
, <span class="emphasis"><em>
ExplicitAutoRepeat</em></span>
, <span class="emphasis"><em>
ExplicitBehavior</em></span>
, <span class="emphasis"><em>
ExplicitVModMap</em></span>
 }</td></tr><tr><td align="left">KB_INDICATORMASK</td><td align="left">	CARD32, each bit corresponds to an indicator</td></tr><tr><td align="left">KB_IMFLAGS</td><td align="left">{	<span class="emphasis"><em>
IM_NoExplicit</em></span>
, <span class="emphasis"><em>
IM_NoAutomatic</em></span>
, <span class="emphasis"><em>
IM_LEDDrivesKB</em></span>
 }</td></tr><tr><td align="left">KB_IMMODSWHICH</td><td align="left">{	<span class="emphasis"><em>
IM_UseNone</em></span>
, <span class="emphasis"><em>
IM_UseBase</em></span>
, <span class="emphasis"><em>
IM_UseLatched</em></span>
, <span class="emphasis"><em>
IM_UseLocked</em></span>
, <span class="emphasis"><em>
IM_UseEffective</em></span>
, <span class="emphasis"><em>
IM_UseCompat</em></span>
 }</td></tr><tr><td align="left">KB_IMGROUPSWHICH</td><td align="left">{	<span class="emphasis"><em>
IM_UseNone</em></span>
, <span class="emphasis"><em>
IM_UseBase</em></span>
, <span class="emphasis"><em>
IM_UseLatched</em></span>
, <span class="emphasis"><em>
IM_UseLocked</em></span>
, <span class="emphasis"><em>
IM_UseEffective</em></span>
 }</td></tr><tr><td align="left">KB_INDICATORMAP</td><td align="left">[	flags: CARD8,
mods: KB_MODDEF,
whichMods:
groups: KB_GROUPMASK,
whichGroups:
ctrls: KB_BOOLCTRLMASK ]</td></tr><tr><td align="left">KB_SYMINTERPMATCH</td><td align="left">{	<span class="emphasis"><em>
SI_NoneOf</em></span>
, <span class="emphasis"><em>
SI_AnyOfOrNone</em></span>
, <span class="emphasis"><em>
SI_AnyOf</em></span>
, <span class="emphasis"><em>
SI_AllOf</em></span>
, <span class="emphasis"><em>
SI_Exactly</em></span>
 }</td></tr><tr><td align="left">KB_SYMINTERP</td><td align="left">[	sym: KEYSYM,
	mods; KEYMASK,
	levelOneOnly: BOOL,
	match: KB_SYMINTERPMATCH,
	virtualMod: CARD8,
	autoRepeat: BOOL,
	lockingKey: BOOL ]</td></tr><tr><td align="left">KB_PCFMASK</td><td align="left">{	<span class="emphasis"><em>
PCF_DetectableAutorepeat</em></span>
, <span class="emphasis"><em>
PCF_GrabsUseXkbState</em></span>
, <span class="emphasis"><em>
PCF_AutoResetControls</em></span>
, <span class="emphasis"><em>
PCF_LookupStateWhenGrabbed</em></span>
, <span class="emphasis"><em>
PCF_SendEventUsesXKBState</em></span>
 }</td></tr><tr><td align="left">KB_LCFLAGSMASK</td><td align="left">{	<span class="emphasis"><em>
LC_Hidden</em></span>
, <span class="emphasis"><em>
LC_Default</em></span>
, <span class="emphasis"><em>
LC_Partial</em></span>
 }</td></tr><tr><td align="left">KB_LCSYMFLAGSMASK</td><td align="left">{	<span class="emphasis"><em>
LC_AlphanumericKeys</em></span>
, <span class="emphasis"><em>
LC_ModifierKeys</em></span>
, <span class="emphasis"><em>
LC_KeypadKeys</em></span>
, <span class="emphasis"><em>
LC_FunctionKeys</em></span>
, <span class="emphasis"><em>
LC_AlternateGroup</em></span>
 }</td></tr></tbody></table></div><p>
These types are used by the <span class="emphasis"><em>
XkbGetGeometry</em></span>
 and <span class="emphasis"><em>
XkbSetGeometry</em></span>
 requests:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Name</th><th align="left">Value</th></tr></thead><tbody><tr><td align="left">KB_PROPERTY</td><td align="left">[	name, value: STRING8 ]</td></tr><tr><td align="left">KB_POINT</td><td align="left">[	x, y: CARD16 ]</td></tr><tr><td align="left">KB_OUTLINE</td><td align="left">[	cornerRadius: CARD8, points: LISTofKB_POINT ]</td></tr><tr><td align="left">KB_SHAPE</td><td align="left">[	name: ATOM, outlines: LISTofKB_OUTLINE
	primaryNdx, approxNdx: CARD8 ]</td></tr><tr><td align="left">KB_KEYNAME</td><td align="left">[ name: LISTofCHAR ]</td></tr><tr><td align="left">KB_KEYALIAS</td><td align="left">[	real: LISTofCHAR, alias: LISTofCHAR ]</td></tr><tr><td align="left">KB_KEY</td><td align="left">[	name: KB_KEYNAME, gap: INT16,
	shapeNdx, colorNdx: CARD8 ]</td></tr><tr><td align="left">KB_ROW</td><td align="left">[	top, left: INT16, vertical: BOOL, keys LISTofKB_KEY ]</td></tr><tr><td align="left">KB_OVERLAYKEY</td><td align="left">[	over, under: KB_KEYNAME ]</td></tr><tr><td align="left">KB_OVERLAYROW</td><td align="left">[	rowUnder: CARD8, keys: LISTofKB_OVERLAYKEY ]</td></tr><tr><td align="left">KB_OVERLAY</td><td align="left">[	sectionUnder: CARD8,
rows: LISTofKB_OVERLAYROW ]</td></tr><tr><td align="left">KB_SHAPEDOODAD</td><td align="left">[	name: ATOM, priority: CARD8, top, left: INT16,
	type: { SolidDoodad, OutlineDoodad },
	angle: INT16, width, height: CARD16
	colorNdx, shapeNdx: CARD8 ]</td></tr><tr><td align="left">KB_TEXTDOODAD</td><td align="left">[	name: ATOM, priority: CARD8, top, left: INT16,
	angle: INT16, width, height: CARD16,
	colorNdx: CARD8, text: STRING8, font: STRING8 ]</td></tr><tr><td align="left">KB_INDICATORDOODAD</td><td align="left">[	name: ATOM, priority: CARD8, top, left: INT16,
angle: INT16,
shapeNdx, onColorNdx, offColorNdx: CARD8 ]</td></tr><tr><td align="left">KB_LOGODOODAD</td><td align="left">[	name: ATOM, priority: CARD8, top, left: INT16,
	angle: INT16, colorNdx, shapeNdx: CARD8,
	logoName: STRING8 ]</td></tr><tr><td align="left">KB_DOODAD</td><td align="left">KB_SHAPEDOODAD, or KB_TEXTDOODAD, or KB_INDICATORDOODAD, or
KB_LOGODOODAD</td></tr><tr><td align="left">KB_SECTION</td><td align="left">[	name: ATOM,
	top, left, angle: INT16,
	width, height: CARD16,
	priority: CARD8,
	rows: LISTofKB_ROW,
	doodads: LISTofKB_DOODAD,
	overlays: LISTofKB_OVERLAY ]</td></tr></tbody></table></div><p>
These types are used by <span class="emphasis"><em>
XkbGetDeviceInfo</em></span>
 and <span class="emphasis"><em>
XkbSetDeviceInfo</em></span>
:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Name</th><th align="left">Value</th></tr></thead><tbody><tr><td align="left">KB_XIDEVFEATUREMASK</td><td align="left">{	<span class="emphasis"><em>
XI_ButtonActions</em></span>
, <span class="emphasis"><em>
XI_IndicatorNames</em></span>
, <span class="emphasis"><em>
XI_IndicatorMaps</em></span>
, <span class="emphasis"><em>
XI_IndicatorState</em></span>
 }</td></tr><tr><td align="left">KB_XIFEATUREMASK</td><td align="left">{	 KB_XIDEVFEATURES or <span class="emphasis"><em>
XI_Keyboards</em></span>
</td></tr><tr><td align="left">KB_XIDETAILMASK</td><td align="left">	{ KB_XIFEATURES or <span class="emphasis"><em>
XI_UnsupportedFeature</em></span>
 <span class="emphasis"><em>
}</em></span>
</td></tr><tr><td align="left">KB_DEVICELEDINFO</td><td align="left">[	ledClass: KB_LEDCLASSSPEC,
ledID: KB_IDSPEC,
physIndicators: CARD32,
state: CARD32,
names: LISTofATOM,
maps: LISTofKB_INDICATORMAP ]</td></tr></tbody></table></div></div><div class="sect1" title="Requests"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Requests"></a>Requests</h2></div></div></div><p>
This section lists all of the requests supported by the X Keyboard Extension,
separated into categories of related requests.
</p><div class="sect2" title="Initializing the X Keyboard Extension"><div class="titlepage"><div><div><h3 class="title"><a id="Initializing_the_X_Keyboard_Extension"></a>Initializing the X Keyboard Extension</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbUseExtension</th></tr></thead><tbody><tr><td class="protoargs" align="left">wantedMajor, wantedMinor:	 CARD16</td></tr><tr><td class="protoreply" align="left">
supported: BOOL
      </td></tr><tr><td class="protoreply" align="left">
serverMajor, serverMinor: CARD16</td></tr></tbody></table></div><p>
This request enables XKB extension capabilities for the client that issues the
request; the <span class="emphasis"><em>
wantedMajor</em></span>
 and <span class="emphasis"><em>
wantedMinor</em></span>
 fields specify the extension version in use by the requesting client. The
<span class="emphasis"><em>
supported</em></span>
 field is <span class="emphasis"><em>
True</em></span>
 if the server supports a compatible version, <span class="emphasis"><em>
False</em></span>
 otherwise. The <span class="emphasis"><em>
serverMajor</em></span>
 and <span class="emphasis"><em>
serverMinor</em></span>
 fields return the actual version supported by the server.
</p><p>
Until a client explicitly and successfully requests the XKB extension, an XKB
capable server reports compatibility state in all core protocol events and
requests. Once a client asks for XKB extension semantics by issuing this
request, the server reports the extended XKB keyboard state in some core
protocol events and requests, as described in the overview section of this
specification.
</p><p>
Clients should issue an <span class="emphasis"><em>
XkbUseExtension</em></span>
 request before using any other extension requests.
</p></div><div class="sect2" title="Selecting Events"><div class="titlepage"><div><div><h3 class="title"><a id="Selecting_Events"></a>Selecting Events</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSelectEvents</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec:	KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
affectWhich, clear, selectAll: KB_EVENTTYPE</td></tr><tr><td class="protoname" align="left">
affectMap, map: KB_MAPPARTMASK</td></tr><tr><td class="protoname" align="left">
details: LISTofITEMs</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request updates the event masks of the keyboard indicated by <span class="emphasis"><em>
deviceSpec</em></span>
 for this client. If <span class="emphasis"><em>
deviceSpec</em></span>
 specifies an illegal device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
affectMap</em></span>
 and <span class="emphasis"><em>
map</em></span>
 fields specify changes to the event details mask for the <span class="emphasis"><em>
XkbMapNotify</em></span>
 event. If any map components are set in <span class="emphasis"><em>
map</em></span>
 but not in <span class="emphasis"><em>
affectMap</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results. Otherwise, any map components that are set in <span class="emphasis"><em>
affectMap</em></span>
 are set or cleared in the map notify details mask, depending on the value of
the corresponding field in <span class="emphasis"><em>
map</em></span>
.
</p><p>
The <span class="emphasis"><em>
affectWhich</em></span>
, <span class="emphasis"><em>
clear</em></span>
, and <span class="emphasis"><em>
selectAll</em></span>
 fields specify changes to any other event details masks. If any event types
are set in both <span class="emphasis"><em>
clear</em></span>
 and <span class="emphasis"><em>
selectAll</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results; if any event types are specified in either <span class="emphasis"><em>
clear</em></span>
 or <span class="emphasis"><em>
selectAll</em></span>
 but not in <span class="emphasis"><em>
affectWhich</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results. Otherwise, the detail masks for any event types specified in
the <span class="emphasis"><em>
affectWhich</em></span>
 field of this request are changed as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If the event type is also set in <span class="emphasis"><em>
clear</em></span>
, the detail mask for the corresponding event is set to <span class="emphasis"><em>
0</em></span>
 or <span class="emphasis"><em>
False</em></span>
, as appropriate.
  </p></li><li class="listitem"><p>If the event type is also set in <span class="emphasis"><em>
selectAll</em></span>
, the detail mask for the corresponding event is set to include all legal
detail values for that type.
  </p></li><li class="listitem"><p>If the event type is not set in either <span class="emphasis"><em>
clear</em></span>
 or <span class="emphasis"><em>
selectAll</em></span>
, the corresponding element of <span class="emphasis"><em>
details</em></span>
 lists a set of explicit changes to the details mask for the event, as
described below.
  </p></li></ul></div><p>
Each entry of the <span class="emphasis"><em>
details</em></span>
 list specifies changes to the event details mask for a single type of event,
and consists of an <span class="emphasis"><em>
affects</em></span>
 mask and a <span class="emphasis"><em>
values</em></span>
 mask. All details that are specified in <span class="emphasis"><em>
affects</em></span>
 are set to the corresponding value from <span class="emphasis"><em>
values</em></span>
; if any details are listed in <span class="emphasis"><em>
values</em></span>
 but not in <span class="emphasis"><em>
affects</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
The details list contains entries only for those event types, if any, that are
listed in the <span class="emphasis"><em>
affectWhich</em></span>
 mask and not in either <span class="emphasis"><em>
clear</em></span>
 or <span class="emphasis"><em>
selectAll</em></span>
. When present, the items of the <span class="emphasis"><em>
details</em></span>
 list appear in the following order:
</p><div class="informaltable"><table border="0"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">Event Type</th><th align="left">Legal Details</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_NKNDETAILSMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD16</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbStateNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_STATEPARTMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD16</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbControlsNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_CONTROLMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD32</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbIndicatorMapNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_INDICATORMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD32</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_INDICATORMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD32</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbNamesNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_NAMEDETAILMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD16</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbCompatMapNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_CMDETAILMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD8</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbBellNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_BELLDETAILMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD8</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbActionMessage</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_MSGDETAILMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD8</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbAccessXNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_AXNDETAILMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD16</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
</td><td align="left"><span class="emphasis"><em>
KB_XIDETAILMASK</em></span>
</td><td align="left"><span class="emphasis"><em>
CARD16</em></span>
</td></tr></tbody></table></div><p>
Detail masks for event types that are not specified in <span class="emphasis"><em>
affectWhich</em></span>
 are not changed.
</p><p>
If any components are specified in a client’s event masks, the X server sends
the client an appropriate event whenever any of those components change state.
Unless explicitly modified, all event detail masks are empty. <a class="link" href="#Events" title="Events">Events</a> describes all XKB events
and the conditions under which the server generates them.
</p></div><div class="sect2" title="Generating Named Keyboard Bells"><div class="titlepage"><div><div><h3 class="title"><a id="Generating_Named_Keyboard_Bells"></a>Generating Named Keyboard Bells</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbBell</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
bellClass: KB_BELLCLASSSPEC</td></tr><tr><td class="protoname" align="left">
bellID: KB_IDSPEC</td></tr><tr><td class="protoname" align="left">
percent: INT8</td></tr><tr><td class="protoname" align="left">
forceSound: BOOL</td></tr><tr><td class="protoname" align="left">
eventOnly: BOOL</td></tr><tr><td class="protoname" align="left">
pitch, duration: INT16</td></tr><tr><td class="protoname" align="left">
name: ATOM</td></tr><tr><td class="protoname" align="left">
window: WINDOW</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
, <span class="emphasis"><em>
Match</em></span>
</td></tr></tbody></table></div><p>
This request generates audible bells and/or <span class="emphasis"><em>
XkbBellNotify</em></span>
 events for the bell specified by the <span class="emphasis"><em>
bellClass</em></span>
 and <span class="emphasis"><em>
bellID</em></span>
 on the device specified by <span class="emphasis"><em>
deviceSpec</em></span>
 at the specified <span class="emphasis"><em>
pitch</em></span>
, <span class="emphasis"><em>
duration</em></span>
 and volume (<span class="emphasis"><em>
percent</em></span>
). If deviceSpec specifies a device that does not have a bell or keyboard
feedback, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
If both <span class="emphasis"><em>
forceSound</em></span>
 and <span class="emphasis"><em>
eventOnly</em></span>
 are set, this request yields a <span class="emphasis"><em>
Match</em></span>
 error. Otherwise, if <span class="emphasis"><em>
forceSound</em></span>
 is <span class="emphasis"><em>
True</em></span>
, this request always generates a sound and never generates an event; if
<span class="emphasis"><em>
eventOnly</em></span>
 is <span class="emphasis"><em>
True</em></span>
, it causes an event but no sound. If neither <span class="emphasis"><em>
forceSound</em></span>
 nor <span class="emphasis"><em>
eventOnly</em></span>
 are <span class="emphasis"><em>
True</em></span>
, this request always generates an event; if the keyboard’s global <span class="emphasis"><em>
AudibleBell</em></span>
 control is enabled, it also generates a sound.
</p><p>
Any bell event generated by this request contains all of the information about
the bell that was requested, including the symbolic name specified by <span class="emphasis"><em>
name</em></span>
 and the event window specified by window. The <span class="emphasis"><em>
name</em></span>
 and <span class="emphasis"><em>
window</em></span>
 are not directly interpreted by XKB, but they must have the value <span class="emphasis"><em>
None</em></span>
 or specify a legal Atom or Window, respectively. <span class="emphasis"><em>
XkbBellNotify</em></span>
 events generated in response to core protocol or X input extension bell
requests always report <span class="emphasis"><em>
None</em></span>
 as their <span class="emphasis"><em>
name</em></span>
.
</p><p>
The <span class="emphasis"><em>
bellClass</em></span>
, <span class="emphasis"><em>
bellID</em></span>
, and <span class="emphasis"><em>
percent</em></span>
 fields are interpreted as for the X input extension <span class="emphasis"><em>
DeviceBell</em></span>
 request. If <span class="emphasis"><em>
pitch</em></span>
 and <span class="emphasis"><em>
duration</em></span>
 are zero, the server uses the corresponding values for that bell from the core
protocol or input extension, otherwise <span class="emphasis"><em>
pitch</em></span>
 and <span class="emphasis"><em>
duration</em></span>
 are interpreted as for the core protocol <span class="emphasis"><em>
ChangeKeyboardControl</em></span>
 request; if they do not include legal values, a <span class="emphasis"><em>
Value</em></span>
 error results. The <span class="emphasis"><em>
window</em></span>
 field must specify a legal Window or have the value <span class="emphasis"><em>
None</em></span>
, or a <span class="emphasis"><em>
Value</em></span>
 error results. The name field must specify a legal Atom or have the value
<span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results. If an error occurs, this request has no other effect (i.e. does
not cause a sound or generate an event).
</p><p>
The <span class="emphasis"><em>
pitch</em></span>
, <span class="emphasis"><em>
volume</em></span>
, and <span class="emphasis"><em>
duration</em></span>
 are suggested values for the bell, but XKB does not require the server to
honor them.
</p></div><div class="sect2" title="Querying and Changing Keyboard State"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Keyboard_State"></a>Querying and Changing Keyboard State</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetState</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
mods, baseMods, latchedMods, lockedMods: KEYMASK
      </td></tr><tr><td class="protoreply" align="left">
group, lockedGroup: KB_GROUP
      </td></tr><tr><td class="protoreply" align="left">
baseGroup, latchedGroup: INT16
      </td></tr><tr><td class="protoreply" align="left">
compatState: KEYMASK
      </td></tr><tr><td class="protoreply" align="left">
grabMods, compatGrabMods: KB_GROUP
      </td></tr><tr><td class="protoreply" align="left">
lookupMods, compatLookupMods: KEYMASK
      </td></tr><tr><td class="protoreply" align="left">
ptrBtnState: BUTMASK</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
</td></tr></tbody></table></div><p>
This request returns a detailed description of the current state of the
keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 return value contains the input extension identifier for the specified device,
or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension.
</p><p>
The <span class="emphasis"><em>
baseMods</em></span>
 return value reports the modifiers that are set because one or more modifier
keys are logically down. The <span class="emphasis"><em>
latchedMods</em></span>
 and <span class="emphasis"><em>
lockedMods</em></span>
 return values report the modifiers that are latched or locked respectively.
The <span class="emphasis"><em>
mods</em></span>
 return value reports the effective modifier mask which results from the
current combination of base, latched and locked modifiers.
</p><p>
The <span class="emphasis"><em>
baseGroup</em></span>
 return value reports the group state selected by group shift keys that are
logically down. The <span class="emphasis"><em>
latchedGroup</em></span>
 and <span class="emphasis"><em>
lockedGroup</em></span>
 return values detail the effects of latching or locking group shift keys and
<span class="emphasis"><em>
XkbLatchLockState</em></span>
 requests. The <span class="emphasis"><em>
group</em></span>
 return value reports the effective keyboard group which results from the
current combination of base, latched and locked group values.
</p><p>
The <span class="emphasis"><em>
lookupMods</em></span>
 return value reports the lookup modifiers, which consist of the current
effective modifiers minus any server internal modifiers. The <span class="emphasis"><em>
grabMods</em></span>
 return value reports the grab modifiers, which consist of the lookup modifiers
minus any members of the ignore locks mask that are not either latched or
logically depressed. <a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">Keyboard
State</a> describes the lookup modifiers and grab modifiers in more detail.
</p><p>
The <span class="emphasis"><em>
ptrBtnState</em></span>
 return value reports the current logical state of up to five buttons on the
core pointer device.
</p><p>
The <span class="emphasis"><em>
compatState</em></span>
 return value reports the compatibility state that corresponds to the effective
keyboard group and modifier state. The <span class="emphasis"><em>
compatLookupMods</em></span>
 and <span class="emphasis"><em>
compatGrabMods</em></span>
 return values report the core protocol compatibility states that correspond to
the XKB lookup and grab state. All of the compatibility states are computed by
applying the group compatibility mapping to the corresponding XKB modifier and
group states, as described in <a class="link" href="#Group_Compatibility_Map" title="Group Compatibility Map">
Group Compatibility Map</a>.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbLatchLockState</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
affectModLocks, modLocks: KEYMASK</td></tr><tr><td class="protoname" align="left">
lockGroup: BOOL</td></tr><tr><td class="protoname" align="left">
groupLock: KB_GROUP</td></tr><tr><td class="protoname" align="left">
affectModLatches,modLatches: KEYMASK</td></tr><tr><td class="protoname" align="left">
latchGroup: BOOL</td></tr><tr><td class="protoname" align="left">
groupLatch: INT16</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request locks or latches keyboard modifiers and group state for the device
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 specifies an illegal or non-keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error occurs.
</p><p>
The locked state of any modifier specified in the <span class="emphasis"><em>
affectModLocks</em></span>
 mask is set to the corresponding value from <span class="emphasis"><em>
modLocks</em></span>
. If <span class="emphasis"><em>
lockGroup</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the locked keyboard group is set to the group specified by <span class="emphasis"><em>
groupLock</em></span>
. If any modifiers are set in <span class="emphasis"><em>
modLocks</em></span>
 but not <span class="emphasis"><em>
affectModLocks</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error occurs.
</p><p>
The latched state of any modifier specified in the <span class="emphasis"><em>
affectModLatches</em></span>
 mask is set to the corresponding value from <span class="emphasis"><em>
modLatches</em></span>
. If <span class="emphasis"><em>
latchGroup</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the latched keyboard group is set to the group specified by <span class="emphasis"><em>
groupLatch</em></span>
. if any modifiers are set in <span class="emphasis"><em>
modLatches</em></span>
 but not in <span class="emphasis"><em>
affectModLatches</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error occurs.
</p><p>
If the locked group exceeds the maximum number of groups permitted for the
specified keyboard, it is wrapped or truncated back into range as specified by
the global <span class="emphasis"><em>
GroupsWrap</em></span>
<span class="emphasis"><em>
 </em></span>
control. No error results from an out-of-range group specification.
</p><p>
After changing the locked and latched modifiers and groups as specified, the X
server recalculates the effective and compatibility keyboard state and
generates <span class="emphasis"><em>
XkbStateNotify</em></span>
 events as appropriate if any state components have changed. Changing the
keyboard state might also turn indicators on or off which can cause <span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
 events as well.
</p><p>
If any errors occur, this request has no effect.
</p></div><div class="sect2" title="Querying and Changing Keyboard Controls"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Keyboard_Controls"></a>Querying and Changing Keyboard Controls</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetControls</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
mouseKeysDfltBtn: CARD8
      </td></tr><tr><td class="protoreply" align="left">
numGroups: CARD8
      </td></tr><tr><td class="protoreply" align="left">
groupsWrap: KB_GROUPINFO
      </td></tr><tr><td class="protoreply" align="left">
internalMods,ignoreLockMods: KB_MODDEF
      </td></tr><tr><td class="protoreply" align="left">
repeatDelay,repeatInterval: CARD16
      </td></tr><tr><td class="protoreply" align="left">
slowKeysDelay, debounceDelay: CARD16
      </td></tr><tr><td class="protoreply" align="left">
mouseKeysDelay, mouseKeysInterval: CARD16
      </td></tr><tr><td class="protoreply" align="left">
mouseKeysTimeToMax, mouseKeysMaxSpeed: CARD16
      </td></tr><tr><td class="protoreply" align="left">
mouseKeysCurve: INT16
      </td></tr><tr><td class="protoreply" align="left">
accessXOptions: KB_AXOPTIONMASK
      </td></tr><tr><td class="protoreply" align="left">
accessXTimeout: CARD16
      </td></tr><tr><td class="protoreply" align="left">
accessXTimeoutOptionsMask, accessXTimeoutOptionValues: CARD16
      </td></tr><tr><td class="protoreply" align="left">
accessXTimeoutMask,accessXTimeoutValues: CARD32
      </td></tr><tr><td class="protoreply" align="left">
enabledControls: KB_BOOLCTRLMASK
      </td></tr><tr><td class="protoreply" align="left">
perKeyRepeat: LISTofCARD8</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
</td></tr></tbody></table></div><p>
This request returns the current values and status of all controls for the
keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 specifies an illegal device a <span class="emphasis"><em>
Keyboard</em></span>
 error results. On return, the <span class="emphasis"><em>
deviceID</em></span>
 specifies the identifier of the requested device or zero if the server does
not support the input extension.
</p><p>
The <span class="emphasis"><em>
numGroups</em></span>
 return value reports the current number of groups, and <span class="emphasis"><em>
groupsWrap</em></span>
 reports the treatment of out-of-range groups, as described in <a class="link" href="#Key_Symbol_Map" title="Key Symbol Map">Key Symbol Map</a>. The <span class="emphasis"><em>
internalMods</em></span>
 and <span class="emphasis"><em>
ignoreLockMods</em></span>
 return values report the current values of the server internal and ignore
locks modifiers as described in <a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">
Keyboard State</a>. Both are modifier definitions (
<a class="link" href="#Modifier_Definitions" title="Modifier Definitions">Modifier Definitions</a>) which
report the real modifiers, virtual modifiers, and the resulting combination of
real modifiers that are bound to the corresponding control.
</p><p>
The <span class="emphasis"><em>
repeatDelay</em></span>
, <span class="emphasis"><em>
repeatInterval</em></span>
, <span class="emphasis"><em>
slowKeysDelay</em></span>
 and <span class="emphasis"><em>
debounceDelay</em></span>
 fields report the current values of the for the autorepeat delay, autorepeat
interval, slow keys delay and bounce keys timeout, respectively. The <span class="emphasis"><em>
mouseKeysDelay</em></span>
, <span class="emphasis"><em>
mouseKeysInterval</em></span>
, <span class="emphasis"><em>
mouseKeysTimeToMax</em></span>
 and <span class="emphasis"><em>
mouseKeysMaxSpeed</em></span>
 and <span class="emphasis"><em>
mouseKeysCurve</em></span>
 return values report the current acceleration applied to mouse keys, as
described in <a class="link" href="#The_MouseKeysAccel_Control" title="The MouseKeysAccel Control">The MouseKeysAccel
Control</a>. All times are reported in milliseconds.
</p><p>
The <span class="emphasis"><em>
mouseKeysDfltBtn</em></span>
 return value reports the current default pointer button for which events are
synthesized by the mouse keys server actions.
</p><p>
The <span class="emphasis"><em>
accessXOptions</em></span>
 return value reports the current settings of the various AccessX options flags
which govern the behavior of the <span class="emphasis"><em>
StickyKeys</em></span>
 control and of AccessX feedback.
</p><p>
The <span class="emphasis"><em>
accessXTimeout</em></span>
 return value reports the length of time, in seconds, that the keyboard must
remain idle before AccessX controls are automatically changed; an <span class="emphasis"><em>
accessXTimeout</em></span>
 of <span class="emphasis"><em>
0</em></span>
 indicates that AccessX controls are not automatically changed. The <span class="emphasis"><em>
accessXTimeoutMask</em></span>
 specifies the boolean controls to be changed if the AccessX timeout expires;
the <span class="emphasis"><em>
accessXTimeoutValues</em></span>
 field specifies new values for all of the controls in the timeout mask. The
<span class="emphasis"><em>
accessXTimeoutOptionsMask</em></span>
 field specifies the AccessX options to be changed when the AccessX timeout
expires; the <span class="emphasis"><em>
accessXTimeoutOptionValues</em></span>
 return value reports the values to which they will be set.
</p><p>
The <span class="emphasis"><em>
enabledControls</em></span>
 return value reports the current state of all of the global boolean controls.
</p><p>
The <span class="emphasis"><em>
perKeyRepeat</em></span>
 array consists of one bit per key and reports the current autorepeat behavior
of each keyboard key; if a bit is set in <span class="emphasis"><em>
perKeyRepeat</em></span>
, the corresponding key repeats if it is held down while global keyboard
autorepeat is enabled. This array parallels the core protocol and input
extension keyboard controls, if the autorepeat behavior of a key is changed via
the core protocol or input extension, those changes are automatically reflected
in the <span class="emphasis"><em>
perKeyRepeat</em></span>
 array.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetControls</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
affectInternalRealMods, internalRealMods: KEYMASK</td></tr><tr><td class="protoname" align="left">
affectInternalVirtualMods,internalVirtualMods: KB_VMODMASK</td></tr><tr><td class="protoname" align="left">
affectIgnoreLockRealMods,ignoreLockRealMods: KB_MODMASK</td></tr><tr><td class="protoname" align="left">
affectIgnoreLockVirtualMods,ignoreLockVirtualMods: KB_VMODMASK</td></tr><tr><td class="protoname" align="left">
mouseKeysDfltBtn: CARD8</td></tr><tr><td class="protoname" align="left">
groupsWrap: KB_GROUPINFO</td></tr><tr><td class="protoname" align="left">
accessXOptions: CARD16</td></tr><tr><td class="protoname" align="left">
affectEnabledControls: KB_BOOLCTRLMASK</td></tr><tr><td class="protoname" align="left">
enabledControls: KB_BOOLCTRLMASK</td></tr><tr><td class="protoname" align="left">
changeControls: KB_CONTROLMASK</td></tr><tr><td class="protoname" align="left">
repeatDelay,repeatInterval: CARD16</td></tr><tr><td class="protoname" align="left">
slowKeysDelay, debounceDelay: CARD16</td></tr><tr><td class="protoname" align="left">
mouseKeysDelay, mouseKeysInterval: CARD16</td></tr><tr><td class="protoname" align="left">
mouseKeysTimeToMax, mouseKeysMaxSpeed: CARD16</td></tr><tr><td class="protoname" align="left">
mouseKeysCurve: INT16</td></tr><tr><td class="protoname" align="left">
accessXTimeout: CARD16</td></tr><tr><td class="protoname" align="left">
accessXTimeoutMask, accessXTimeoutValues: KB_BOOLCTRLMASK</td></tr><tr><td class="protoname" align="left">
accessXTimeoutOptionsMask,accessXTimeoutOptionsValues: CARD16</td></tr><tr><td class="protoname" align="left">
perKeyRepeat: LISTofCARD8</td></tr><tr><td class="protoerror" align="left">Errors:<span class="emphasis"><em>
 Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request sets the keyboard controls indicated in <span class="emphasis"><em>
changeControls</em></span>
 for the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. Each bit that is set in <span class="emphasis"><em>
changeControls</em></span>
 indicates that one or more of the other request fields should be applied, as
follows:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Bit in changeControls</th><th align="left">Field(s) to be Applied</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
XkbRepeatKeysMask</em></span>
</td><td align="left"><span class="emphasis"><em>
repeatDelay</em></span>
, <span class="emphasis"><em>
repeatInterval</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbSlowKeysMask</em></span>
</td><td align="left"><span class="emphasis"><em>
slowKeysDelay</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbStickyKeysMask</em></span>
</td><td align="left"><span class="emphasis"><em>
accessXOptions</em></span>
 (only the <span class="emphasis"><em>
XkbAX_TwoKeys</em></span>
<span class="emphasis"><em>
 </em></span>
and the <span class="emphasis"><em>
XkbAX_LatchToLock</em></span>
 options are affected)</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbBounceKeysMask</em></span>
</td><td align="left"><span class="emphasis"><em>
debounceDelay</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbMouseKeysMask</em></span>
</td><td align="left"><span class="emphasis"><em>
mouseKeysDfltBtn</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbMouseKeysAccelMask</em></span>
</td><td align="left"><span class="emphasis"><em>
mouseKeysDelay</em></span>
, <span class="emphasis"><em>
mouseKeysInterval</em></span>
, <span class="emphasis"><em>
mouseKeysCurve</em></span>
, <span class="emphasis"><em>
mouseKeysTimeToMax</em></span>
, <span class="emphasis"><em>
mouseKeysMaxSpeed</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbAccessXKeysMask</em></span>
</td><td align="left"><span class="emphasis"><em>
accessXOptions (all options)</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbAccessXTimeoutMask</em></span>
</td><td align="left"><span class="emphasis"><em>
accessXTimeout</em></span>
, <span class="emphasis"><em>
accessXTimeoutMask</em></span>
, <span class="emphasis"><em>
accessXTimeoutValues</em></span>
, <span class="emphasis"><em>
accessXTimeoutOptionsMask</em></span>
, <span class="emphasis"><em>
accessXTimeoutOptionsValues</em></span>
</td></tr><tr><td align="left">XkbAccessXFeedbackMask</td><td align="left"><span class="emphasis"><em>
accessXOptions</em></span>
 (all options except those affected by the <span class="emphasis"><em>
XkbStickyKeysMask</em></span>
 bit)</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGroupsWrapMask</em></span>
</td><td align="left"><span class="emphasis"><em>
groupsWrap</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbInternalModsMask</em></span>
</td><td align="left"><span class="emphasis"><em>
affectInternalRealMods</em></span>
, <span class="emphasis"><em>
internalRealMods</em></span>
, <span class="emphasis"><em>
affectInternalVirtualMods</em></span>
, <span class="emphasis"><em>
internalVirtualMods</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbIgnoreLockModsMask</em></span>
</td><td align="left"><span class="emphasis"><em>
affectIgnoreLockRealMods</em></span>
, <span class="emphasis"><em>
ignoreLockRealMods</em></span>
, <span class="emphasis"><em>
affectIgnoreLockVirtualMods</em></span>
, <span class="emphasis"><em>
ignoreLockVirtualMods</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbPerKeyRepeatMask</em></span>
</td><td align="left"><span class="emphasis"><em>
perKeyRepeat</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbControlsEnabledMask</em></span>
</td><td align="left"><span class="emphasis"><em>
affectEnabledControls</em></span>
, <span class="emphasis"><em>
enabledControls</em></span>
</td></tr></tbody></table></div><p>
If any other bits are set in <span class="emphasis"><em>
changeControls</em></span>
, a <span class="emphasis"><em>
Value</em></span>
 error results. If any of the bits listed above are not set in <span class="emphasis"><em>
changeControls</em></span>
, the corresponding fields must have the value <span class="emphasis"><em>
0</em></span>
, or a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If applied, <span class="emphasis"><em>
repeatDelay</em></span>
 and <span class="emphasis"><em>
repeatInterval</em></span>
 change the autorepeat characteristics of the keyboard, as described in
<a class="link" href="#The_RepeatKeys_Control" title="The RepeatKeys Control">The RepeatKeys Control</a>. If
specified, <span class="emphasis"><em>
repeatDelay</em></span>
 and <span class="emphasis"><em>
repeatInterval</em></span>
 must both be non-zero or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If applied, the <span class="emphasis"><em>
slowKeysDelay</em></span>
 field specifies a new delay for the <span class="emphasis"><em>
SlowKeys</em></span>
 control, as defined in <a class="link" href="#The_SlowKeys_Control" title="The SlowKeys Control">The
SlowKeys Control</a>. If specified, <span class="emphasis"><em>
slowKeysDelay</em></span>
 must be non-zero, or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If applied, the <span class="emphasis"><em>
debounceDelay</em></span>
 field specifies a new delay for the <span class="emphasis"><em>
BounceKeys</em></span>
 control, as described in <a class="link" href="#The_BounceKeys_Control" title="The BounceKeys Control">The
BounceKeys Control</a>. If present, the <span class="emphasis"><em>
debounceDelay</em></span>
 must be non-zero or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If applied, the <span class="emphasis"><em>
mouseKeysDfltBtn</em></span>
 field specifies the core pointer button for which events are generated
whenever a <span class="emphasis"><em>
SA_PtrBtn</em></span>
 or <span class="emphasis"><em>
SA_LockPtrBtn</em></span>
 key action is activated. If present, <span class="emphasis"><em>
mouseKeysDfltBtn</em></span>
 must specify a legal button for the core pointer device, or a <span class="emphasis"><em>
Value</em></span>
 error results. <a class="link" href="#Key_Actions" title="Key Actions">Key
Actions</a> describes the <span class="emphasis"><em>
SA_PtrBtn</em></span>
 and <span class="emphasis"><em>
SA_LockPtrBtn</em></span>
 actions in more detail.
</p><p>
If applied, the <span class="emphasis"><em>
mouseKeysDelay</em></span>
, <span class="emphasis"><em>
mouseKeysInterval</em></span>
, <span class="emphasis"><em>
mouseKeysTimeToMax</em></span>
, <span class="emphasis"><em>
mouseKeysMaxSpeed</em></span>
 and <span class="emphasis"><em>
mouseKeysCurve</em></span>
 fields change the rate at which the pointer moves when a key which generates a
<span class="emphasis"><em>
SA_MovePtr</em></span>
 action is held down. <a class="link" href="#The_MouseKeysAccel_Control" title="The MouseKeysAccel Control">The
MouseKeysAccel Control</a> describes these <span class="emphasis"><em>
MouseKeysAccel</em></span>
 parameters in more detail. If defined, the <span class="emphasis"><em>
mouseKeysDelay</em></span>
, <span class="emphasis"><em>
mouseKeysInterval</em></span>
, <span class="emphasis"><em>
mouseKeysTimeToMax</em></span>
 and <span class="emphasis"><em>
mouseKeysMaxSpeed</em></span>
 values must all be greater than zero, or a <span class="emphasis"><em>
Value</em></span>
 error results. The <span class="emphasis"><em>
mouseKeysCurve</em></span>
 value must be greater than <span class="emphasis"><em>
-1000</em></span>
 or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If applied, the <span class="emphasis"><em>
accessXOptions</em></span>
 field sets the AccessX options, which are described in detail in
<a class="link" href="#The_AccessXKeys_Control" title="The AccessXKeys Control">The AccessXKeys Control</a>. If
either one of <span class="emphasis"><em>
XkbStickyKeysMask</em></span>
 and <span class="emphasis"><em>
XkbAccessXFeedbackMask</em></span>
 are set in <span class="emphasis"><em>
changeControls</em></span>
 and <span class="emphasis"><em>
XkbAccessXKeysMask</em></span>
 is not, only a subset of the AccessX options are changed, as described in the
table above; if both are set or if the <span class="emphasis"><em>
AccessXKeys</em></span>
 bit is set in <span class="emphasis"><em>
changeControls</em></span>
, all of the AccessX options are updated. Any bit in <span class="emphasis"><em>
accessXOptions</em></span>
 whose interpretation is undefined must be zero, or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If applied, the <span class="emphasis"><em>
accessXTimeout</em></span>
, <span class="emphasis"><em>
accessXTimeoutMask</em></span>
, <span class="emphasis"><em>
accessXTimeoutValues</em></span>
, <span class="emphasis"><em>
accessXTimeoutOptionsMask</em></span>
 and <span class="emphasis"><em>
accessXTimeoutOptionsValues</em></span>
 fields change the behavior of the AccessX Timeout control, as described in
<a class="link" href="#The_AccessXTimeout_Control" title="The AccessXTimeout Control">The AccessXTimeout
Control</a>. The <span class="emphasis"><em>
accessXTimeout</em></span>
 must be greater than zero, or a <span class="emphasis"><em>
Value</em></span>
 error results. The <span class="emphasis"><em>
accessXTimeoutMask</em></span>
 or <span class="emphasis"><em>
accessXTimeoutValues</em></span>
 fields must specify only legal boolean controls, or a <span class="emphasis"><em>
Value</em></span>
 error results. The <span class="emphasis"><em>
accessXTimeoutOptionsMask</em></span>
 and <span class="emphasis"><em>
accessXTimeoutOptionsValues</em></span>
 fields must contain only legal AccessX options or a <span class="emphasis"><em>
Value</em></span>
 error results. If any bits are set in either values field but not in the
corresponding mask, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If present, the <span class="emphasis"><em>
groupsWrap</em></span>
 field specifies the treatment of out-of-range keyboard groups, as described in
<a class="link" href="#Key_Symbol_Map" title="Key Symbol Map">Key Symbol Map</a>. If the
<span class="emphasis"><em>
groupsWrap</em></span>
 field does not specify a legal treatment for out-of-range groups, a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If present, the <span class="emphasis"><em>
affectInternalRealMods</em></span>
 field specifies the set of real modifiers to be changed in the internal
modifier definition and the <span class="emphasis"><em>
internalRealMods</em></span>
 field specifies new values for those modifiers. The <span class="emphasis"><em>
affectInternalVirtualMods</em></span>
 and <span class="emphasis"><em>
internalVirtualMods</em></span>
 fields update the virtual modifier component of the modifier definition that
describes the internal modifiers in the same way. If any bits are set in either
values field but not in the corresponding mask field, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If present, the <span class="emphasis"><em>
affectIgnoreLockRealMods</em></span>
 field specifies the set of real modifiers to be changed in the ignore locks
modifier definition and the <span class="emphasis"><em>
ignoreLockRealMods</em></span>
 field specifies new values for those modifiers. The <span class="emphasis"><em>
affectIgnoreLockVirtualMods</em></span>
 and <span class="emphasis"><em>
ignoreLockVirtualMods</em></span>
 fields update the virtual modifier component of the ignore locks modifier
definition in the same way. If any bits are set in either values field but not
in the corresponding mask field, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If present, the <span class="emphasis"><em>
perKeyRepeat</em></span>
 array specifies the repeat behavior of the individual keyboard keys. The
corresponding core protocol or input extension per-key autorepeat information
is updated to reflect any changes specified in <span class="emphasis"><em>
perKeyRepeat</em></span>
. If the bits that correspond to any out-of-range keys are set in <span class="emphasis"><em>
perKeyRepeat</em></span>
, a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If present, the <span class="emphasis"><em>
affectEnabledControls</em></span>
 and <span class="emphasis"><em>
enabledControls</em></span>
 field enable and disable global boolean controls. Any controls set in both
fields are enabled; any controls that are set in <span class="emphasis"><em>
affectEnabledControls</em></span>
 but not in <span class="emphasis"><em>
enabledControls</em></span>
 are disabled. Controls that are not set in either field are not affected. If
any controls are specified in <span class="emphasis"><em>
enabledControls</em></span>
 but not in <span class="emphasis"><em>
affectEnabledControls</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results. If either field contains anything except boolean controls, a
<span class="emphasis"><em>
Value</em></span>
 error results.
</p></div><div class="sect2" title="Querying and Changing the Keyboard Mapping"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_the_Keyboard_Mapping"></a>Querying and Changing the Keyboard Mapping</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetMap</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
full, partial:	KB_MAPPARTMASK</td></tr><tr><td class="protoname" align="left">
firstType, nTypes: CARD8</td></tr><tr><td class="protoname" align="left">
firstKeySym, firstKeyAction: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeySyms, nKeyActions: CARD8</td></tr><tr><td class="protoname" align="left">
firstKeyBehavior,firstKeyExplicit: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeyBehaviors,nKeyExplicit: CARD8</td></tr><tr><td class="protoname" align="left">
firstModMapKey,firstVModMapKey: KEYCODE</td></tr><tr><td class="protoname" align="left">
nModMapKeys, nVModMapKeys: CARD8</td></tr><tr><td class="protoname" align="left">
virtualMods: KB_VMODMASK
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
minKeyCode, maxKeyCode: KEYCODE
      </td></tr><tr><td class="protoreply" align="left">
present: KB_MAPPARTMASK
      </td></tr><tr><td class="protoreply" align="left">
firstType, nTypes, nTotalTypes: CARD8
      </td></tr><tr><td class="protoreply" align="left">
firstKeySym, firstKeyAction: KEYCODE
      </td></tr><tr><td class="protoreply" align="left">
nKeySyms, nKeyActions: CARD8
      </td></tr><tr><td class="protoreply" align="left">
totalSyms, totalActions: CARD16
      </td></tr><tr><td class="protoreply" align="left">
firstKeyBehavior, firstKeyExplicit: KEYCODE
      </td></tr><tr><td class="protoreply" align="left">
nKeyBehaviors, nKeyExplicit: CARD8
      </td></tr><tr><td class="protoreply" align="left">
totalKeyBehaviors, totalKeyExplicit: CARD8
      </td></tr><tr><td class="protoreply" align="left">
firstModMapKey, firstVModMapKey: KEYCODE
      </td></tr><tr><td class="protoreply" align="left">
nModMapKeys, nVModMapKeys: CARD8
      </td></tr><tr><td class="protoreply" align="left">
totalModMapKeys, totalVModMapKeys: CARD8
      </td></tr><tr><td class="protoreply" align="left">
virtualMods: KB_VMODMASK
      </td></tr><tr><td class="protoreply" align="left">
typesRtrn: LISTofKB_KEYTYPE
      </td></tr><tr><td class="protoreply" align="left">
symsRtrn: LISTofKB_KEYSYMMAP
      </td></tr><tr><td class="protoreply" align="left">
actsRtrn: { count: LISTofCARD8, acts: LISTofKB_ACTION }
      </td></tr><tr><td class="protoreply" align="left">
behaviorsRtrn: LISTofKB_SETBEHAVIOR
      </td></tr><tr><td class="protoreply" align="left">
vmodsRtrn: LISTofSETofKEYMASK
      </td></tr><tr><td class="protoreply" align="left">
explicitRtrn: LISTofKB_SETEXPLICIT
      </td></tr><tr><td class="protoreply" align="left">
modmapRtrn: LISTofKB_KEYMODMAP
      </td></tr><tr><td class="protoreply" align="left">
vmodMapRtrn: LISTofKB_KEYVMODMAP
      </td></tr><tr><td class="protoerror" align="left">
Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
This request returns the indicated components of the server and client maps of
the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. The <span class="emphasis"><em>
full</em></span>
 mask specifies the map components to be returned in full; the <span class="emphasis"><em>
partial</em></span>
 mask specifies the components for which some subset of the legal elements are
to be returned. The server returns a <span class="emphasis"><em>
Match</em></span>
 error if any component is specified in both <span class="emphasis"><em>
full</em></span>
 and <span class="emphasis"><em>
partial</em></span>
, or a <span class="emphasis"><em>
Value</em></span>
 error if any undefined bits are set in either <span class="emphasis"><em>
full</em></span>
 or <span class="emphasis"><em>
partial</em></span>
.
</p><p>
Each bit in the <span class="emphasis"><em>
partial</em></span>
 mask controls the interpretation of one or more of the other request fields,
as follows:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">Bit in the Partial Mask</th><th align="left">Type</th><th align="left">Corresponding Field(s)</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
XkbKeyTypesMask</em></span>
</td><td align="left">key types</td><td align="left"><span class="emphasis"><em>
firstType</em></span>
, <span class="emphasis"><em>
nTypes</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKeySymsMask</em></span>
</td><td align="left">keycodes</td><td align="left"><span class="emphasis"><em>
firstKeySym</em></span>
, <span class="emphasis"><em>
nKeySyms</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKeyActionsMask</em></span>
</td><td align="left">keycodes</td><td align="left"><span class="emphasis"><em>
firstKeyAction</em></span>
, <span class="emphasis"><em>
nKeyActions</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKeyBehaviorsMask</em></span>
</td><td align="left">keycodes</td><td align="left"><span class="emphasis"><em>
firstKeyBehavior</em></span>
, <span class="emphasis"><em>
nKeyBehaviors</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbExplicitComponentsMask</em></span>
</td><td align="left">keycodes</td><td align="left"><span class="emphasis"><em>
firstKeyExplicit</em></span>
, <span class="emphasis"><em>
nKeyExplicit</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbModifierMapMask</em></span>
</td><td align="left">keycodes</td><td align="left"><span class="emphasis"><em>
firstModMapKey</em></span>
, <span class="emphasis"><em>
nModMapKeys</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbVirtualModMapMask</em></span>
</td><td align="left">keycodes</td><td align="left"><span class="emphasis"><em>
firstVModMapKey</em></span>
, <span class="emphasis"><em>
nVModMapKeys</em></span>
</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbVirtualModsMask</em></span>
</td><td align="left">virtual modifiers</td><td align="left"><span class="emphasis"><em>
virtualMods</em></span>
</td></tr></tbody></table></div><p>
If any of these keyboard map components are specified in <span class="emphasis"><em>
partial</em></span>
, the corresponding values must specify a valid subset of the requested
components or this request reports a <span class="emphasis"><em>
Value</em></span>
 error. If a keyboard map component is not specified in <span class="emphasis"><em>
partial</em></span>
, the corresponding fields must contain zeroes, or a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If any error is generated, the request aborts and does not report any values.
</p><p>
On successful return, the <span class="emphasis"><em>
deviceID</em></span>
 field reports the X input extension device ID of the keyboard for which
information is being returned, or <span class="emphasis"><em>
0</em></span>
 if the server does not support the X input extension. The <span class="emphasis"><em>
minKeyCode</em></span>
 and <span class="emphasis"><em>
maxKeyCode</em></span>
 return values report the minimum and maximum keycodes that are legal for the
keyboard in question.
</p><p>
The <span class="emphasis"><em>
present</em></span>
 return value lists all of the keyboard map components contained in the reply.
The bits in <span class="emphasis"><em>
present</em></span>
 affect the interpretation of the other return values as follows:
</p><p>
If <span class="emphasis"><em>
XkbKeyTypesMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>
firstType</em></span>
 and <span class="emphasis"><em>
nTypes</em></span>
 specify the types reported in the reply.
  </p></li><li class="listitem"><p><span class="emphasis"><em>
nTotalTypes</em></span>
 reports the total number of types defined for the keyboard
  </p></li><li class="listitem"><p><span class="emphasis"><em>
typesRtrn</em></span>
 has <span class="emphasis"><em>
nTypes</em></span>
 elements of type KB_KEYTYPE which describe consecutive key types starting from
<span class="emphasis"><em>
firstType</em></span>
.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbKeySymsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>
firstKeySym</em></span>
 and <span class="emphasis"><em>
nKeySyms</em></span>
 specify the subset of the keyboard keys for which symbols will be reported.
  </p></li><li class="listitem"><p><span class="emphasis"><em>
totalSyms</em></span>
 reports the total number of keysyms bound to the keys returned in this reply.
  </p></li><li class="listitem"><p><span class="emphasis"><em>
symsRtrn</em></span>
 has <span class="emphasis"><em>
nKeySyms</em></span>
 elements of type KB_KEYSYMMAP, which describe the symbols bound to consecutive
keys starting from <span class="emphasis"><em>
firstKeySym</em></span>
.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbKeyActionsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>
firstKeyAction</em></span>
 and <span class="emphasis"><em>
nKeyActions</em></span>
 specify the subset of the keys for which actions are reported.
  </p></li><li class="listitem"><p><span class="emphasis"><em>
totalActions</em></span>
 reports the total number of actions bound to the returned keys.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
count </em></span>
field of the <span class="emphasis"><em>
actsRtrn</em></span>
 return value has <span class="emphasis"><em>
nKeyActions</em></span>
 entries of type CARD8, which specify the number of actions bound to
consecutive keys starting from <span class="emphasis"><em>
firstKeyAction</em></span>
. The <span class="emphasis"><em>
acts</em></span>
 field of <span class="emphasis"><em>
actsRtrn</em></span>
 has <span class="emphasis"><em>
totalActions</em></span>
 elements of type KB_ACTION and specifies the actions bound to the keys.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbKeyBehaviorsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
firstKeyBehavior</em></span>
 and <span class="emphasis"><em>
nKeyBehaviors</em></span>
 return values report the range of keyboard keys for which behaviors will be
reported.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
totalKeyBehaviors</em></span>
 return value reports the number of keys in the range to be reported that have
non-default values.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
behaviorsRtrn</em></span>
 value has <span class="emphasis"><em>
totalKeyBehaviors</em></span>
 entries of type KB_BEHAVIOR. Each entry specifies a key in the range for which
behaviors are being reported and the behavior associated with that key. Any
keys in that range that do not have an entry in <span class="emphasis"><em>
behaviorsRtrn</em></span>
 have the default behavior, <span class="emphasis"><em>
KB_Default</em></span>
.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbExplicitComponentsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
firstKeyExplicit</em></span>
 and <span class="emphasis"><em>
nKeyExplicit</em></span>
 return values report the range of keyboard keys for which the set of explicit
components is to be returned.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
totalKeyExplicit</em></span>
 return value reports the number of keys in the range specified by <span class="emphasis"><em>
firstKeyExplicit</em></span>
 and <span class="emphasis"><em>
nKeyExplicit</em></span>
 that have one or more explicit components.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
explicitRtrn</em></span>
 return value has <span class="emphasis"><em>
totalKeyExplicit</em></span>
 entries of type KB_KEYEXPLICIT. Each entry specifies the a key in the range
for which explicit components are being reported and the explicit components
that are bound to it. Any keys in that range that do not have an entry in
<span class="emphasis"><em>
explicitRtrn</em></span>
 have no explicit components.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbModifierMapMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
firstModMapKey</em></span>
 and <span class="emphasis"><em>
nModMapKeys</em></span>
 return values report the range of keyboard keys for which the modifier map is
to be reported.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
totalModMapKeys</em></span>
 return value reports the number of keys in the range specified by <span class="emphasis"><em>
firstModMapKey</em></span>
 and <span class="emphasis"><em>
nModMapKeys</em></span>
 that are bound with to one or more modifiers.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
modmapRtrn</em></span>
 return value has <span class="emphasis"><em>
totalModMapKeys</em></span>
 entries of type KB_KEYMODMAP. Each entry specifies the a key in the range for
which the modifier map is being reported and the set of modifiers that are
bound to that key. Any keys in that range that do not have an entry in
<span class="emphasis"><em>
modmapRtrn</em></span>
 are not associated with any modifiers by the modifier mapping.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbVirtualModMapMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
firstVModMapKey</em></span>
 and <span class="emphasis"><em>
nVModMapKeys</em></span>
 return values report the range of keyboard keys for which the virtual modifier
map is to be reported.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
totalVModMapKeys</em></span>
 return value reports the number of keys in the range specified by <span class="emphasis"><em>
firstVModMapKey</em></span>
 and <span class="emphasis"><em>
nVModMapKeys</em></span>
 that are bound with to or more virtual modifiers.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
vmodmapRtrn</em></span>
 return value has <span class="emphasis"><em>
totalVModMapKeys</em></span>
 entries of type KB_KEYVMODMAP. Each entry specifies the a key in the range for
which the virtual modifier map is being reported and the set of virtual
modifiers that are bound to that key. Any keys in that range that do not have
an entry in <span class="emphasis"><em>
vmodmapRtrn</em></span>
 are not associated with any virtual modifiers,
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbVirtualModsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
virtualMods</em></span>
 return value is a mask with one bit per virtual modifier which specifies the
virtual modifiers for which a set of corresponding real modifiers is to be
returned.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
vmodsRtrn</em></span>
 return value is a list with one entry of type KEYBUTMASK for each virtual
modifier that is specified in <span class="emphasis"><em>
virtualMods</em></span>
. The entries in <span class="emphasis"><em>
vmodsRtrn</em></span>
 contain the real modifier bindings for the specified virtual modifiers,
beginning with the lowest-numbered virtual modifier that is present in
<span class="emphasis"><em>
virtualMods</em></span>
 and proceeding to the highest.
  </p></li></ul></div><p>
If any of these bits are not set in <span class="emphasis"><em>
present</em></span>
, the corresponding numeric fields all have the value zero, and the
corresponding lists are all of length zero.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetMap</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
flags: { <span class="emphasis"><em>
SetMapResizeTypes, SetMapRecomputeActions </em></span>
}</td></tr><tr><td class="protoname" align="left">
present: KB_MAPPARTMASK</td></tr><tr><td class="protoname" align="left">
minKeyCode, maxKeyCode: KEYCODE</td></tr><tr><td class="protoname" align="left">
firstType, nTypes: CARD8</td></tr><tr><td class="protoname" align="left">
firstKeySym, firstKeyAction: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeySyms, nKeyActions: CARD8</td></tr><tr><td class="protoname" align="left">
totalSyms, totalActions: CARD16</td></tr><tr><td class="protoname" align="left">
firstKeyBehavior, firstKeyExplicit: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeyBehaviors, nKeyExplicit: CARD8</td></tr><tr><td class="protoname" align="left">
totalKeyBehaviors, totalKeyExplicit: CARD8</td></tr><tr><td class="protoname" align="left">
firstModMapKey, firstVModMapKey: KEYCODE</td></tr><tr><td class="protoname" align="left">
nModMapKeys, nVModMapKeys: CARD8</td></tr><tr><td class="protoname" align="left">
totalModMapKeys, totalVModMapKeys: CARD8</td></tr><tr><td class="protoname" align="left">
virtualMods: VMODMASK</td></tr><tr><td class="protoname" align="left">
types: LISTofKB_KEYTYPE</td></tr><tr><td class="protoname" align="left">
syms: LISTofKB_KEYSYMMAP</td></tr><tr><td class="protoname" align="left">
actions: { count: LISTofCARD8, actions: LISTofKB_ACTION }</td></tr><tr><td class="protoname" align="left">
behaviors: LISTofKB_BEHAVIOR</td></tr><tr><td class="protoname" align="left">
vmods: LISTofKEYMASK</td></tr><tr><td class="protoname" align="left">
explicit: LISTofKB_EXPLICIT</td></tr><tr><td class="protoname" align="left">
modmap: LISTofKB_KEYMODMAP</td></tr><tr><td class="protoname" align="left">
vmodmap: LISTofKB_KEYVMODMAP</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
This request changes the indicated parts of the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. With XKB, the effect of a key release is independent of the keyboard mapping
at the time of the release, so this request can be processed regardless of the
logical state of the modifier keys at the time of the request.
</p><p>
The <span class="emphasis"><em>
present</em></span>
 field specifies the keyboard map components contained to be changed. The bits
in <span class="emphasis"><em>
present</em></span>
 affect the interpretation of the other fields as follows:
</p><p>
If <span class="emphasis"><em>
XkbKeyTypesMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstType</em></span>
 and <span class="emphasis"><em>
nTypes</em></span>
 specify a subset of the key types bound to the keyboard to be changed or
created. The index of the first key type to be changed must be less than or
equal to the unmodified length of the list of key types or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If <span class="emphasis"><em>
XkbKeyTypesMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
 and <span class="emphasis"><em>
SetMapResizeTypes</em></span>
 is set in <span class="emphasis"><em>
flags</em></span>
, the server resizes the list of key types bound to the keyboard so that the
last key type specified by this request is the last element in the list. If the
list of key types is shrunk, any existing key definitions that use key types
that eliminated are automatically assigned key types from the list of canonical
key types as described in <a class="link" href="#Assigning_Types_To_Groups_of_Symbols_for_a_Key" title="Assigning Types To Groups of Symbols for a Key">
Assigning Types To Groups of Symbols for a Key</a>. The list of key types
bound to a keyboard must always include the four canonical types and cannot
have more than <span class="emphasis"><em>
XkbMaxTypesPerKey</em></span>
 (32) types; any attempt to reduce the number of types bound to a keyboard
below four or above <span class="emphasis"><em>
XkbMaxTypesPerKey</em></span>
 causes a <span class="emphasis"><em>
Value</em></span>
 error. Symbolic names for newly created key types or levels within a key type
are initialized to <span class="emphasis"><em>
None</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbKeyTypesMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, the types list has <span class="emphasis"><em>
nTypes</em></span>
 entries of type KB_KEYTYPE.Each key type specified in <span class="emphasis"><em>
types</em></span>
 must be valid or a <span class="emphasis"><em>
Value</em></span>
 error results. To be valid a key type definition must meet the following
criteria:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
numLevels</em></span>
 for the type must be greater than zero.
  </p></li><li class="listitem"><p>If the key type is <span class="emphasis"><em>
ONE_LEVEL</em></span>
 (i.e. index zero in the list of key types), <span class="emphasis"><em>
numLevels</em></span>
 must be one.
  </p></li><li class="listitem"><p>If the key type is <span class="emphasis"><em>
TWO_LEVEL</em></span>
 or <span class="emphasis"><em>
KEYPAD</em></span>
, or <span class="emphasis"><em>
ALPHABETIC</em></span>
 (i.e. index one, two, or three in the lest of key types) group width must be
two.
  </p></li></ul></div><p>
Each key type in types must also be internally consistent, or a Match error
results. To be internally consistent, a key type definition must meet the
following criteria:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Each map entry must specify a resulting level that is legal for the
type.
  </p></li><li class="listitem"><p>Any real or virtual modifiers specified in any of the map entries must
also be specified in the <span class="emphasis"><em>
mods</em></span>
 for the type.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbKeySymsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstKeySym</em></span>
 and <span class="emphasis"><em>
nKeySyms</em></span>
 specify a subset of the keyboard keys to which new symbols are to be assigned
and <span class="emphasis"><em>
totalSyms</em></span>
 specifies the total number of symbols to be assigned to those keys. If any of
the keys specified by <span class="emphasis"><em>
firstKeySym</em></span>
 and <span class="emphasis"><em>
nKeySyms</em></span>
 are not legal, a <span class="emphasis"><em>
Match</em></span>
 error results. The <span class="emphasis"><em>
syms</em></span>
 list has <span class="emphasis"><em>
nKeySyms</em></span>
 elements of type KB_KEYSYMMAP. Each key in the resulting key symbol map must
be valid and internally consistent or a <span class="emphasis"><em>
Value</em></span>
 error results. To be valid and internally consistent, a key symbol map must
meet the following criteria:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The key type indices must specify legal result key types.
  </p></li><li class="listitem"><p>The number of groups specified by <span class="emphasis"><em>
groupInfo</em></span>
 must be in the range <span class="emphasis"><em>
0…4</em></span>
.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
width</em></span>
 of the key symbol map must be equal to <span class="emphasis"><em>
numLevels</em></span>
 of the widest key type bound to the key.
  </p></li><li class="listitem"><p>The number of symbols, <span class="emphasis"><em>
nSyms</em></span>
, must equal the number of groups times <span class="emphasis"><em>
width</em></span>
.
  </p></li></ul></div><p>
If <span class="emphasis"><em>
XkbKeyActionsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstKeyAction</em></span>
 and <span class="emphasis"><em>
nKeyActions</em></span>
 specify a subset of the keyboard keys to which new actions are to be assigned
and <span class="emphasis"><em>
totalActions</em></span>
 specifies the total number of actions to be assigned to those keys. If any of
the keys specified by <span class="emphasis"><em>
firstKeyAction</em></span>
 and <span class="emphasis"><em>
nKeyActions</em></span>
 are not legal, a <span class="emphasis"><em>
Match</em></span>
 error results. The <span class="emphasis"><em>
count</em></span>
 field of the <span class="emphasis"><em>
actions</em></span>
 return value has <span class="emphasis"><em>
nKeyActions</em></span>
 elements of type CARD8; each element of <span class="emphasis"><em>
count</em></span>
 specifies the number of actions bound to the corresponding key. The <span class="emphasis"><em>
actions</em></span>
 list in the <span class="emphasis"><em>
actions</em></span>
 field has <span class="emphasis"><em>
totalActions</em></span>
 elements of type KB_ACTION. These actions are assigned to each target key in
turn, as specified by <span class="emphasis"><em>
count</em></span>
. The list of actions assigned to each key must either be empty or have exactly
as many actions as the key has symbols, or a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If <span class="emphasis"><em>
XkbKeyBehaviorsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstKeyBehavior</em></span>
 and <span class="emphasis"><em>
nKeyBehaviors</em></span>
 specify a subset of the keyboard keys to which new behaviors are to be
assigned, and <span class="emphasis"><em>
totalKeyBehaviors</em></span>
 specifies the total number of keys in that range to be assigned non-default
behavior. If any of the keys specified by <span class="emphasis"><em>
firstKeyBehavior</em></span>
 and <span class="emphasis"><em>
nKeyBehaviors</em></span>
 are not legal, a <span class="emphasis"><em>
Match</em></span>
 error results. The <span class="emphasis"><em>
behaviors</em></span>
 list has <span class="emphasis"><em>
totalKeyBehaviors</em></span>
 elements of type KB_BEHAVIOR; each entry of <span class="emphasis"><em>
behaviors</em></span>
 specifies a key in the specified range and a new behavior for that key; any
key that falls in the range specified by <span class="emphasis"><em>
firstBehavior</em></span>
 and <span class="emphasis"><em>
nBehaviors</em></span>
 for which no behavior is specified in <span class="emphasis"><em>
behaviors</em></span>
 is assigned the default behavior, <span class="emphasis"><em>
KB_Default</em></span>
. The new behaviors must be legal, or a <span class="emphasis"><em>
Value</em></span>
 error results. To be legal, the behavior specified in the <span class="emphasis"><em>
XkbSetMap</em></span>
 request must:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Specify a key in the range indicated by <span class="emphasis"><em>
firstKeyBehavior</em></span>
 and <span class="emphasis"><em>
nKeyBehaviors</em></span>
.
  </p></li><li class="listitem"><p>Not specify the <span class="emphasis"><em>
permanent</em></span>
 flag; permanent behaviors cannot be set or changed using the <span class="emphasis"><em>
XkbSetMap</em></span>
 request.
  </p></li><li class="listitem"><p>If present, the <span class="emphasis"><em>
KB_Overlay1</em></span>
 and <span class="emphasis"><em>
KB_Overlay2</em></span>
 behaviors must specify a keycode for the overlay key that is valid for the
current keyboard.
  </p></li><li class="listitem"><p>If present, the <span class="emphasis"><em>
KB_RadioGroup</em></span>
 behavior must specify a legal index (0…31) for the radio group to which the
key belongs.
  </p></li></ul></div><p>
Key behaviors that are not recognized by the server are accepted but ignored.
Attempts to replace a "permanent" behavior are silently ignored; the behavior
is not replaced, but not error is generated and any other components specified
in the <span class="emphasis"><em>
XkbSetMap</em></span>
 request are updated, as appropriate.
</p><p>
If <span class="emphasis"><em>
XkbVirtualModsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
virtualMods</em></span>
 is a mask which specifies the virtual modifiers to be rebound. The <span class="emphasis"><em>
vmods</em></span>
 list specifies the real modifiers that are bound to each of the virtual
modifiers specified in <span class="emphasis"><em>
virtualMods</em></span>
, starting from the lowest numbered virtual modifier and progressing upward.
Any virtual modifier that is not specified in <span class="emphasis"><em>
virtualMods</em></span>
 has no corresponding entry in <span class="emphasis"><em>
vmods</em></span>
, so the <span class="emphasis"><em>
vmods</em></span>
 list has one entry for each bit that is set in <span class="emphasis"><em>
virtualMods</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbExplicitComponentsMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstKeyExplicit</em></span>
 and <span class="emphasis"><em>
nKeyExplicit</em></span>
 specify a subset of the keyboard keys to which new explicit components are to
be assigned, and <span class="emphasis"><em>
totalKeyExplicit</em></span>
 specifies the total number of keys in that range that have at least one
explicit component. The <span class="emphasis"><em>
explicit</em></span>
 list has <span class="emphasis"><em>
totalKeyExplicit</em></span>
 elements of type KB_KEYEXPLICIT; each entry of <span class="emphasis"><em>
explicit</em></span>
 specifies a key in the specified range and a new set of explicit components
for that key. Any key that falls in the range specified by <span class="emphasis"><em>
firstKeyExplicit</em></span>
 and <span class="emphasis"><em>
nKeyExplicit</em></span>
 that is not assigned some value in <span class="emphasis"><em>
explicit</em></span>
 has no explicit components.
</p><p>
If <span class="emphasis"><em>
XkbModifierMapMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstModMapKey</em></span>
 and <span class="emphasis"><em>
nModMapKeys</em></span>
 specify a subset of the keyboard keys for which new modifier mappings are to
be assigned, and <span class="emphasis"><em>
totalModMapKeys</em></span>
 specifies the total number of keys in that range to which at least one
modifier is bound. The <span class="emphasis"><em>
modmap</em></span>
 list has <span class="emphasis"><em>
totalModMapKeys</em></span>
 elements of type KB_KEYMODMAP; each entry of <span class="emphasis"><em>
modmap</em></span>
 specifies a key in the specified range and a new set of modifiers to be
associated with that key. Any key that falls in the range specified by
<span class="emphasis"><em>
firstModMapKey</em></span>
 and <span class="emphasis"><em>
nModMapKeys</em></span>
 that is not assigned some value in <span class="emphasis"><em>
modmap</em></span>
 has no associated modifiers.
</p><p>
If the modifier map is changed by the <span class="emphasis"><em>
XkbSetMap</em></span>
 request, any changes are also reflected in the core protocol modifier mapping.
Changes to the core protocol modifier mapping are reported to XKB-unaware
clients via <span class="emphasis"><em>
MappingNotify</em></span>
 events and can be retrieved with the core protocol <span class="emphasis"><em>
GetModifierMapping</em></span>
 request.
</p><p>
If <span class="emphasis"><em>
XkbVirtualModMapMask</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, <span class="emphasis"><em>
firstVModMapKey</em></span>
 and <span class="emphasis"><em>
nVModMapKeys</em></span>
 specify a subset of the keyboard keys for which new modifier mappings are to
be assigned, and <span class="emphasis"><em>
totalVModMapKeys</em></span>
 specifies the total number of keys in that range to which at least one virtual
modifier is bound. The <span class="emphasis"><em>
vmodmap</em></span>
 list has <span class="emphasis"><em>
totalVModMapKeys</em></span>
 elements of type KB_KEYVMODMAP; each entry of <span class="emphasis"><em>
vmodmap</em></span>
 specifies a key in the specified range and a new set of virtual modifiers to
be associated with that key. Any key that falls in the range specified by
<span class="emphasis"><em>
firstVModMapKey</em></span>
 and <span class="emphasis"><em>
nVModMapKeys</em></span>
 that is not assigned some value in <span class="emphasis"><em>
vmodmap</em></span>
 has no associated virtual modifiers.
</p><p>
If the resulting keyboard map is legal, the server updates the keyboard map.
Changes to some keyboard components have indirect effects on others:
</p><p>
If the <span class="emphasis"><em>
XkbSetMapRecomputeActions</em></span>
 bit is set in <span class="emphasis"><em>
flags</em></span>
, the actions associated with any keys for which symbol or modifier bindings
were changed by this request are recomputed as described in
<a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning Actions To Keys</a>. Note
that actions are recomputed <span class="emphasis"><em>
after </em></span>
any actions specified in this request are bound to keys, so the actions
specified in this request might be clobbered by the automatic assignment of
actions to keys.
</p><p>
If the group width of an existing key type is changed, the list of symbols
associated with any keys of the changed type might be resized accordingly. If
the list increases in size, any unspecified new symbols are initialized to
<span class="emphasis"><em>
NoSymbol</em></span>
.
</p><p>
If the list of actions associated with a key is not empty, changing the key
type of the key resizes the list. Unspecified new actions are calculated by
applying any keyboard symbol interpretations to the corresponding symbols.
</p><p>
The number of groups global to the keyboard is always equal to the largest
number of groups specified by any of the key symbol maps. Changing the number
of groups in one or more key symbol maps may change the number of groups global
to the keyboard.
</p><p>
Assigning key behavior <span class="emphasis"><em>
KB_RadioGroup</em></span>
 to a key adds that key as a member of the specified radio group. Changing a
key with the existing behavior <span class="emphasis"><em>
KB_RadioGroup</em></span>
 removes that key from the group. Changing the elements of a radio group can
cause synthetic key press or key release events if the key to be added or
removed is logically down at the time of the change.
</p><p>
Changing a key with behavior <span class="emphasis"><em>
KB_Lock</em></span>
 causes a synthetic key release event if the key is logically but not
physically down at the time of the change.
</p><p>
This request sends an <span class="emphasis"><em>
XkbMapNotify</em></span>
 event which reflects both explicit and indirect map changes to any interested
clients. If any symbolic names are changed, it sends a <span class="emphasis"><em>
XkbNamesNotify</em></span>
 reflecting the changes to any interested clients. XKB-unaware clients are
notified of keyboard changes via core protocol <span class="emphasis"><em>
MappingNotify</em></span>
 events.
</p><p>
Key press and key release events caused by changing key behavior may cause
additional <span class="emphasis"><em>
XkbStateNotify</em></span>
 or <span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
 events.
</p></div><div class="sect2" title="Querying and Changing the Compatibility Map"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_the_Compatibility_Map"></a>Querying and Changing the Compatibility Map</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetCompatMap</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
groups: KB_GROUPMASK</td></tr><tr><td class="protoname" align="left">
getAllSI: BOOL</td></tr><tr><td class="protoname" align="left">
firstSI, nSI: CARD16
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
groupsRtrn: KB_GROUPMASK
      </td></tr><tr><td class="protoreply" align="left">
firstSIRtrn, nSIRtrn, nTotalSI: CARD16
      </td></tr><tr><td class="protoreply" align="left">
siRtrn: LISTofKB_SYMINTERP
      </td></tr><tr><td class="protoreply" align="left">
groupRtrn: LISTofKB_MODDEF</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
This request returns the listed compatibility map components for the keyboard
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 Error results. On return, <span class="emphasis"><em>
deviceID</em></span>
 reports the input extension identifier of the keyboard device or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension.
</p><p>
If <span class="emphasis"><em>
getAllSI</em></span>
 is <span class="emphasis"><em>
False</em></span>
, <span class="emphasis"><em>
firstSI</em></span>
 and <span class="emphasis"><em>
nSI</em></span>
 specify a subset of the symbol interpretations to be returned; if used,
<span class="emphasis"><em>
nSI</em></span>
 must be greater than <span class="emphasis"><em>
0</em></span>
 and all of the elements specified by <span class="emphasis"><em>
firstSI</em></span>
 and <span class="emphasis"><em>
nSI</em></span>
 must be defined or a <span class="emphasis"><em>
Value</em></span>
 error results. If <span class="emphasis"><em>
getAllSyms</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the server ignores <span class="emphasis"><em>
firstSym</em></span>
 and <span class="emphasis"><em>
nSyms</em></span>
 and returns all of the symbol interpretations defined for the keyboard.
</p><p>
The <span class="emphasis"><em>
groups</em></span>
 mask specifies the groups for which compatibility maps are to be returned.
</p><p>
The <span class="emphasis"><em>
nTotalSI</em></span>
 return value reports the total number of symbol interpretations defined for
the keyboard. On successful return, the <span class="emphasis"><em>
siRtrn</em></span>
 return list contains the definitions for <span class="emphasis"><em>
nSIRtrn</em></span>
 symbol interpretations beginning at <span class="emphasis"><em>
firstSIRtrn</em></span>
.
</p><p>
The <span class="emphasis"><em>
groupRtrn</em></span>
 return values report the entries in the group compatibility map for any groups
specified in the <span class="emphasis"><em>
groupsRtrn</em></span>
 return value.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetCompatMap</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
recomputeActions: BOOL</td></tr><tr><td class="protoname" align="left">
truncateSI: BOOL</td></tr><tr><td class="protoname" align="left">
groups: KB_GROUPMASK</td></tr><tr><td class="protoname" align="left">
firstSI, nSI: CARD16</td></tr><tr><td class="protoname" align="left">
si: LISTofKB_SYMINTERPRET</td></tr><tr><td class="protoname" align="left">
groupMaps: LISTofKB_MODDEF</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Value</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
This request changes a specified subset of the compatibility map of the
keyboard indicated by <span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 specifies an invalid device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results and nothing is changed.
</p><p>
The <span class="emphasis"><em>
firstSI</em></span>
 and <span class="emphasis"><em>
nSI</em></span>
 fields specify a subset of the keyboard symbol interpretations to be changed.
The <span class="emphasis"><em>
si</em></span>
 list specifies new values for each of the interpretations in that range.
</p><p>
The first symbol interpretation to be changed, <span class="emphasis"><em>
firstSI</em></span>
, must be less than or equal to the unchanged length of the list of symbol
interpretations, or a <span class="emphasis"><em>
Value</em></span>
 error results. If the resulting list would be larger than the unchanged list,
it server list of symbol interpretations is automatically increased in size.
Otherwise, if <span class="emphasis"><em>
truncateSyms</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the server deletes any symbol interpretations after the last element changed
by this request, and reduces the length of the list accordingly.
</p><p>
The <span class="emphasis"><em>
groupMaps</em></span>
 fields contain new definitions for a subset of the group compatibility map;
<span class="emphasis"><em>
groups</em></span>
 specifies the group compatibility map entries to be updated from <span class="emphasis"><em>
groupMaps</em></span>
.
</p><p>
 All changed compatibility maps and symbol interpretations must either ignore
group state or specify a legal range of groups, or a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
If the <span class="emphasis"><em>
recomputeActions</em></span>
 field is <span class="emphasis"><em>
True</em></span>
, the server regenerates recalculates the actions bound to all keyboard keys by
applying the new symbol interpretations to the entire key symbol map, as
described in <a class="link" href="#Assigning_Actions_To_Keys" title="Assigning Actions To Keys">Assigning Actions To
Keys</a>.
</p></div><div class="sect2" title="Querying and Changing Indicators"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Indicators"></a>Querying and Changing Indicators</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetIndicatorState</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
state: KB_INDICATORMASK</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
</td></tr></tbody></table></div><p>
This request reports the current state of the indicators for the keyboard
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
On successful return, the <span class="emphasis"><em>
deviceID</em></span>
 field reports the input extension identifier of the keyboard or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension. The <span class="emphasis"><em>
state</em></span>
 return value reports the state of each of the thirty-two indicators on the
specified keyboard. The least-significant bit corresponds to indicator 0, the
most significant bit to indicator 31; if a bit is set, the corresponding
indicator is lit.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetIndicatorMap</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
which: KB_INDICATORMASK
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
which: KB_INDICATORMASK
      </td></tr><tr><td class="protoreply" align="left">
realIndicators: KB_INDICATORMASK
      </td></tr><tr><td class="protoreply" align="left">
nIndicators: CARD8
      </td></tr><tr><td class="protoreply" align="left">
maps: LISTofKB_INDICATORMAP</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request returns a subset of the maps for the indicators on the keyboard
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
which</em></span>
 field specifies the subset to be returned; a set bit in the which field
indicates that the map for the corresponding indicator should be returned.
</p><p>
On successful return, the <span class="emphasis"><em>
deviceID</em></span>
 field reports the input extension identifier of the keyboard or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension. Any indicators specified
in <span class="emphasis"><em>
realIndicators</em></span>
 are actually present on the keyboard; the rest are virtual indicators. Virtual
indicators do not directly cause any visible or audible effect when they change
state, but they do cause <span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
 events.
</p><p>
The <span class="emphasis"><em>
maps</em></span>
 return value reports the requested indicator maps. Indicator maps are
described in <a class="link" href="#Indicator_Maps" title="Indicator Maps">Indicator Maps</a>
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetIndicatorMap</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
which: KB_INDICATORMASK</td></tr><tr><td class="protoname" align="left">
maps: LISTofKB_INDICATORMAP</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request changes a subset of the maps on the keyboard specified by
<span class="emphasis"><em>
deviceSpec</em></span>
. If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
which</em></span>
 field specifies the subset to be changed; the <span class="emphasis"><em>
maps</em></span>
 field contains the new definitions.
</p><p>
If successful, the new indicator maps are applied immediately. If any
indicators change state as a result of the new maps, the server generates
<span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
 events as appropriate.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetNamedIndicator</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
ledClass: KB_LEDCLASSSPEC</td></tr><tr><td class="protoname" align="left">
ledID: KB_IDSPEC</td></tr><tr><td class="protoname" align="left">
indicator: ATOM
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
supported: BOOL
      </td></tr><tr><td class="protoreply" align="left">
indicator: ATOM
      </td></tr><tr><td class="protoreply" align="left">
found: BOOL
      </td></tr><tr><td class="protoreply" align="left">
on: BOOL
      </td></tr><tr><td class="protoreply" align="left">
realIndicator: BOOL
      </td></tr><tr><td class="protoreply" align="left">
ndx: CARD8
      </td></tr><tr><td class="protoreply" align="left">
map: KB_INDICATORMAP</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Atom</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request returns information about the indicator specified by <span class="emphasis"><em>
ledClass</em></span>
, <span class="emphasis"><em>
ledID</em></span>
, and <span class="emphasis"><em>
indicator</em></span>
 on the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. The <span class="emphasis"><em>
indicator</em></span>
 field specifies the name of the indicator for which information is to be
returned.
</p><p>
If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a device with indicators, a <span class="emphasis"><em>
Keyboard</em></span>
 error results. If <span class="emphasis"><em>
ledClass</em></span>
 does not have the value <span class="emphasis"><em>
DfltXIClass</em></span>
, <span class="emphasis"><em>
LedFeedbackClass</em></span>
, or <span class="emphasis"><em>
KbdFeedbackClass</em></span>
, a <span class="emphasis"><em>
Value</em></span>
 error results. If <span class="emphasis"><em>
ledID</em></span>
 does not have the value <span class="emphasis"><em>
DfltXIId</em></span>
 or specify the identifier of a feedback of the class specified by <span class="emphasis"><em>
ledClass</em></span>
 on the device specified by <span class="emphasis"><em>
deviceSpec</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results. If <span class="emphasis"><em>
indicator</em></span>
 is not a valid ATOM other than <span class="emphasis"><em>
None</em></span>
, an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
This request is always supported with default class and identifier on the core
keyboard device. If the request specifies a device other than the core keyboard
device or a feedback class and identifier other than the defaults, and the
server does not support indicator names or indicator maps for extension
devices, the <span class="emphasis"><em>
supported</em></span>
 return value is <span class="emphasis"><em>
False</em></span>
 and the values of the other fields in the reply are undefined. If the client
which issued the unsupported request has also selected to do so, it will also
receive an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event which reports the attempt to use an unsupported feature, in this case
one or both of <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 or <span class="emphasis"><em>
XkbXI_IndicatorNames</em></span>
.
</p><p>
Otherwise, <span class="emphasis"><em>
supported</em></span>
 is <span class="emphasis"><em>
True</em></span>
 and the <span class="emphasis"><em>
deviceID</em></span>
 field reports the input extension identifier of the keyboard or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension. The <span class="emphasis"><em>
indicator</em></span>
 return value reports the name for which information was requested and the
<span class="emphasis"><em>
found</em></span>
 return value is <span class="emphasis"><em>
True</em></span>
 if an indicator with the specified name was found on the device.
</p><p>
If a matching indicator was found:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
on</em></span>
 return value reports the state of the indicator at the time of the request.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
realIndicator</em></span>
 return value is <span class="emphasis"><em>
True</em></span>
 if the requested indicator is actually present on the keyboard or <span class="emphasis"><em>
False</em></span>
 if it is virtual.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
ndx</em></span>
 return value reports the index of the indicator in the requested feedback.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
map</em></span>
 return value reports the indicator map used by to automatically change the
state of the specified indicator in response to changes in keyboard state or
controls.
  </p></li></ul></div><p>
If no matching indicator is found, the <span class="emphasis"><em>
found</em></span>
 return value is <span class="emphasis"><em>
False</em></span>
, and the <span class="emphasis"><em>
on</em></span>
, <span class="emphasis"><em>
realIndicator</em></span>
, <span class="emphasis"><em>
ndx</em></span>
, and <span class="emphasis"><em>
map</em></span>
 return values are undefined.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetNamedIndicator</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
ledClass: KB_LEDCLASSSPEC</td></tr><tr><td class="protoname" align="left">
ledID: KB_IDSPEC</td></tr><tr><td class="protoname" align="left">
indicator: ATOM</td></tr><tr><td class="protoname" align="left">
setState: BOOL</td></tr><tr><td class="protoname" align="left">
on: BOOL</td></tr><tr><td class="protoname" align="left">
setMap: BOOL</td></tr><tr><td class="protoname" align="left">
createMap: BOOL</td></tr><tr><td class="protoname" align="left">
map: KB_SETINDICATORMAP</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Atom</em></span>
, <span class="emphasis"><em>
Access</em></span>
</td></tr></tbody></table></div><p>
This request changes various aspects of the indicator specified by <span class="emphasis"><em>
ledClass</em></span>
, <span class="emphasis"><em>
ledID</em></span>
, and <span class="emphasis"><em>
indicator</em></span>
 on the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. The <span class="emphasis"><em>
indicator</em></span>
 argument specifies the name of the indicator to be updated.
</p><p>
If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a device with indicators, a <span class="emphasis"><em>
Keyboard</em></span>
 error results. If <span class="emphasis"><em>
ledClass</em></span>
 does not have the value <span class="emphasis"><em>
DfltXIClass</em></span>
, <span class="emphasis"><em>
LedFeedbackClass</em></span>
, or <span class="emphasis"><em>
KbdFeedbackClass</em></span>
, a <span class="emphasis"><em>
Value</em></span>
 error results. If <span class="emphasis"><em>
ledID</em></span>
 does not have the value <span class="emphasis"><em>
DfltXIId</em></span>
 or specify the identifier of a feedback of the class specified by <span class="emphasis"><em>
ledClass</em></span>
 on the device specified by <span class="emphasis"><em>
deviceSpec</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results. If <span class="emphasis"><em>
indicator</em></span>
 is not a valid ATOM other than <span class="emphasis"><em>
None</em></span>
, an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
This request is always supported with default class and identifier on the core
keyboard device. If the request specifies a device other than the core keyboard
device or a feedback class and identifier other than the defaults, and the
server does not support indicator names or indicator maps for extension
devices, the <span class="emphasis"><em>
supported</em></span>
 return value is <span class="emphasis"><em>
False</em></span>
 and the values of the other fields in the reply are undefined. If the client
which issued the unsupported request has also selected to do so, it will also
receive an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event which reports the attempt to use an unsupported feature, in this case
one or both of <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 and <span class="emphasis"><em>
XkbXI_IndicatorNames</em></span>
.
</p><p>
Otherwise, <span class="emphasis"><em>
supported</em></span>
 is <span class="emphasis"><em>
True</em></span>
 and the <span class="emphasis"><em>
deviceID</em></span>
 field reports the input extension identifier of the keyboard or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension. The <span class="emphasis"><em>
indicator</em></span>
 return value reports the name for which information was requested and the
<span class="emphasis"><em>
found</em></span>
 return value is <span class="emphasis"><em>
True</em></span>
 if an indicator with the specified name was found on the device.
</p><p>
If no indicator with the specified name is found on the specified device, and
the <span class="emphasis"><em>
createMap</em></span>
 field is <span class="emphasis"><em>
True</em></span>
, XKB assigns the specified name to the lowest-numbered indicator that has no
name (i.e. whose name is <span class="emphasis"><em>
None</em></span>
) and applies the rest of the fields in the request to the newly named
indicator. If no unnamed indicators remain, this request reports no error and
has no effect.
</p><p>
If no matching indicator is found or new indicator assigned this request
reports no error and has no effect. Otherwise, it updates the indicator as
follows:
</p><p>
If <span class="emphasis"><em>
setMap </em></span>
is <span class="emphasis"><em>
True</em></span>
, XKB changes the map for the indicator (see <a class="link" href="#Indicator_Maps" title="Indicator Maps">Indicator Maps</a>) to reflect the
values specified in <span class="emphasis"><em>
map</em></span>
.
</p><p>
If <span class="emphasis"><em>
setState</em></span>
 is <span class="emphasis"><em>
True</em></span>
, XKB attempts to explicitly change the state of the indicator to the state
specified in <span class="emphasis"><em>
on</em></span>
. The effects of an attempt to explicitly change the state of an indicator
depend on the values in the map for that indicator and are not guaranteed to
succeed.
</p><p>
If this request affects both indicator map and state, it updates the indicator
map before attempting to change its state, so the success of the explicit
change depends on the indicator map values specified in the request.
</p><p>
If this request changes the indicator map, it applies the new map immediately
to determine the appropriate state for the indicator given the new indicator
map and the current state of the keyboard.
</p></div><div class="sect2" title="Querying and Changing Symbolic Names"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Symbolic_Names"></a>Querying and Changing Symbolic Names</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetNames</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
which: KB_NAMEDETAILMASK</td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
which: KB_NAMESMASK
minKeyCode, maxKeyCode: KEYCODE
nTypes: CARD8
nKTLevels: CARD16
groupNames: KB_GROUPMASK
virtualMods: KB_VMODMASK
firstKey: KEYCODE
nKeys: CARD8
indicators: KB_INDICATORMASK
nRadioGroups, nKeyAliases: CARD8
present: KB_NAMEDETAILMASK
valueList: LISTofITEMs</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request returns the symbolic names for various components of the keyboard
mapping for the device specified by <span class="emphasis"><em>
deviceSpec</em></span>
. The <span class="emphasis"><em>
which</em></span>
 field specifies the keyboard components for which names are to be returned. If
<span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results. If any undefined bits in <span class="emphasis"><em>
which</em></span>
 are non-zero, a <span class="emphasis"><em>
Value</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 return value contains the X Input Extension device identifier of the specified
device or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension. The <span class="emphasis"><em>
present</em></span>
 and <span class="emphasis"><em>
valueList</em></span>
 return values specify the components for which names are being reported. If a
component is specified in <span class="emphasis"><em>
present</em></span>
, the corresponding element is present in the <span class="emphasis"><em>
valueList</em></span>
, otherwise that component has length <span class="emphasis"><em>
0</em></span>
. The components of the <span class="emphasis"><em>
valueList</em></span>
 appear in the following order, when present:.
</p><div class="informaltable"><table border="0"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">Component</th><th align="left">Size</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
XkbKeycodesName</em></span>
</td><td align="left">1</td><td align="left">	ATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGeometryName</em></span>
</td><td align="left">1</td><td align="left">	ATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbSymbolsName</em></span>
</td><td align="left">1</td><td align="left">	ATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbPhysSymbolsName</em></span>
</td><td align="left">1</td><td align="left">	ATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbTypesName</em></span>
</td><td align="left">1</td><td align="left">	ATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbCompatName</em></span>
</td><td align="left">1</td><td align="left">	ATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKeyTypeNames</em></span>
 </td><td align="left"><span class="emphasis"><em>
nTypes</em></span>
</td><td align="left">	LISTofATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKTLevelNames</em></span>
 </td><td align="left"><span class="emphasis"><em>
nTypes</em></span>
,
<span class="emphasis"><em>
nKTLevels</em></span>
</td><td align="left">{	count: LISTofCARD8,
	names: LISTofATOM }</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbIndicatorNames</em></span>
 </td><td align="left">One per bit set in <span class="emphasis"><em>
indicators</em></span>
</td><td align="left">	LISTofATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbVirtualModNames</em></span>
 </td><td align="left">One per bit set in <span class="emphasis"><em>
virtualMods</em></span>
</td><td align="left">	LISTofATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGroupNames </em></span>
</td><td align="left">One per bit set in <span class="emphasis"><em>
groupNames</em></span>
</td><td align="left">	LISTofATOM</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKeyNames</em></span>
</td><td align="left"><span class="emphasis"><em>
nKeys</em></span>
</td><td align="left">	LISTofKB_KEYNAME</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbKeyAliases</em></span>
</td><td align="left"><span class="emphasis"><em>
nKeyAliases</em></span>
</td><td align="left">	LISTofKB_KEYALIAS</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbRGNames</em></span>
</td><td align="left"><span class="emphasis"><em>
nRadioGroups</em></span>
</td><td align="left">	LISTofATOM</td></tr></tbody></table></div><p>
If type names are reported, the <span class="emphasis"><em>
nTypes</em></span>
 return value reports the number of types defined for the keyboard, and the
list of key type names in <span class="emphasis"><em>
valueList</em></span>
 has <span class="emphasis"><em>
nTypes</em></span>
 elements.
</p><p>
If key type level names are reported, the list of key type level names in the
<span class="emphasis"><em>
valueList</em></span>
 has two parts: The <span class="emphasis"><em>
count</em></span>
 array has <span class="emphasis"><em>
nTypes</em></span>
 elements, each of which reports the number of level names reported for the
corresponding key type. The <span class="emphasis"><em>
names</em></span>
 array has <span class="emphasis"><em>
nKTLevels</em></span>
 atoms and reports the names of each type sequentially. The <span class="emphasis"><em>
nKTLevels</em></span>
 return value is always equal to the sum of all of the elements of the
<span class="emphasis"><em>
count</em></span>
 array.
</p><p>
If indicator names are reported, the <span class="emphasis"><em>
indicators</em></span>
 mask specifies the indicators for which names are defined; any indicators not
specified in <span class="emphasis"><em>
indicators</em></span>
 have the name <span class="emphasis"><em>
None</em></span>
. The list of indicator names in <span class="emphasis"><em>
valueList</em></span>
 contains the names of the listed indicators, beginning with the
lowest-numbered indicator for which a name is defined and proceeding to the
highest.
</p><p>
If virtual modifier names are reported, the <span class="emphasis"><em>
virtualMods</em></span>
 mask specifies the virtual modifiers for which names are defined; any virtual
modifiers not specified in <span class="emphasis"><em>
virtualMods</em></span>
 have the name <span class="emphasis"><em>
None</em></span>
. The list of virtual modifier names in <span class="emphasis"><em>
valueList</em></span>
 contains the names of the listed virtual modifiers, beginning with the
lowest-numbered virtual modifier for which a name is defined and proceeding to
the highest.
</p><p>
If group names are reported, the <span class="emphasis"><em>
groupNames</em></span>
 mask specifies the groups for which names are defined; any groups not
specified in <span class="emphasis"><em>
groupNames</em></span>
 have the name <span class="emphasis"><em>
None</em></span>
. The list of group names in <span class="emphasis"><em>
valueList</em></span>
 contains the names of the listed groups, beginning with the lowest-numbered
group for which a name is defined and proceeding to the highest.
</p><p>
If key names are reported, the <span class="emphasis"><em>
firstKey</em></span>
 and <span class="emphasis"><em>
nKeys</em></span>
 return values specify a range of keys which includes all keys for which names
are defined; any key that does not fall in the range specified by <span class="emphasis"><em>
firstKey</em></span>
 and <span class="emphasis"><em>
nKeys</em></span>
 has the name <span class="emphasis"><em>
NullKeyName</em></span>
. The list of key names in the <span class="emphasis"><em>
valueList</em></span>
 has <span class="emphasis"><em>
nKeys</em></span>
 entries and specifies the names of the keys beginning at <span class="emphasis"><em>
firstKey</em></span>
.
</p><p>
If key aliases are reported, the <span class="emphasis"><em>
nKeyAliases</em></span>
 return value specifies the total number of key aliases defined for the
keyboard. The list of key aliases in <span class="emphasis"><em>
valueList</em></span>
 has <span class="emphasis"><em>
nKeyAliases</em></span>
 entries, each of which reports an alias and the real name of the key to which
it corresponds.
</p><p>
If radio group names are reported, the <span class="emphasis"><em>
nRadioGroups</em></span>
 return value specifies the number of radio groups on the keyboard for which
names are defined. The list of radio group names in <span class="emphasis"><em>
valueList</em></span>
 reports the names of each group and has <span class="emphasis"><em>
nRadioGroups</em></span>
 entries.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetNames</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoargs" align="left">which: KB_NAMEDETAILMASK</td></tr><tr><td class="protoname" align="left">
virtualMods: KB_VMODMASK</td></tr><tr><td class="protoname" align="left">
firstType, nTypes: CARD8</td></tr><tr><td class="protoname" align="left">
firstKTLevel, nKTLevels: CARD8</td></tr><tr><td class="protoname" align="left">
totalKTLevelNames: CARD16</td></tr><tr><td class="protoname" align="left">
indicators: KB_INDICATORMASK</td></tr><tr><td class="protoname" align="left">
groupNames: KB_GROUPMASK</td></tr><tr><td class="protoname" align="left">
nRadioGroups: CARD8</td></tr><tr><td class="protoname" align="left">
firstKey: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeys, nKeyAliases: CARD8</td></tr><tr><td class="protoname" align="left">
valueList: LISTofITEMs</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Atom</em></span>
, <span class="emphasis"><em>
Value</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
This request changes the symbolic names for the requested components of the
keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. The <span class="emphasis"><em>
which</em></span>
 field specifies the components for which one or more names are to be updated.
If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results. If any undefined bits in <span class="emphasis"><em>
which</em></span>
 are non-zero, a <span class="emphasis"><em>
Value</em></span>
 error results. If any error (other than <span class="emphasis"><em>
Alloc</em></span>
 or <span class="emphasis"><em>
Implementation</em></span>
) occurs, this request returns without modifying any names.
</p><p>
The <span class="emphasis"><em>
which</em></span>
 and <span class="emphasis"><em>
valueList</em></span>
 fields specify the components to be changed; the type of each <span class="emphasis"><em>
valueList</em></span>
 entry, the order in which components appear in the <span class="emphasis"><em>
valueList</em></span>
 when specified, and the correspondence between components in <span class="emphasis"><em>
which</em></span>
 and the entries in the <span class="emphasis"><em>
valueList</em></span>
 are as specified for the <span class="emphasis"><em>
XkbGetNames</em></span>
 request.
</p><p>
If keycodes, geometry, symbols, physical symbols, types or compatibility map
names are to be changed, the corresponding entries in the <span class="emphasis"><em>
valueList</em></span>
 must have the value <span class="emphasis"><em>
None</em></span>
 or specify a valid ATOM, else an <span class="emphasis"><em>
Atom</em></span>
 error occurs.
</p><p>
If key type names are to be changed, the <span class="emphasis"><em>
firstType</em></span>
 and <span class="emphasis"><em>
nTypes</em></span>
 fields specify a range of types for which new names are supplied, and the list
of key type names in <span class="emphasis"><em>
valueList</em></span>
 has <span class="emphasis"><em>
nTypes</em></span>
 elements. Names for types that fall outside of the range specified by
<span class="emphasis"><em>
firstType</em></span>
 and <span class="emphasis"><em>
nTypes</em></span>
 are not affected. If this request specifies names for types that are not
present on the keyboard, a <span class="emphasis"><em>
Match</em></span>
 error results. All of the type names in the <span class="emphasis"><em>
valueList</em></span>
 must be valid ATOMs or have the value <span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
The names of the first four keyboard types are specified by the XKB extension
and cannot be changed; including any of the canonical types in this request
causes an <span class="emphasis"><em>
Access</em></span>
 error, as does trying to assign the name reserved for a canonical type to one
of the other key types.
</p><p>
If key type level names are to be changed, the <span class="emphasis"><em>
firstKTLevel</em></span>
 and <span class="emphasis"><em>
nKTLevels</em></span>
 fields specify a range of key types for which new level names are supplied,
and the list of key type level names in the <span class="emphasis"><em>
valueList</em></span>
 has two parts: The <span class="emphasis"><em>
count</em></span>
 array has <span class="emphasis"><em>
nKTLevels</em></span>
 elements, each of which specifies the number of levels for which names are
supplied on the corresponding key type; any levels for which no names are
specified are assigned the name <span class="emphasis"><em>
None</em></span>
. The <span class="emphasis"><em>
names</em></span>
 array has <span class="emphasis"><em>
totalKTLevels</em></span>
 atoms and specifies the names of each type sequentially. The <span class="emphasis"><em>
totalKTLevels</em></span>
 field must always equal the sum of all of the elements of the <span class="emphasis"><em>
count</em></span>
 array. Level names for types that fall outside of the specified range are not
affected. If this request specifies level names for types that are not present
on the keyboard, or if it specifies more names for a type than the type has
levels, a <span class="emphasis"><em>
Match</em></span>
 error results. All specified type level names must be <span class="emphasis"><em>
None</em></span>
 or a valid ATOM or an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
If indicator names are to be changed, the <span class="emphasis"><em>
indicators</em></span>
 mask specifies the indicators for which new names are specified; the names for
indicators not specified in <span class="emphasis"><em>
indicators</em></span>
 are not affected. The list of indicator names in <span class="emphasis"><em>
valueList</em></span>
 contains the new names for the listed indicators, beginning with the
lowest-numbered indicator for which a name is defined and proceeding to the
highest. All specified indicator names must be a valid ATOM or <span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
If virtual modifier names are to be changed, the <span class="emphasis"><em>
virtualMods</em></span>
 mask specifies the virtual modifiers for which new names are specified; names
for any virtual modifiers not specified in <span class="emphasis"><em>
virtualMods</em></span>
 are not affected. The list of virtual modifier names in <span class="emphasis"><em>
valueList</em></span>
 contains the new names for the specified virtual modifiers, beginning with the
lowest-numbered virtual modifier for which a name is defined and proceeding to
the highest. All virtual modifier names must be valid ATOMs or <span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
If group names are to be changed, the <span class="emphasis"><em>
groupNames</em></span>
 mask specifies the groups for which new names are specified; the name of any
group not specified in <span class="emphasis"><em>
groupNames</em></span>
 is not changed. The list of group names in <span class="emphasis"><em>
valueList</em></span>
 contains the new names for the listed groups, beginning with the
lowest-numbered group for which a name is defined and proceeding to the
highest. All specified group names must be a valid ATOM or <span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
If key names are to be changed, the <span class="emphasis"><em>
firstKey</em></span>
 and <span class="emphasis"><em>
nKeys</em></span>
 fields specify a range of keys for which new names are defined; the name of
any key that does not fall in the range specified by <span class="emphasis"><em>
firstKey</em></span>
 and <span class="emphasis"><em>
nKeys</em></span>
 is not changed. The list of key names in the <span class="emphasis"><em>
valueList</em></span>
 has <span class="emphasis"><em>
nKeys</em></span>
 entries and specifies the names of the keys beginning at <span class="emphasis"><em>
firstKey</em></span>
.
</p><p>
If key aliases are to be changed, the <span class="emphasis"><em>
nKeyAliases</em></span>
 field specifies the length of a new list of key aliases for the keyboard. The
list of key aliases can only be replaced in its entirety; it cannot be
replaced. The list of key aliases in <span class="emphasis"><em>
valueList</em></span>
 has <span class="emphasis"><em>
nKeyAliases</em></span>
 entries, each of which reports an alias and the real name of the key to which
it corresponds.
</p><p>
XKB does not check key names or aliases for consistency and validity, so
applications should take care not to assign duplicate names or aliases
</p><p>
If radio group names are to be changed, the <span class="emphasis"><em>
nRadioGroups</em></span>
 field specifies the length of a new list of radio group names for the
keyboard. There is no way to edit the list of radio group names; it can only be
replaced in its entirety. The list of radio group names in <span class="emphasis"><em>
valueList</em></span>
 reports the names of each group and has <span class="emphasis"><em>
nRadioGroups</em></span>
 entries. If the list of radio group names specifies names for more radio
groups than XKB allows (32), a <span class="emphasis"><em>
Match</em></span>
 error results. All specified radio group names must be valid ATOMs or have the
value <span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p></div><div class="sect2" title="Querying and Changing Keyboard Geometry"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Keyboard_Geometry"></a>Querying and Changing Keyboard Geometry</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetGeometry</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC
      </td></tr><tr><td class="protoname" align="left">
name: ATOM</td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoname" align="left">
name: ATOM
      </td></tr><tr><td class="protoname" align="left">
found: BOOL
      </td></tr><tr><td class="protoname" align="left">
widthMM, heightMM: CARD16
      </td></tr><tr><td class="protoname" align="left">
baseColorNdx, labelColorNdx: CARD8
      </td></tr><tr><td class="protoname" align="left">
properties: LISTofKB_PROPERTY
      </td></tr><tr><td class="protoname" align="left">
colors: LISTofSTRING8
      </td></tr><tr><td class="protoname" align="left">
shapes: LISTofKB_SHAPE
      </td></tr><tr><td class="protoname" align="left">
sections: LISTofKB_SECTION
      </td></tr><tr><td class="protoname" align="left">
doodads: LISTofKB_DOODAD
      </td></tr><tr><td class="protoname" align="left">
keyAliases: LISTofKB_KEYALIAS</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
</td></tr></tbody></table></div><p>
This request returns a description of the physical layout of a keyboard. If the
<span class="emphasis"><em>
name</em></span>
 field has the value <span class="emphasis"><em>
None</em></span>
, or if name is identical to the name of the geometry for the keyboard
specified by <span class="emphasis"><em>
deviceSpec</em></span>
, this request returns the geometry of the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
; otherwise, if <span class="emphasis"><em>
name</em></span>
 is a valid atom other than <span class="emphasis"><em>
None</em></span>
, the server returns the keyboard geometry description with that name in the
server database of keyboard components (see <a class="link" href="#The_Server_Database_of_Keyboard_Components" title="Chapter 13. The Server Database of Keyboard Components">The Server Database of Keyboard
Components</a>) if one exists. If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results. If <span class="emphasis"><em>
name</em></span>
 has a value other than <span class="emphasis"><em>
None</em></span>
 or a valid ATOM, an <span class="emphasis"><em>
Atom</em></span>
 error results.
</p><p>
On successful return, the <span class="emphasis"><em>
deviceID</em></span>
 field reports the X Input extension identifier of the keyboard device
specified in the request, or <span class="emphasis"><em>
0</em></span>
 if the server does not support the input extension.
</p><p>
The <span class="emphasis"><em>
found</em></span>
 return value reports whether the requested geometry was available. If
<span class="emphasis"><em>
found</em></span>
 is <span class="emphasis"><em>
False</em></span>
, no matching geometry was found and the remaining fields in the request reply
are undefined; if <span class="emphasis"><em>
found</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the remaining fields of the reply describe the requested keyboard geometry.
The interpretation of the components that make up a keyboard geometry is
described in detail in <a class="link" href="#Keyboard_Geometry" title="Chapter 11. Keyboard Geometry">Keyboard
Geometry</a>
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetGeometry</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
name: ATOM</td></tr><tr><td class="protoname" align="left">
widthMM, heightMM, CARD16</td></tr><tr><td class="protoname" align="left">
baseColorNdx, labelColorNdx: CARD8</td></tr><tr><td class="protoname" align="left">
shapes: LISTofKB_SHAPE</td></tr><tr><td class="protoname" align="left">
sections: LISTofKB_SECTION</td></tr><tr><td class="protoname" align="left">
properties: LISTofKB_PROPERTY</td></tr><tr><td class="protoname" align="left">
colors: LISTofSTRING8</td></tr><tr><td class="protoname" align="left">
doodads: LISTofKB_DOODAD</td></tr><tr><td class="protoname" align="left">
keyAliases: LISTofKB_KEYALIAS</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Atom</em></span>
, <span class="emphasis"><em>
Value</em></span>
</td></tr></tbody></table></div><p>
This request changes the reported description of the geometry for the keyboard
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. If deviceSpec does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
name</em></span>
 field specifies the name of the new keyboard geometry and must be a valid ATOM
or an <span class="emphasis"><em>
Atom</em></span>
 error results. The new geometry is not added to the server database of
keyboard components, but it can be retrieved using the <span class="emphasis"><em>
XkbGetGeometry</em></span>
 request for as long as it is bound to the keyboard. The keyboard geometry
symbolic name is also updated from the name field, and an <span class="emphasis"><em>
XkbNamesNotify</em></span>
 event is generated, if necessary.
</p><p>
The list of <span class="emphasis"><em>
colors</em></span>
 must include at least two definitions, or a <span class="emphasis"><em>
Value</em></span>
 error results. All color definitions in the geometry must specify a legal
color (i.e. must specify a valid index for one of the entries of the <span class="emphasis"><em>
colors</em></span>
 list) or a <span class="emphasis"><em>
Match</em></span>
 error results. The <span class="emphasis"><em>
baseColorNdx</em></span>
 and the <span class="emphasis"><em>
labelColorNdx</em></span>
 must be different or a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
The list of <span class="emphasis"><em>
shapes</em></span>
 must include at least one shape definition, or a <span class="emphasis"><em>
Value</em></span>
 error results. If any two shapes have the same name, a <span class="emphasis"><em>
Match</em></span>
 error result. All doodads and keys which specify shape must specify a valid
index for one of the elements of the <span class="emphasis"><em>
shapes</em></span>
 list, or a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
All section, shape and doodad names must be valid ATOMs or an <span class="emphasis"><em>
Atom</em></span>
 error results; the constant <span class="emphasis"><em>
None</em></span>
 is not permitted for any of these components.
</p><p>
All doodads must be of a known type; XKB does not support "private" doodad
types.
</p><p>
If, after rotation, any keys or doodads fall outside of the bounding box for a
section, the bounding box is automatically adjusted to the minimum size which
encloses all of its components.
</p><p>
If, after adjustment and rotation, the bounding box of any section or doodad
extends below zero on either the X or Y axes, the entire geometry is translated
so that the minimum extent along either axis is zero.
</p><p>
If, after rotation and translation, any keyboard components fall outside of the
rectangle specified by <span class="emphasis"><em>
widthMM</em></span>
 and <span class="emphasis"><em>
heightMM</em></span>
, the keyboard dimensions are automatically resized to the minimum bounding box
that surrounds all components. Otherwise, the width and height of the keyboard
are left as specified.
</p><p>
The <span class="emphasis"><em>
under</em></span>
 field of any overlay key definitions must specify a key that is in the section
that contains the overlay key, or a <span class="emphasis"><em>
Match</em></span>
 error results. This request does not check the value of the <span class="emphasis"><em>
over</em></span>
 field of an overlay key definition, so applications must be careful to avoid
conflicts with actual keys.
</p><p>
This request does not verify that key names or aliases are unique. It also does
not verify that all key names specified in the geometry are bound to some
keycode or that all keys that are named in the keyboard definition are also
available in the geometry. Applications should make sure that keyboard geometry
has no internal conflicts and is consistent with the other components of the
keyboard definition, but XKB does not check for or guarantee it.
</p></div><div class="sect2" title="Querying and Changing Per-Client Flags"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Per_Client_Flags"></a>Querying and Changing Per-Client Flags</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbPerClientFlags</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
change: KB_PCFMASK</td></tr><tr><td class="protoname" align="left">
value: KB_PCFMASK</td></tr><tr><td class="protoname" align="left">
ctrlsToChange: KB_BOOLCTRLMASK</td></tr><tr><td class="protoname" align="left">
autoCtrls: KB_BOOLCTRLMASK</td></tr><tr><td class="protoname" align="left">
autoCtrlValues: KB_BOOLCTRLMASK</td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
supported: KB_PCFMASK
value: KB_PCFMASK
autoCtrls: KB_BOOLCTRLMASK
autoCtrlValues: KB_BOOLCTRLMASK
where: KB_PCFMASK:</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Value</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
Changes the client specific flags for the keyboard specified by <span class="emphasis"><em>
deviceSpec</em></span>
. Reports a <span class="emphasis"><em>
Keyboard</em></span>
 error if <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device.
</p><p>
Any flags specified in <span class="emphasis"><em>
change</em></span>
 are set to the corresponding values in <span class="emphasis"><em>
value</em></span>
, provided that the server supports the requested control. Legal
per-client-flags are:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Flag…</th><th align="left">Described in…</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
XkbPCF_DetectableAutorepeat</em></span>
</td><td align="left"><a class="link" href="#Detectable_Autorepeat" title="Detectable Autorepeat">Detectable
Autorepeat</a></td></tr><tr><td align="left"><span class="emphasis"><em>
XkbPCF_GrabsUseXKBStateMask</em></span>
</td><td align="left"><a class="link" href="#Setting_a_Passive_Grab_for_an_XKB_State" title="Setting a Passive Grab for an XKB State">Setting a Passive Grab
for an XKB State</a></td></tr><tr><td align="left"><span class="emphasis"><em>
XkbPCF_AutoResetControlsMask</em></span>
</td><td align="left"><a class="link" href="#Automatic_Reset_of_Boolean_Controls" title="Automatic Reset of Boolean Controls">Automatic Reset of
Boolean Controls</a></td></tr><tr><td align="left"><span class="emphasis"><em>
XkbPCF_LookupStateWhenGrabbed</em></span>
</td><td align="left"><a class="link" href="#Effects_of_XKB_on_Core_Protocol_Events" title="Effects of XKB on Core Protocol Events">Effects of XKB on Core
Protocol Events</a></td></tr><tr><td align="left"><span class="emphasis"><em>
XkbPCF_SendEventUsesXKBState</em></span>
</td><td align="left"><a class="link" href="#Sending_Events_to_Clients" title="Sending Events to Clients">Sending Events to
Clients</a></td></tr></tbody></table></div><p>
If <span class="emphasis"><em>
PCF_AutoResetControls</em></span>
 is set in both <span class="emphasis"><em>
change</em></span>
 and <span class="emphasis"><em>
value</em></span>
, the client’s mask of controls to be changed is updated from <span class="emphasis"><em>
ctrlsToChange</em></span>
, <span class="emphasis"><em>
autoCtrls</em></span>
, and <span class="emphasis"><em>
autoCtrlValues</em></span>
. Any controls specified in <span class="emphasis"><em>
ctrlsToChange</em></span>
 are modified in the auto-reset controls mask for the client; the corresponding
bits from the <span class="emphasis"><em>
autoCtrls</em></span>
 field are copied into the auto-reset controls mask and the corresponding bits
from <span class="emphasis"><em>
autoCtrlValues</em></span>
 are copied into the auto-reset controls state values. If any controls are
specified in <span class="emphasis"><em>
autoCtrlValues</em></span>
 but not in <span class="emphasis"><em>
autoCtrls</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results. If any controls are specified in <span class="emphasis"><em>
autoCtrls</em></span>
 but not in <span class="emphasis"><em>
ctrlsToChange</em></span>
, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
If <span class="emphasis"><em>
PCF_AutoResetControls</em></span>
 is set in <span class="emphasis"><em>
change</em></span>
 but not in <span class="emphasis"><em>
value</em></span>
, the client’s mask of controls to be changed is reset to all zeroes (i.e.
the client does not change any controls when it exits).
</p><p>
This request reports a <span class="emphasis"><em>
Match</em></span>
 error if a bit is set in any of the value masks but not in the control mask
that governs it or a <span class="emphasis"><em>
Value</em></span>
 error if any undefined bits are set in any of the masks.
</p><p>
On successful return, the <span class="emphasis"><em>
deviceID</em></span>
 field reports the X Input extension identifier of the keyboard, or <span class="emphasis"><em>
0</em></span>
 if the server does not support the X Input Extension.
</p><p>
The <span class="emphasis"><em>
supported</em></span>
 return value reports the set of per-client flags that are supported by the
server; in this version of XKB, only the <span class="emphasis"><em>
XkbPCF_DetectableAutorepeat</em></span>
 per-client flag is optional; all other per-client flags must be supported.
</p><p>
The <span class="emphasis"><em>
value</em></span>
 return value reports the current settings of all per-client flags for the
specified keyboard. The <span class="emphasis"><em>
autoCtrls</em></span>
 return value reports the current set of controls to be reset when the client
exits, while the <span class="emphasis"><em>
autoCtrlValues</em></span>
 return value reports the state to which they should be set.
</p></div><div class="sect2" title="Using the Server’s Database of Keyboard Components"><div class="titlepage"><div><div><h3 class="title"><a id="Using_the_Servers_Database_of_Keyboard_Components"></a>Using the Server’s Database of Keyboard Components</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbListComponents</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
maxNames: CARD16</td></tr><tr><td class="protoname" align="left">
keymapsSpec: STRING8</td></tr><tr><td class="protoname" align="left">
keycodesSpec: STRING8</td></tr><tr><td class="protoname" align="left">
typesSpec: STRING8</td></tr><tr><td class="protoname" align="left">
compatMapSpec: STRING8</td></tr><tr><td class="protoname" align="left">
symbolsSpec: STRING8</td></tr><tr><td class="protoname" align="left">
geometrySpec: STRING8
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
extra: CARD16
      </td></tr><tr><td class="protoreply" align="left">
keymaps,keycodes,types,compatMaps: LISTofKB_COMPONENTNAME
      </td></tr><tr><td class="protoreply" align="left">
symbols, geometries: LISTofKB_COMPONENTNAME</td></tr><tr><td class="protoreply" align="left">Where:</td></tr><tr><td class="protoreply" align="left">KB_COMPONENTNAME	{	hints: CARD8, name:
STRING8 }</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
This request returns one or more lists of keyboard components that are
available from the X server database of keyboard components for the device
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. The X server is allowed, but not required or expected, to maintain separate
databases for each keyboard device. A <span class="emphasis"><em>
Keyboard</em></span>
 error results if <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device.
</p><p>
The <span class="emphasis"><em>
maxNames</em></span>
 field specifies the maximum number of component names to be reported, in
total, by this request.
</p><p>
The <span class="emphasis"><em>
keymapsSpec</em></span>
, <span class="emphasis"><em>
keycodesSpec</em></span>
, <span class="emphasis"><em>
typesSpec</em></span>
, <span class="emphasis"><em>
compatMapSpec</em></span>
, <span class="emphasis"><em>
symbolsSpec</em></span>
 and <span class="emphasis"><em>
geometrySpec</em></span>
 request fields specify a pattern to be matched against the names of all
components of the corresponding type in the server database of keyboard
components.
</p><p>
Each pattern uses the ISO Latin-1 encoding and should contain only parentheses,
the wildcard characters "?" and "*" or characters that are permitted in a
component class or member name (see <a class="link" href="#Component_Names" title="Component Names">Component Names</a>). Illegal
characters in a pattern are simply ignored; no error results if a pattern
contains illegal characters.
</p><p>
Comparison is case-sensitive and, in a pattern, the "?" wildcard character
matches any single character except parentheses while the "*" character matches
any number of characters except parentheses. If an implementation accepts
characters other than those required by XKB, whether or not those characters
match either wildcard is also implementation dependent. An empty pattern does
not match any component names.
</p><p>
On successful return, the <span class="emphasis"><em>
deviceID</em></span>
 return value reports the X Input Extension device identifier of the specified
device, or <span class="emphasis"><em>
0</em></span>
 if the server does not support the X input extension. The <span class="emphasis"><em>
extra</em></span>
 return value reports the number of matching component names that could not be
returned due to the setting of the <span class="emphasis"><em>
maxNames</em></span>
 field in the request.
</p><p>
The <span class="emphasis"><em>
keymaps</em></span>
, <span class="emphasis"><em>
keycodes</em></span>
, <span class="emphasis"><em>
types</em></span>
, <span class="emphasis"><em>
compatMaps</em></span>
, <span class="emphasis"><em>
symbols</em></span>
 and <span class="emphasis"><em>
geometries</em></span>
 return the hints (see <a class="link" href="#Component_Hints" title="Component Hints">Component
Hints</a>) and names of any components from the server database that match
the corresponding pattern.
</p><p>
<a class="link" href="#The_Server_Database_of_Keyboard_Components" title="Chapter 13. The Server Database of Keyboard Components">The Server Database of Keyboard
Components</a> describes the X server database of keyboard components in
more detail.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetKbdByName</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
need, want: KB_GBNDETAILMASK</td></tr><tr><td class="protoname" align="left">
load: BOOL</td></tr><tr><td class="protoname" align="left">
keymapsSpec: STRING8</td></tr><tr><td class="protoname" align="left">
keycodesSpec, typesSpec: STRING8</td></tr><tr><td class="protoname" align="left">
compatMapSpec, symbolsSpec: STRING8</td></tr><tr><td class="protoname" align="left">
geometrySpec: STRING8
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
minKeyCode, maxKeyCode: KEYCODE
      </td></tr><tr><td class="protoreply" align="left">
loaded, newKeyboard: BOOL
      </td></tr><tr><td class="protoreply" align="left">
found, reported: KB_GBNDETAILMASK
      </td></tr><tr><td class="protoreply" align="left">
map: optional <span class="emphasis"><em>
XkbGetMap</em></span>
 reply
      </td></tr><tr><td class="protoreply" align="left">
compat: optional <span class="emphasis"><em>
XkbGetCompatMap</em></span>
 reply
      </td></tr><tr><td class="protoreply" align="left">
indicators: optional <span class="emphasis"><em>
XkbGetIndicatorMap</em></span>
 reply
      </td></tr><tr><td class="protoreply" align="left">
names: optional <span class="emphasis"><em>
XkbGetNames</em></span>
 reply
      </td></tr><tr><td class="protoreply" align="left">
geometry: optional <span class="emphasis"><em>
XkbGetGeometry</em></span>
 reply</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Keyboard</em></span>
, <span class="emphasis"><em>
Access</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
Assembles and returns a keymap from the current mapping and specified elements
from the server database of keymap components for the keyboard specified by
<span class="emphasis"><em>
deviceSpec</em></span>
, and optionally replaces the current keyboard mapping with the newly generated
description. If <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid keyboard device, a <span class="emphasis"><em>
Keyboard</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
keymapsSpec</em></span>
, <span class="emphasis"><em>
keycodesSpec</em></span>
, <span class="emphasis"><em>
typesSpec</em></span>
, <span class="emphasis"><em>
compatMapSpec</em></span>
, <span class="emphasis"><em>
symbolsSpec</em></span>
 and <span class="emphasis"><em>
geometrySpec</em></span>
 component expressions (see <a class="link" href="#Partial_Components_and_Combining_Multiple_Components" title="Partial Components and Combining Multiple Components">
Partial Components and Combining Multiple Components</a>) specify the
database components to be used to assemble the keyboard description.
</p><p>
The <span class="emphasis"><em>
want</em></span>
 field lists the pieces of the keyboard description that the client wants to
have reported for the newly constructed keymap. The <span class="emphasis"><em>
need</em></span>
 field lists all of the pieces that must be reported. If any of the pieces in
<span class="emphasis"><em>
need</em></span>
 cannot be loaded from the specified names, no description of the keyboard is
returned.
</p><p>
The <span class="emphasis"><em>
want</em></span>
 and <span class="emphasis"><em>
need</em></span>
 fields can include any combinations of these <span class="emphasis"><em>
XkbGetMapByName</em></span>
 (GBN) components:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">XkbGetMapByName Keyboard Component…</th><th align="left">Database Component…</th><th align="left">Components of Keyboard Description</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
XkbGBN_Types</em></span>
</td><td align="left">types</td><td align="left">key types</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_CompatMap</em></span>
</td><td align="left">compat</td><td align="left">symbol interpretations, group compatibility map</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_ClientSymbols</em></span>
</td><td align="left">symbols, types, keycodes</td><td align="left">key types, key symbol mappings, modifier mapping</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_ServerSymbols</em></span>
</td><td align="left">symbols, types, keycodes</td><td align="left">key behaviors, key actions, key explicit components, virtual
modifiers, virtual modifier mapping</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_IndicatorMap</em></span>
</td><td align="left">compat</td><td align="left">indicator maps, indicator names</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_KeyNames</em></span>
</td><td align="left">keycodes</td><td align="left">key names, key aliases</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_Geometry</em></span>
</td><td align="left">geometry</td><td align="left">keyboard geometry</td></tr><tr><td align="left"><span class="emphasis"><em>
XkbGBN_OtherNames</em></span>
</td><td align="left">all</td><td align="left">key types, symbol interpretations, indicator maps, names,
geometry</td></tr></tbody></table></div><p>
If either field contains a GBN component that depends on some database
component for which the request does not supply an expression, XKB
automatically substitutes the special pattern "%" which copies the
corresponding component from the current keyboard description, as described in
<a class="link" href="#Partial_Components_and_Combining_Multiple_Components" title="Partial Components and Combining Multiple Components">Partial Components and Combining
Multiple Components</a>.
</p><p>
The <span class="emphasis"><em>
load</em></span>
 flag asks the server to replace the current keyboard description for <span class="emphasis"><em>
deviceSpec</em></span>
 with the newly constructed keyboard description. If <span class="emphasis"><em>
load</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the request must include component expressions for all of the database
components; if any are missing, XKB substitutes "%" as described above.
</p><p>
If all necessary components are both specified and found, the new keyboard
description is loaded. If the new keyboard description has a different geometry
or keycode range than the previous keyboard description, XKB sends <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 events to all interested clients. See
<a class="link" href="#Replacing_the_Keyboard_On_the_Fly" title="Chapter 14. Replacing the Keyboard &quot;On-the-Fly&quot;">Replacing the Keyboard
"On-the-Fly"</a> for more information about the effects of replacing the
keyboard description on the fly.
</p><p>
If the range of keycodes changes, clients that have requested <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 events are not sent any other change notification events by this request.
Clients that do not request <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 events are sent other XKB change notification events (e.g. <span class="emphasis"><em>
XkbMapNotify</em></span>
, <span class="emphasis"><em>
XkbNamesNotify</em></span>
) as necessary to alert them to as many of the keyboard changes as possible.
</p><p>
If no error occurs, the request reply reports the GBN components that were
found and sends a description of any of the resulting keyboard that includes
and of the components that were requested.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 return value reports the X Input extension device identifier of the keyboard
that was used, or <span class="emphasis"><em>
0</em></span>
 if the server does not support the X input extension.
</p><p>
The <span class="emphasis"><em>
minKeyCode</em></span>
 and <span class="emphasis"><em>
maxKeyCode</em></span>
 return values report the legal range of keycodes for the keyboard description
that was created. If the resulting keyboard description does not include at
least one of the key names, client symbols or server symbols components,
<span class="emphasis"><em>
minKeyCode</em></span>
 and <span class="emphasis"><em>
maxKeyCode</em></span>
 are both <span class="emphasis"><em>
0</em></span>
.
</p><p>
The <span class="emphasis"><em>
loaded</em></span>
 return value reports whether or not the existing keyboard definition was
replaced with the newly created one. If <span class="emphasis"><em>
loaded</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the <span class="emphasis"><em>
newKeyboard</em></span>
 return value reports whether or not the new map changed the geometry or range
of keycodes and caused <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 events for clients that have requested them.
</p><p>
The <span class="emphasis"><em>
found</em></span>
 return value reports the GBN components that were present in the keymap that
was constructed by this request. The <span class="emphasis"><em>
reported</em></span>
 return value lists the subset of those components for which descriptions
follow. if any of the components specified in the <span class="emphasis"><em>
need</em></span>
 field of the request were not found, <span class="emphasis"><em>
reported</em></span>
 is empty, otherwise it contains the intersection of the <span class="emphasis"><em>
found</em></span>
 return value with the union of the <span class="emphasis"><em>
need</em></span>
 and <span class="emphasis"><em>
want</em></span>
 request fields.
</p><p>
If any of <span class="emphasis"><em>
GBN_Types</em></span>
, <span class="emphasis"><em>
GBN_ClientSymbols</em></span>
 or <span class="emphasis"><em>
GBN_ServerSymbols</em></span>
 are set in <span class="emphasis"><em>
reported</em></span>
, the <span class="emphasis"><em>
map</em></span>
 return value has the same format as the reply to an <span class="emphasis"><em>
XkbGetMap</em></span>
 request and reports the corresponding pieces of the newly constructed keyboard
description.
</p><p>
If <span class="emphasis"><em>
GBN_CompatMap</em></span>
 is set in <span class="emphasis"><em>
reported</em></span>
, the <span class="emphasis"><em>
compat</em></span>
 return value has the same format as the reply to an <span class="emphasis"><em>
XkbGetCompatMap</em></span>
 request and reports the symbol interpretations and group compatibility map for
the newly constructed keyboard description.
</p><p>
If <span class="emphasis"><em>
GBN_IndicatorMap</em></span>
 is set in <span class="emphasis"><em>
reported</em></span>
, the <span class="emphasis"><em>
indicators</em></span>
 return value has the same format as the reply to an <span class="emphasis"><em>
XkbGetIndicatorMap</em></span>
 request and reports the physical indicators and indicator maps for the newly
constructed keyboard description.
</p><p>
If <span class="emphasis"><em>
GBN_KeyNames</em></span>
 or <span class="emphasis"><em>
GBN_OtherNames</em></span>
 are set in <span class="emphasis"><em>
reported</em></span>
, the <span class="emphasis"><em>
names</em></span>
 return value has the same format as the reply to an <span class="emphasis"><em>
XkbGetNames</em></span>
 reply and reports the corresponding set of symbolic names for the newly
constructed keyboard description.
</p><p>
If <span class="emphasis"><em>
GBN_Geometry</em></span>
 is set in <span class="emphasis"><em>
reported</em></span>
, the <span class="emphasis"><em>
geometry</em></span>
 return value has the same format as the reply to an <span class="emphasis"><em>
XkbGetGeometryMap</em></span>
 request and reports the keyboard geometry for the newly constructed keyboard
description.
</p></div><div class="sect2" title="Querying and Changing Input Extension Devices"><div class="titlepage"><div><div><h3 class="title"><a id="Querying_and_Changing_Input_Extension_Devices"></a>Querying and Changing Input Extension Devices</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbGetDeviceInfo</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
wanted: KB_XIDEVFEATUREMASK</td></tr><tr><td class="protoname" align="left">
ledClass: KB_LEDCLASSSPEC</td></tr><tr><td class="protoname" align="left">
ledID: KB_IDSPEC</td></tr><tr><td class="protoname" align="left">
allButtons: BOOL</td></tr><tr><td class="protoname" align="left">
firstButton, nButtons: CARD8
      </td></tr><tr><td class="protoreply" align="left">
deviceID: CARD8
      </td></tr><tr><td class="protoreply" align="left">
present: KB_XIDEVFEATUREMASK
      </td></tr><tr><td class="protoreply" align="left">
supported: KB_XIFEATUREMASK
      </td></tr><tr><td class="protoreply" align="left">
unsupported: KB_XIFEATUREMASK
      </td></tr><tr><td class="protoreply" align="left">
firstBtnWanted: CARD8
      </td></tr><tr><td class="protoreply" align="left">
nBtnsWanted: CARD8
      </td></tr><tr><td class="protoreply" align="left">
firstBtnRtrn: CARD8
      </td></tr><tr><td class="protoreply" align="left">
nBtnsRtrn: CARD8
      </td></tr><tr><td class="protoreply" align="left">
totalBtns: CARD8
      </td></tr><tr><td class="protoreply" align="left">
hasOwnState: BOOL
      </td></tr><tr><td class="protoreply" align="left">
dfltKbdFB, dfltLedFB: KB_IDSPEC
      </td></tr><tr><td class="protoreply" align="left">
devType: ATOM
      </td></tr><tr><td class="protoreply" align="left">
name: STRING
      </td></tr><tr><td class="protoreply" align="left">
btnActions: LISTofKB_ACTION
      </td></tr><tr><td class="protoreply" align="left">
leds: LISTofKB_DEVICELEDINFO</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Device</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Access</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
Reports a subset of the XKB-supplied information about the input device
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. Unlike most XKB requests, the device specified for <span class="emphasis"><em>
XkbGetDeviceInfo</em></span>
 need not be a keyboard device. Nonetheless, a <span class="emphasis"><em>
Keyboard</em></span>
 error results if <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid core or input extension device.
</p><p>
The <span class="emphasis"><em>
wanted</em></span>
 field specifies the types of information to be returned, and controls the
interpretation of the other request fields.
</p><p>
If the server does not support assignment of XKB actions to extension device
buttons, the <span class="emphasis"><em>
allButtons</em></span>
, <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 fields are ignored.
</p><p>
Otherwise, if the <span class="emphasis"><em>
XkbXI_ButtonActions</em></span>
 flag is set in <span class="emphasis"><em>
wanted</em></span>
, the <span class="emphasis"><em>
allButtons</em></span>
, <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 fields specify the device buttons for which actions should be returned.
Setting <span class="emphasis"><em>
allButtons</em></span>
 to <span class="emphasis"><em>
True</em></span>
 requests actions for all device buttons; if <span class="emphasis"><em>
allButtons</em></span>
 is <span class="emphasis"><em>
False</em></span>
, <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 specify a range of buttons for which actions are requested. If the device has
no buttons or if <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 specify illegal buttons, a <span class="emphasis"><em>
Match</em></span>
 error results. If <span class="emphasis"><em>
allButtons</em></span>
 is <span class="emphasis"><em>
True</em></span>
, <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 are ignored.
</p><p>
If the server does not support XKB access to any aspect of the indicators on
extension devices, or if the <span class="emphasis"><em>
wanted</em></span>
 field does not include any of the indicator flags, the <span class="emphasis"><em>
ledClass</em></span>
 and <span class="emphasis"><em>
ledID</em></span>
 fields are ignored. Otherwise, <span class="emphasis"><em>
ledClass</em></span>
 and <span class="emphasis"><em>
ledID</em></span>
 specify one or more feedback(s) for which indicator information is requested.
If <span class="emphasis"><em>
ledClass</em></span>
 or <span class="emphasis"><em>
ledID</em></span>
 have illegal values, a <span class="emphasis"><em>
Value</em></span>
 error results. If they have legal values but do not specify a keyboard or
indicator class feedback for the device in question, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
The <span class="emphasis"><em>
ledClass</em></span>
 field can specify either <span class="emphasis"><em>
KbdFeedbackClass</em></span>
, <span class="emphasis"><em>
LedFeedbackClass</em></span>
, <span class="emphasis"><em>
XkbDfltXIClass</em></span>
, or <span class="emphasis"><em>
XkbAllXIClasses</em></span>
. If at least one keyboard feedback is defined for the specified device,
<span class="emphasis"><em>
XkbDfltXIClass</em></span>
 is equivalent to <span class="emphasis"><em>
KbdFeedbackClass</em></span>
, otherwise it is equivalent to <span class="emphasis"><em>
LedFeedbackClass</em></span>
. If <span class="emphasis"><em>
XkbAllXIClasses</em></span>
 is specified, this request returns information about both indicator and
keyboard class feedbacks which match the requested identifier, as described
below.
</p><p>
The <span class="emphasis"><em>
ledID</em></span>
 field can specify any valid input extension feedback identifier, <span class="emphasis"><em>
XkbDfltXIId</em></span>
, or <span class="emphasis"><em>
XkbAllXIIds</em></span>
. The default keyboard feedback is the one that is affected by core protocol
requests; the default led feedback is implementation-specific. If <span class="emphasis"><em>
XkbAllXIIds</em></span>
 is specified, this request returns indicator information about all feedbacks
of the class(es) specified by <span class="emphasis"><em>
ledClass</em></span>
.
</p><p>
If no error results, the <span class="emphasis"><em>
deviceID</em></span>
 return value reports the input extension device identifier of the device for
which values are being returned. The <span class="emphasis"><em>
supported</em></span>
 return value reports the set of optional XKB extension device features that
are supported by this implementation (see
<a class="link" href="#Interactions_Between_XKB_and_the_X_Input_Extension" title="Chapter 15. Interactions Between XKB and the X Input Extension">
Interactions Between XKB and the X Input
Extension</a>) for the specified device, and the unsupported return value
reports any <span class="emphasis"><em>
unsupported</em></span>
 features.
</p><p>
If <span class="emphasis"><em>
hasOwnState</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the device is also a keyboard, and any indicator maps bound to the device use
the current state and control settings for this device to control automatic
changes. If <span class="emphasis"><em>
hasOwnState</em></span>
 is <span class="emphasis"><em>
False</em></span>
, the state and control settings of the core keyboard device control automatic
indicator changes.
</p><p>
The <span class="emphasis"><em>
name</em></span>
 field reports the X Input Extension name for the device. The <span class="emphasis"><em>
devType</em></span>
 field reports the X Input Extension device type. Both fields are provided
merely for convenience and are not interpreted by XKB.
</p><p>
The <span class="emphasis"><em>
present</em></span>
 return value reports the kinds of device information being returned, and
controls the interpretation of the remaining fields. The <span class="emphasis"><em>
present</em></span>
 field consists of the <span class="emphasis"><em>
wanted</em></span>
 field from the original request minus the flags for any unsupported features.
</p><p>
If <span class="emphasis"><em>
XkbXI_ButtonActions</em></span>
 is set in <span class="emphasis"><em>
present</em></span>
, the <span class="emphasis"><em>
totalBtns</em></span>
 return value reports the total number of buttons present on the device,
<span class="emphasis"><em>
firstBtnWanted</em></span>
 and <span class="emphasis"><em>
nBtnsWanted</em></span>
 specify the range of buttons for which actions were requested, and the
<span class="emphasis"><em>
firstBtnRtrn</em></span>
 and <span class="emphasis"><em>
nBtnsRtrn </em></span>
values specify the range of buttons for which actions are reported. The
<span class="emphasis"><em>
actionsRtrn</em></span>
 list has <span class="emphasis"><em>
nButtonsRtrn</em></span>
 entries which contain the actions bound to the specified buttons on the
device. Any buttons for which actions were requested but not returned have the
action <span class="emphasis"><em>
NoAction()</em></span>
.
</p><p>
If any indicator information is reported, the leds list contains one element
for each requested feedback. For example, if <span class="emphasis"><em>
ledClass</em></span>
 is <span class="emphasis"><em>
XkbAllXIClasses</em></span>
 and <span class="emphasis"><em>
ledID</em></span>
 is <span class="emphasis"><em>
XkbAllXIIds</em></span>
, <span class="emphasis"><em>
leds</em></span>
 describes all of the indicators on the device and has one element for each
keyboard or led class feedback defined for the device. If any information at
all is reported about a feedback, the set of physical indicators is also
reported in the <span class="emphasis"><em>
physIndicators</em></span>
 field of the corresponding element of <span class="emphasis"><em>
leds</em></span>
.
</p><p>
If the server supports assignment of indicator maps to extension device
indicators, and if the <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 flag is set in <span class="emphasis"><em>
wanted</em></span>
, each member of <span class="emphasis"><em>
leds</em></span>
 reports any indicators on the corresponding feedback to which names have been
assigned. Any indicators for which no map is reported have the default map,
which allows explicit changes and does not request any automatic changes.
</p><p>
If the server supports assignment of indicator names to extension device
indicators, and the <span class="emphasis"><em>
XkbXI_IndicatorNames</em></span>
 flag is set in <span class="emphasis"><em>
wanted</em></span>
, each member of <span class="emphasis"><em>
leds</em></span>
 reports any indicators on the corresponding feedback to which names have been
assigned. Any indicators for which no name is reported have the name <span class="emphasis"><em>
None</em></span>
.
</p><p>
If the server supports XKB access to the state of extension device indicators,
and the <span class="emphasis"><em>
XkbXI_IndicatorState</em></span>
 flag is set in wanted, each member of leds reports the state of the indicators
on the corresponding feedback.
</p><p>
If any unsupported features are requested, and the requesting client has
selected for them, the server sends the client an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event which indicates that an unsupported feature was requested. This event is
only generated if the client which issued the unsupported request has selected
for it and, if generated, is not sent to any other clients.
</p><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetDeviceInfo</th></tr></thead><tbody><tr><td class="protoargs" align="left">deviceSpec: KB_DEVICESPEC</td></tr><tr><td class="protoname" align="left">
change: KB_XIDEVFEATUREMASK</td></tr><tr><td class="protoname" align="left">
firstBtn, nBtns: CARD8</td></tr><tr><td class="protoname" align="left">
btnActions:LISTofKB_ACTION</td></tr><tr><td class="protoname" align="left">
leds: LISTofKB_DEVICELEDINFO</td></tr><tr><td class="protoerror" align="left">Errors: <span class="emphasis"><em>
Device</em></span>
, <span class="emphasis"><em>
Match</em></span>
, <span class="emphasis"><em>
Access</em></span>
, <span class="emphasis"><em>
Alloc</em></span>
</td></tr></tbody></table></div><p>
Changes a subset of the XKB-supplied information about the input device
specified by <span class="emphasis"><em>
deviceSpec</em></span>
. Unlike most XKB requests, the device specified for <span class="emphasis"><em>
XkbGetDeviceInfo</em></span>
 need not be a keyboard device. Nonetheless, a <span class="emphasis"><em>
Keyboard</em></span>
 error results if <span class="emphasis"><em>
deviceSpec</em></span>
 does not specify a valid core or input extension device
</p><p>
The <span class="emphasis"><em>
change</em></span>
 field specifies the features for which new values are supplied, and controls
the interpretation of the other request fields.
</p><p>
If the server does not support assignment of XKB actions to extension device
buttons, the <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 fields are ignored.
</p><p>
Otherwise, if the <span class="emphasis"><em>
XkbXI_ButtonActions</em></span>
 flag is set in <span class="emphasis"><em>
change</em></span>
, the <span class="emphasis"><em>
firstBtn</em></span>
 and <span class="emphasis"><em>
nBtns</em></span>
 fields specify a range of buttons for which actions are specified in this
request. If the device has no buttons or if <span class="emphasis"><em>
firstBtn</em></span>
 and <span class="emphasis"><em>
nBtns</em></span>
 specify illegal buttons, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
Each element of the <span class="emphasis"><em>
leds</em></span>
 list describes the changes for a single keyboard or led feedback. If the
<span class="emphasis"><em>
ledClass</em></span>
 field of any element of <span class="emphasis"><em>
leds</em></span>
 contains any value other than <span class="emphasis"><em>
KbdFeedbackClass</em></span>
, <span class="emphasis"><em>
LedFeedbackClass</em></span>
 or <span class="emphasis"><em>
XkbDfltXIClass</em></span>
, a <span class="emphasis"><em>
Value</em></span>
 error results. If the <span class="emphasis"><em>
ledId</em></span>
 field of any element of leds contains any value other than a valid input
extension feedback identifier or <span class="emphasis"><em>
XkbDfltXIId</em></span>
, a <span class="emphasis"><em>
Value</em></span>
 error results. If both fields are valid, but the device has no matching
feedback, a <span class="emphasis"><em>
Match</em></span>
 error results.
</p><p>
The fields of each element of <span class="emphasis"><em>
leds</em></span>
 are interpreted as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 is set in <span class="emphasis"><em>
change</em></span>
 and the server supports XKB assignment of indicator maps to the corresponding
feedback, the maps for all indicators on the corresponding feedback are taken
from <span class="emphasis"><em>
leds</em></span>
. If the server does not support this feature, any maps specified in <span class="emphasis"><em>
leds</em></span>
 are ignored.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
XkbXI_IndicatorNames</em></span>
 is set in <span class="emphasis"><em>
change</em></span>
, and the server supports XKB assignment of names to indicators for the
corresponding feedback, the names for all indicators on the corresponding
feedback are taken from <span class="emphasis"><em>
leds</em></span>
. If the server does not support this feature, any names specified in <span class="emphasis"><em>
leds</em></span>
 are ignored. Regardless of whether they are used, any names be a valid Atom or
<span class="emphasis"><em>
None</em></span>
, or an <span class="emphasis"><em>
Atom</em></span>
 error results.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
XkbXI_IndicatorState</em></span>
 is set in change, and the server supports XKB changes to extension device
indicator state, the server attempts to change the indicators on the
corresponding feedback as specified by <span class="emphasis"><em>
leds</em></span>
. Any indicator maps bound to the feedback are applied, so state changes might
be blocked or have side-effects.
  </p></li></ul></div><p>
If any unsupported features are requested, and the requesting client has
selected for them, the server sends the client an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event which indicates that an unsupported feature was requested. This event is
only generated if the client which issued the unsupported request has selected
for it and, if generated, is not sent to any other clients.
</p></div><div class="sect2" title="Debugging the X Keyboard Extension"><div class="titlepage"><div><div><h3 class="title"><a id="Debugging_the_X_Keyboard_Extension"></a>Debugging the X Keyboard Extension</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbSetDebuggingFlags</th></tr></thead><tbody><tr><td class="protoargs" align="left">affectFlags, flags: CARD32</td></tr><tr><td class="protoname" align="left">
affectCtrls, ctrls: CARD32</td></tr><tr><td class="protoname" align="left">
message: STRING
      </td></tr><tr><td class="protoreply" align="left">
currentFlags, supportedFlags: CARD32
      </td></tr><tr><td class="protoreply" align="left">
currentCtrls, supportedCtrls: CARD32</td></tr></tbody></table></div><p>
This request sets up various internal XKB debugging flags and controls. It is
intended for developer use and may be disabled in production servers. If
disabled, <span class="emphasis"><em>
XkbSetDebuggingFlags</em></span>
 has no effect but returns <span class="emphasis"><em>
Success</em></span>
.
</p><p>
The <span class="emphasis"><em>
affectFlags</em></span>
 field specifies the debugging flags to be changed, the <span class="emphasis"><em>
flags</em></span>
 field specifies new values for the changed flags. The interpretation of the
debugging flags is implementation-specific, but flags are intended to control
debugging output and should not otherwise affect the operation of the server.
</p><p>
The <span class="emphasis"><em>
affectCtrls</em></span>
 field specifies the debugging controls to be changed, the <span class="emphasis"><em>
ctrls</em></span>
 field specifies new values for the changed controls. The interpretation of the
debugging controls is implementation-specific, but debugging controls are
allowed to affect the behavior of the server.
</p><p>
The <span class="emphasis"><em>
message</em></span>
 field provides a message that the X server can print in any logging or
debugging files before changing the flags. The server must accept this field
but it is not required to actually display it anywhere.
</p><p>
The X Test Suite makes some assumptions about the implementation of locking
modifier keys that do not apply when XKB is present. The <span class="emphasis"><em>
XkbDF_DisableLocks</em></span>
 debugging control provides a simple workaround to these test suite problems by
simply disabling all locking keys. If <span class="emphasis"><em>
XkbDF_DisableLocks</em></span>
 is enabled, the <span class="emphasis"><em>
SA_LockMods</em></span>
 and <span class="emphasis"><em>
SA_LockGroup</em></span>
 actions behave like <span class="emphasis"><em>
SA_SetMods</em></span>
 and <span class="emphasis"><em>
SA_LockMods</em></span>
, respectively. If it is disabled, <span class="emphasis"><em>
SA_LockMods</em></span>
 and <span class="emphasis"><em>
SA_LockGroup</em></span>
 actions behave normally.
</p><p>
Implementations are free to ignore the <span class="emphasis"><em>
XkbDF_DisableLocks</em></span>
 debugging control or to define others.
</p><p>
The <span class="emphasis"><em>
currentFlags</em></span>
 return value reports the current setting for the debugging flags, if
applicable. The <span class="emphasis"><em>
currentCtrls</em></span>
 return value reports the setting for the debugging controls, if applicable.
The <span class="emphasis"><em>
supportedFlags</em></span>
 and <span class="emphasis"><em>
supportedCtrls</em></span>
 fields report the flags and controls that are recognized by the
implementation. Attempts to change unsupported fields or controls are silently
ignored.
</p><p>
If the <span class="emphasis"><em>
XkbSetDebuggingFlags</em></span>
 request contains more data than expected, the server ignores the extra data,
but no error results. If the request has less data than expected, a <span class="emphasis"><em>
Length</em></span>
 error results.
</p><p>
If the <span class="emphasis"><em>
XkbSetDebuggingFlags</em></span>
 reply contains more data than expected, the client just ignores any
uninterpreted data without reporting an error. If the reply has less data than
expected, a <span class="emphasis"><em>
Length</em></span>
 error results.
</p></div></div><div class="sect1" title="Events"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Events"></a>Events</h2></div></div></div><p>
All XKB events report the time at which they occurred in a field named
<span class="emphasis"><em>
time</em></span>
 and the device on which they occurred in a field named <span class="emphasis"><em>
deviceID</em></span>
. XKB uses a single X event code for all events and uses a common field to
distinguish XKB event type.
</p><div class="sect2" title="Tracking Keyboard Replacement"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_Replacement"></a>Tracking Keyboard Replacement</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbNewKeyboardNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
changed: KB_NKNDETAILMASK</td></tr><tr><td class="protoname" align="left">
minKeyCode, maxKeyCode: KEYCODE</td></tr><tr><td class="protoname" align="left">
oldDeviceID: CARD8</td></tr><tr><td class="protoname" align="left">
oldMinKeyCode, oldMaxKeyCode: KEYCODE</td></tr><tr><td class="protoname" align="left">
requestMajor, requestMinor: CARD8</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event reports that a new core keyboard has been installed. New keyboard notify
events can be generated:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>When the X server detects that the keyboard was changed.
  </p></li><li class="listitem"><p>When a client installs a new extension device as the core keyboard
using the X Input Extension <span class="emphasis"><em>
ChangeKeyboardDevice</em></span>
 request.
  </p></li><li class="listitem"><p>When a client issues an <span class="emphasis"><em>
XkbGetMapByName</em></span>
 request which changes the keycodes range or geometry.
  </p></li></ul></div><p>
The <span class="emphasis"><em>
changed</em></span>
 field of the event reports the aspects of the keyboard that have changed, and
can contain any combination of the event details for this event:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Bit in Changed</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">NKN_Keycodes</td><td align="left">The new keyboard has a different minimum or maximum keycode.</td></tr><tr><td align="left">NKN_Geometry</td><td align="left">The new keyboard has a different keyboard geometry.</td></tr><tr><td align="left">NKN_DeviceID</td><td align="left">The new keyboard has a new X Input Extension device
identifier</td></tr></tbody></table></div><p>
The server sends an <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
changed</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
The <span class="emphasis"><em>
minKeyCode</em></span>
 and <span class="emphasis"><em>
maxKeyCode</em></span>
 fields report the minimum and maximum keycodes that can be returned by the new
keyboard. The <span class="emphasis"><em>
oldMinKeyCode</em></span>
 and <span class="emphasis"><em>
oldMaxKeyCode</em></span>
 fields report the minimum and maximum values that could be returned before the
change. This event always reports all four values, but the old and new values
are the same unless <span class="emphasis"><em>
NKN_Keycodes</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
.
</p><p>
Once a client receives a new keyboard notify event which reports a new keycode
range, the X server reports events from all keys in the new range to that
client. Clients that do not request or receive new keyboard notify events
receive events only from keys that fall in the last range for legal keys
reported to that client. See <a class="link" href="#Replacing_the_Keyboard_On_the_Fly" title="Chapter 14. Replacing the Keyboard &quot;On-the-Fly&quot;">
Replacing the Keyboard "On-the-Fly"</a> for a more detailed explanation.
</p><p>
If <span class="emphasis"><em>
NKN_Keycodes</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event subsumes all other change notification events (e.g. <span class="emphasis"><em>
XkbMapNotify</em></span>
, <span class="emphasis"><em>
XkbNamesNotify</em></span>
) that would otherwise result from the keyboard change. Clients who receive an
<span class="emphasis"><em>
XkbNewKeyboardNotify</em></span>
 event should assume that all other aspects of the keyboard mapping have
changed and regenerate the entire local copy of the keyboard description.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the X Input Extension device identifier of the new keyboard
device; <span class="emphasis"><em>
oldDeviceID</em></span>
 reports the device identifier before the change. This event always includes
both values, but they are the same unless <span class="emphasis"><em>
NKN_DeviceID</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
. If the server does not support the X Input Extension, both fields have the
value <span class="emphasis"><em>
0</em></span>
.
</p><p>
The <span class="emphasis"><em>
requestMajor</em></span>
 and <span class="emphasis"><em>
requestMinor</em></span>
 fields report the major and minor opcode of the request that caused the
keyboard change. If the keyboard change was not caused by some client request,
both fields have the value <span class="emphasis"><em>
0</em></span>
.
</p></div><div class="sect2" title="Tracking Keyboard Mapping Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_Mapping_Changes"></a>Tracking Keyboard Mapping Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbMapNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
ptrBtnActions: CARD8</td></tr><tr><td class="protoname" align="left">
changed: KB_MAPPARTMASK</td></tr><tr><td class="protoname" align="left">
minKeyCode, maxKeyCode: KEYCODE</td></tr><tr><td class="protoname" align="left">
firstType, nTypes: CARD8</td></tr><tr><td class="protoname" align="left">
firstKeySym, firstKeyAction: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeySyms, nKeyActions: CARD8</td></tr><tr><td class="protoname" align="left">
firstKeyBehavior, firstKeyExplicit: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeyBehaviors, nKeyExplicit: CARD8</td></tr><tr><td class="protoname" align="left">
virtualMods: KB_VMODMASK</td></tr><tr><td class="protoname" align="left">
firstModMapKey, firstVModMapKey: KEYCODE</td></tr><tr><td class="protoname" align="left">
nModMapKeys, nVModMapKeys: CARD8</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbMapNotify</em></span>
 event reports that some aspect of XKB map for a keyboard has changed. Map
notify events can be generated whenever some aspect of the keyboard map is
changed by an XKB or core protocol request.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard for which some map component has changed and the
<span class="emphasis"><em>
changed</em></span>
 field reports the components with new values, and can contain any of the
values that are legal for the <span class="emphasis"><em>
full</em></span>
 and <span class="emphasis"><em>
partial</em></span>
 fields of the <span class="emphasis"><em>
XkbGetMap</em></span>
 request. The server sends an <span class="emphasis"><em>
XkbMapNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
changed</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
The <span class="emphasis"><em>
minKeyCode</em></span>
 and <span class="emphasis"><em>
maxKeyCode</em></span>
 fields report the range of keycodes that are legal on the keyboard for which
the change is being reported.
</p><p>
If <span class="emphasis"><em>
XkbKeyTypesMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstType</em></span>
 and <span class="emphasis"><em>
nTypes</em></span>
 fields report a range of key types that includes all changed types. Otherwise,
both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbKeySymsMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstKeySym</em></span>
 and <span class="emphasis"><em>
nKeySyms</em></span>
 fields report a range of keycodes that includes all keys with new symbols.
Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbKeyActionsMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstKeyAction</em></span>
 and <span class="emphasis"><em>
nKeyActions</em></span>
 fields report a range of keycodes that includes all keys with new actions.
Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbKeyBehaviorsMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstKeyBehavior </em></span>
and <span class="emphasis"><em>
nKeyBehaviors</em></span>
 fields report a range of keycodes that includes all keys with new key
behavior. Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbVirtualModsMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, <span class="emphasis"><em>
virtualMods</em></span>
 contains all virtual modifiers to which a new set of real modifiers is bound.
Otherwise, <span class="emphasis"><em>
virtualMods</em></span>
 is <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbExplicitComponentsMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstKeyExplicit</em></span>
 and <span class="emphasis"><em>
nKeyExplicit</em></span>
 fields report a range of keycodes that includes all keys with changed explicit
components. Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbModifierMapMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstModMapKey</em></span>
 and <span class="emphasis"><em>
nModMapKeys</em></span>
 fields report a range of keycodes that includes all keys with changed modifier
bindings. Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
XkbVirtualModMapMask</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstVModMapKey</em></span>
 and <span class="emphasis"><em>
nVModMapKeys</em></span>
 fields report a range of keycodes that includes all keys with changed virtual
modifier mappings. Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p></div><div class="sect2" title="Tracking Keyboard State Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_State_Changes"></a>Tracking Keyboard State Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbStateNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
mods, baseMods, latchedMods, lockedMods: KEYMASK</td></tr><tr><td class="protoname" align="left">
group, lockedGroup: CARD8</td></tr><tr><td class="protoname" align="left">
baseGroup, latchedGroup: INT16</td></tr><tr><td class="protoname" align="left">
compatState: KEYMASK</td></tr><tr><td class="protoname" align="left">
grabMods, compatGrabMods: KEYMASK</td></tr><tr><td class="protoname" align="left">
lookupMods, compatLookupMods: KEYMASK</td></tr><tr><td class="protoname" align="left">
ptrBtnState: BUTMASK</td></tr><tr><td class="protoname" align="left">
changed: KB_STATEPARTMASK</td></tr><tr><td class="protoname" align="left">
keycode: KEYCODE</td></tr><tr><td class="protoname" align="left">
eventType: CARD8</td></tr><tr><td class="protoname" align="left">
requestMajor, requestMinor: CARD8</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>XkbStateNotify</em></span>
event reports that some component of the XKB state (see
<a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">Keyboard State</a>) has changed.
State notify events are usually caused by key or pointer activity, but they can
also result from explicit state changes requested by the <span class="emphasis"><em>
XkbLatchLockState</em></span>
 request or by other extensions.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard on which some state component changed. The
<span class="emphasis"><em>
changed</em></span>
 field reports the XKB state components (see
<a class="link" href="#Keyboard_State" title="Chapter 2. Keyboard State">Keyboard State</a>) that have changed
and contain any combination of:
</p><div class="informaltable"><table border="0"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">Bit in changed</th><th align="left">Event field</th><th align="left">Changed component</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
ModifierState</em></span>
</td><td align="left"><span class="emphasis"><em>
mods</em></span>
</td><td align="left">The effective modifiers</td></tr><tr><td align="left"><span class="emphasis"><em>
ModifierBase</em></span>
</td><td align="left"><span class="emphasis"><em>
baseMods</em></span>
</td><td align="left">The base modifiers</td></tr><tr><td align="left"><span class="emphasis"><em>
ModifierLatch</em></span>
</td><td align="left"><span class="emphasis"><em>
latchedMods</em></span>
</td><td align="left">The latched modifiers</td></tr><tr><td align="left"><span class="emphasis"><em>
ModifierLock</em></span>
</td><td align="left"><span class="emphasis"><em>
lockedMods</em></span>
</td><td align="left">The locked modifiers</td></tr><tr><td align="left"><span class="emphasis"><em>
GroupState</em></span>
</td><td align="left"><span class="emphasis"><em>
group</em></span>
</td><td align="left">The effective keyboard group</td></tr><tr><td align="left"><span class="emphasis"><em>
GroupBase</em></span>
</td><td align="left"><span class="emphasis"><em>
baseGroup</em></span>
</td><td align="left">The base keyboard group</td></tr><tr><td align="left"><span class="emphasis"><em>
GroupLatch</em></span>
</td><td align="left"><span class="emphasis"><em>
latchedGroup</em></span>
</td><td align="left">The latched keyboard group</td></tr><tr><td align="left"><span class="emphasis"><em>
GroupLock</em></span>
</td><td align="left"><span class="emphasis"><em>
lockedGroup</em></span>
</td><td align="left">The locked keyboard group</td></tr><tr><td align="left"><span class="emphasis"><em>
PointerButtons</em></span>
</td><td align="left"><span class="emphasis"><em>
ptrBtnState</em></span>
</td><td align="left">The state of the core pointer buttons</td></tr><tr><td align="left"><span class="emphasis"><em>
GrabMods</em></span>
</td><td align="left"><span class="emphasis"><em>
grabMods</em></span>
</td><td align="left">The XKB state used to compute grabs</td></tr><tr><td align="left"><span class="emphasis"><em>
LookupMods</em></span>
</td><td align="left"><span class="emphasis"><em>
lookupMods</em></span>
</td><td align="left">The XKB state used to look up symbols</td></tr><tr><td align="left"><span class="emphasis"><em>
CompatState</em></span>
</td><td align="left"><span class="emphasis"><em>
compatState</em></span>
</td><td align="left">Default state for non-XKB clients</td></tr><tr><td align="left"><span class="emphasis"><em>
CompatGrabMods</em></span>
</td><td align="left"><span class="emphasis"><em>
compatGrabMods</em></span>
</td><td align="left">The core state used to compute grabs</td></tr><tr><td align="left"><span class="emphasis"><em>
CompatLookupMods</em></span>
</td><td align="left"><span class="emphasis"><em>
compatLookupMods</em></span>
</td><td align="left">The core state used to look up symbols</td></tr></tbody></table></div><p>
The server sends an <span class="emphasis"><em>
XkbStateNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
changed</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
A state notify event reports current values for all state components, even
those with unchanged values.
</p><p>
The <span class="emphasis"><em>
keycode</em></span>
 field reports the key or button which caused the change in state while the
<span class="emphasis"><em>
eventType</em></span>
 field reports the exact type of event (e.g. <span class="emphasis"><em>
KeyPress</em></span>
). If the change in state was not caused by key or button activity, both fields
have the value <span class="emphasis"><em>
0</em></span>
.
</p><p>
The <span class="emphasis"><em>
requestMajor</em></span>
 and <span class="emphasis"><em>
requestMinor</em></span>
 fields report the major and minor opcodes of the request that caused the
change in state and have the value <span class="emphasis"><em>
0</em></span>
 if it was resulted from key or button activity.
</p></div><div class="sect2" title="Tracking Keyboard Control Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_Control_Changes"></a>Tracking Keyboard Control Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbControlsNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
numGroups: CARD8</td></tr><tr><td class="protoname" align="left">
changedControls: KB_CONTROLMASK</td></tr><tr><td class="protoname" align="left">
enabledControls,enabledControlChanges: KB_BOOLCTRLMASK</td></tr><tr><td class="protoname" align="left">
keycode: KEYCODE</td></tr><tr><td class="protoname" align="left">
eventType: CARD8</td></tr><tr><td class="protoname" align="left">
requestMajor: CARD8</td></tr><tr><td class="protoname" align="left">
requestMinor: CARD8</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbControlsNotify</em></span>
 event reports a change in one or more of the global keyboard controls (see
<a class="link" href="#Global_Keyboard_Controls" title="Chapter 4. Global Keyboard Controls">Global Keyboard Controls</a>)
or in the internal modifiers or ignore locks masks (see
<a class="link" href="#Server_Internal_Modifiers_and_Ignore_Locks_Behavior" title="Server Internal Modifiers and Ignore Locks Behavior">
Server Internal Modifiers and Ignore
Locks Behavior</a>). Controls notify events are usually caused by and
<span class="emphasis"><em>
XkbSetControls</em></span>
 request, but they can also be caused by keyboard activity or certain core
protocol and input extension requests.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard for which some control has changed, and the
<span class="emphasis"><em>
changed</em></span>
 field reports the controls that have new values.
</p><p>
The <span class="emphasis"><em>
changed</em></span>
 field can contain any of the values that are permitted for the <span class="emphasis"><em>
changeControls</em></span>
 field of the <span class="emphasis"><em>
XkbSetControls</em></span>
 request. The server sends an <span class="emphasis"><em>
XkbControlsNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
changed</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
The <span class="emphasis"><em>
numGroups</em></span>
 field reports the total number of groups defined for the keyboard, whether or
not the number of groups has changed.
</p><p>
The <span class="emphasis"><em>
enabledControls</em></span>
 field reports the current status of all of the boolean controls, whether or
not any boolean controls changed state. If <span class="emphasis"><em>
EnabledControls</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
enabledControlChanges</em></span>
 field reports the boolean controls that were enabled or disabled; if a control
is specified in <span class="emphasis"><em>
enabledControlChanges</em></span>
, the value that is reported for that control in <span class="emphasis"><em>
enabledControls</em></span>
 represents a change in state.
</p><p>
The <span class="emphasis"><em>
keycode</em></span>
 field reports the key or button which caused the change in state while the
<span class="emphasis"><em>
eventType</em></span>
 field reports the exact type of event (e.g. <span class="emphasis"><em>
KeyPress</em></span>
). If the change in state was not caused by key or button activity, both fields
have the value <span class="emphasis"><em>
0</em></span>
.
</p><p>
The <span class="emphasis"><em>
requestMajor</em></span>
 and <span class="emphasis"><em>
requestMinor</em></span>
 fields report the major and minor opcodes of the request that caused the
change in state and have the value <span class="emphasis"><em>
0</em></span>
 if it was resulted from key or button activity.
</p></div><div class="sect2" title="Tracking Keyboard Indicator State Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_Indicator_State_Changes"></a>Tracking Keyboard Indicator State Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbIndicatorStateNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
stateChanged, state: KB_INDICATORMASK</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
 event indicates that one or more of the indicators on a keyboard have changed
state. Indicator state notify events can be caused by:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Automatic update to reflect changes in keyboard state (keyboard
activity, <span class="emphasis"><em>
XkbLatchLockState</em></span>
 requests).
  </p></li><li class="listitem"><p>Automatic update to reflect changes in keyboard controls (<span class="emphasis"><em>
XkbSetControls</em></span>
, keyboard activity, certain core protocol and input extension requests).
  </p></li><li class="listitem"><p>Explicit attempts to change indicator state (core protocol and input
extension requests, <span class="emphasis"><em>
XkbSetNamedIndicator</em></span>
 requests).
  </p></li><li class="listitem"><p>Changes to indicator maps (<span class="emphasis"><em>
XkbSetIndicatorMap</em></span>
 and <span class="emphasis"><em>
XkbSetNamedIndicator</em></span>
 requests).
  </p></li></ul></div><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard for which some indicator has changed, and the
<span class="emphasis"><em>
state</em></span>
 field reports the new state for all indicators on the specified keyboard. The
<span class="emphasis"><em>
stateChanged</em></span>
 field specifies which of the values in <span class="emphasis"><em>
state</em></span>
 represent a new state for the corresponding indicator. The server sends an
<span class="emphasis"><em>
XkbIndicatorStateNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
stateChanged</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p></div><div class="sect2" title="Tracking Keyboard Indicator Map Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_Indicator_Map_Changes"></a>Tracking Keyboard Indicator Map Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbIndicatorMapNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
state: KB_INDICATORMASK</td></tr><tr><td class="protoname" align="left">
mapChanged: KB_INDICATORMASK</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbIndicatorMapNotify</em></span>
 event indicates that the maps for one or more keyboard indicators have been
changed. Indicator map notify events can be caused by <span class="emphasis"><em>
XkbSetIndicatorMap</em></span>
 and <span class="emphasis"><em>
XkbSetNamedIndicator</em></span>
 requests.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard for which some indicator map has changed, and the
<span class="emphasis"><em>
mapChanged</em></span>
 field reports the indicators with changed maps. The server sends an <span class="emphasis"><em>
XkbIndicatorMapNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
mapChanged</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
The <span class="emphasis"><em>
state</em></span>
 field reports the current state of all indicators on the specified keyboard.
</p></div><div class="sect2" title="Tracking Keyboard Name Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Keyboard_Name_Changes"></a>Tracking Keyboard Name Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbNamesNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
changed: KB_NAMEDETAILMASK</td></tr><tr><td class="protoname" align="left">
firstType, nTypes: CARD8</td></tr><tr><td class="protoname" align="left">
firstLevelName, nLevelNames: CARD8</td></tr><tr><td class="protoname" align="left">
firstKey: KEYCODE</td></tr><tr><td class="protoname" align="left">
nKeys, nKeyAliases, nRadioGroups: CARD8</td></tr><tr><td class="protoname" align="left">
changedGroupNames: KB_GROUPMASK</td></tr><tr><td class="protoname" align="left">
changedVirtualMods: KB_VMODMASK</td></tr><tr><td class="protoname" align="left">
changedIndicators: KB_INDICATORMASK</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbNamesNotify</em></span>
 event reports a change to one or more of the symbolic names associated with a
keyboard. Symbolic names can change when:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p> Some client explicitly changes them using <span class="emphasis"><em>
XkbSetNames</em></span>
.
  </p></li><li class="listitem"><p>The list of key types or radio groups is resized
  </p></li><li class="listitem"><p>The group width of some key type is changed
  </p></li></ul></div><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard on which names were changed. The <span class="emphasis"><em>
changed</em></span>
 mask lists the components for which some names have changed and can have any
combination of the values permitted for the <span class="emphasis"><em>
which</em></span>
 field of the <span class="emphasis"><em>
XkbGetNames</em></span>
 request. The server sends an <span class="emphasis"><em>
XkbNamesNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
changed</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
If <span class="emphasis"><em>
KeyTypeNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstType</em></span>
 and <span class="emphasis"><em>
nTypes</em></span>
 fields report a range of types that includes all types with changed names.
Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
KTLevelNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstLevelName</em></span>
 and <span class="emphasis"><em>
nLevelNames</em></span>
 fields report a range of types that includes all types with changed level
names. Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
IndicatorNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
changedIndicators</em></span>
 field reports the indicators with changed names. Otherwise, <span class="emphasis"><em>
changedIndicators</em></span>
 is <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
VirtualModNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
changedVirtualMods</em></span>
 field reports the virtual modifiers with changed names. Otherwise, <span class="emphasis"><em>
changedVirtualMods</em></span>
 is <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
GroupNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
changedGroupNames</em></span>
 field reports the groups with changed names. Otherwise, <span class="emphasis"><em>
changedGroupNames</em></span>
 is <span class="emphasis"><em>
0</em></span>
.
</p><p>
If <span class="emphasis"><em>
KeyNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
, the <span class="emphasis"><em>
firstKey</em></span>
 and <span class="emphasis"><em>
nKeys</em></span>
 fields report a range of keycodes that includes all keys with changed names.
Otherwise, both fields are <span class="emphasis"><em>
0</em></span>
.
</p><p>
The <span class="emphasis"><em>
nKeyAliases</em></span>
 field reports the total number of key aliases associated with the keyboard,
regardless of whether <span class="emphasis"><em>
KeyAliases</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
.
</p><p>
The <span class="emphasis"><em>
nRadioGroups</em></span>
 field reports the total number of radio group names associated with the
keyboard, regardless of whether <span class="emphasis"><em>
RGNames</em></span>
 is set in <span class="emphasis"><em>
changed</em></span>
.
</p></div><div class="sect2" title="Tracking Compatibility Map Changes"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Compatibility_Map_Changes"></a>Tracking Compatibility Map Changes</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbCompatMapNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
changedGroups: KB_GROUPMASK</td></tr><tr><td class="protoname" align="left">
firstSI, nSI: CARD16</td></tr><tr><td class="protoname" align="left">
nTotalSI: CARD16</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbCompatMapNotify</em></span>
 event indicates that some component of the compatibility map for a keyboard
has been changed. Compatibility map notify events can be caused by <span class="emphasis"><em>
XkbSetCompatMap</em></span>
 and <span class="emphasis"><em>
XkbGetMapByName</em></span>
 requests.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field reports the keyboard for which the compatibility map has changed; if the
server does not support the X input extension, <span class="emphasis"><em>
deviceID</em></span>
 is <span class="emphasis"><em>
0</em></span>
.
</p><p>
The <span class="emphasis"><em>
changedGroups</em></span>
 field reports the keyboard groups, if any, with a changed entry in the group
compatibility map. The <span class="emphasis"><em>
firstSI</em></span>
 and <span class="emphasis"><em>
nSI</em></span>
 fields specify a range of symbol interpretations in the symbol compatibility
map that includes all changed symbol interpretations; if the symbol
compatibility map is unchanged, both fields are <span class="emphasis"><em>
0</em></span>
. The <span class="emphasis"><em>
nTotalSI</em></span>
 field always reports the total number of symbol interpretations present in the
symbol compatibility map, regardless of whether any symbol interpretations have
been changed.
</p><p>
The server sends an <span class="emphasis"><em>
XkbCompatMapNotify</em></span>
 event to a client only if at least one of the following conditions is met:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The <span class="emphasis"><em>
nSI</em></span>
 field of the event is non-zero, and the <span class="emphasis"><em>
XkbSymInterpMask</em></span>
 bit is set in the appropriate event details mask for the client.
  </p></li><li class="listitem"><p>The <span class="emphasis"><em>
changedGroups</em></span>
 field of the event contains at least one group, and the <span class="emphasis"><em>
XkbGroupCompatMask</em></span>
 bit is set in the appropriate event details mask for the client.
  </p></li></ul></div></div><div class="sect2" title="Tracking Application Bell Requests"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Application_Bell_Requests"></a>Tracking Application Bell Requests</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbBellNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
bellClass: { KbdFeedbackClass, BellFeedbackClass }</td></tr><tr><td class="protoname" align="left">
bellID: CARD8</td></tr><tr><td class="protoname" align="left">
percent: CARD8</td></tr><tr><td class="protoname" align="left">
pitch: CARD16</td></tr><tr><td class="protoname" align="left">
duration: CARD16</td></tr><tr><td class="protoname" align="left">
eventOnly: BOOL</td></tr><tr><td class="protoname" align="left">
name: ATOM</td></tr><tr><td class="protoname" align="left">
window: WINDOW</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbBellNotify</em></span>
 event indicates that some client has requested a keyboard bell. Bell notify
events are usually caused by <span class="emphasis"><em>
Bell</em></span>
, <span class="emphasis"><em>
DeviceBell</em></span>
, or <span class="emphasis"><em>
XkbBell</em></span>
 requests, but they can also be generated by the server (e.g. if the <span class="emphasis"><em>
AccessXFeedback</em></span>
 control is active).
</p><p>
The server sends an <span class="emphasis"><em>
XkbBellNotify</em></span>
 event to a client if the appropriate event details field for the client has
the value <span class="emphasis"><em>
True</em></span>
.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field specifies the device for which a bell was requested, while the <span class="emphasis"><em>
bellClass</em></span>
 and <span class="emphasis"><em>
bellID</em></span>
 fields specify the input extension class and identifier of the feedback for
which the bell was requested. If the reporting server does not support the
input extension, all three fields have the value 0.
</p><p>
The <span class="emphasis"><em>
percent</em></span>
, <span class="emphasis"><em>
pitch</em></span>
 and <span class="emphasis"><em>
duration</em></span>
 fields report the volume, tone and duration requested for the bell as
specified by the <span class="emphasis"><em>
XkbBell</em></span>
 request. Bell notify events caused by core protocol or input extension
requests use the pitch and duration specified in the corresponding bell or
keyboard feedback control.
</p><p>
If the bell was caused by an <span class="emphasis"><em>
XkbBell</em></span>
 request or by the X server, <span class="emphasis"><em>
name</em></span>
 reports an optional symbolic name for the bell and the <span class="emphasis"><em>
window</em></span>
 field optionally reports the window for which the bell was generated.
Otherwise, both fields have the value <span class="emphasis"><em>
None</em></span>
.
</p><p>
If the <span class="emphasis"><em>
eventOnly</em></span>
 field is <span class="emphasis"><em>
True</em></span>
, the server did not generate a sound in response to the request, otherwise the
server issues the beep before sending the event. The eventOnly field can be
<span class="emphasis"><em>
True</em></span>
 if the <span class="emphasis"><em>
AudibleBell</em></span>
 control is disabled or if a client explicitly requests <span class="emphasis"><em>
eventOnly</em></span>
 when it issues an <span class="emphasis"><em>
XkbBell</em></span>
 request.
</p></div><div class="sect2" title="Tracking Messages Generated by Key Actions"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Messages_Generated_by_Key_Actions"></a>Tracking Messages Generated by Key Actions</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbActionMessage</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
keycode: KEYCODE</td></tr><tr><td class="protoname" align="left">
press: BOOL</td></tr><tr><td class="protoname" align="left">
mods: KEYMASK</td></tr><tr><td class="protoname" align="left">
group: KB_GROUP</td></tr><tr><td class="protoname" align="left">
keyEventFollows: BOOL</td></tr><tr><td class="protoname" align="left">
message: LISTofCARD8</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbActionMessage</em></span>
 event is generated when the user operates a key to which an <span class="emphasis"><em>
SA_ActionMessage</em></span>
 message is bound under the appropriate state and group. The server sends an
<span class="emphasis"><em>
XkbActionMessage</em></span>
 event to a client if the appropriate event details field for the client has
the value <span class="emphasis"><em>
True</em></span>
.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field specifies the keyboard device that contains the key which activated the
event. The <span class="emphasis"><em>
keycode</em></span>
 field specifies the key whose operation caused the message and press is
<span class="emphasis"><em>
True</em></span>
 if the message was caused by the user pressing the key. The <span class="emphasis"><em>
mods</em></span>
 and <span class="emphasis"><em>
group</em></span>
 fields report the effective keyboard modifiers and group in effect at the time
the key was pressed or released.
</p><p>
If <span class="emphasis"><em>
keyEventFollows</em></span>
 is <span class="emphasis"><em>
True</em></span>
, the server will also send a key press or release event, as appropriate, for
the key that generated the message. If it is <span class="emphasis"><em>
False</em></span>
, the key causes only a message. Note that the key event is delivered normally
with respect to passive grabs, keyboard focus, and cursor position, so that
<span class="emphasis"><em>
keyEventFollows</em></span>
 does not guarantee that any particular client which receives the <span class="emphasis"><em>
XkbActionMessage</em></span>
 notify event will also receive a key press or release event.
</p><p>
The <span class="emphasis"><em>
message</em></span>
 field is <span class="emphasis"><em>
NULL</em></span>
-terminated string of up to <span class="emphasis"><em>
ActionMessageLength</em></span>
 (<span class="emphasis"><em>
6</em></span>
) bytes, which reports the contents of the <span class="emphasis"><em>
message</em></span>
 field in the action that caused the message notify event.
</p></div><div class="sect2" title="Tracking Changes to AccessX State and Keys"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Changes_to_AccessX_State_and_Keys"></a>Tracking Changes to AccessX State and Keys</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbAccessXNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD8</td></tr><tr><td class="protoname" align="left">
detail: KB_AXNDETAILMASK</td></tr><tr><td class="protoname" align="left">
keycode: KEYCODE</td></tr><tr><td class="protoname" align="left">
slowKeysDelay: CARD16</td></tr><tr><td class="protoname" align="left">
debounceDelay: CARD16</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbAccessXNotify</em></span>
 event reports on some kinds of keyboard activity when any of the <span class="emphasis"><em>
SlowKeys</em></span>
, <span class="emphasis"><em>
BounceKeys</em></span>
 or <span class="emphasis"><em>
AccessXKeys</em></span>
 controls are active. Compatibility map notify events can only be caused by
keyboard activity.
</p><p>
The <span class="emphasis"><em>
deviceID</em></span>
 and <span class="emphasis"><em>
keycode</em></span>
 fields specify the keyboard and key for which the event occurred. The
<span class="emphasis"><em>
detail</em></span>
 field describes the event that occurred and has one of the following values:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></colgroup><thead><tr><th align="left">Detail</th><th align="left">Control</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>
AXN_SKPress</em></span>
</td><td align="left"><span class="emphasis"><em>
SlowKeys</em></span>
</td><td align="left">Key pressed</td></tr><tr><td align="left"><span class="emphasis"><em>
AXN_SKAccept</em></span>
</td><td align="left"><span class="emphasis"><em>
SlowKeys</em></span>
</td><td align="left"><span class="emphasis"><em>
K</em></span>
ey held until it was accepted.</td></tr><tr><td align="left"><span class="emphasis"><em>
AXN_SKReject</em></span>
</td><td align="left"><span class="emphasis"><em>
SlowKeys</em></span>
</td><td align="left">Key released before it was accepted.</td></tr><tr><td align="left"><span class="emphasis"><em>
AXN_SKRelease</em></span>
</td><td align="left"><span class="emphasis"><em>
SlowKeys</em></span>
</td><td align="left">Key released after it was accepted.</td></tr><tr><td align="left"><span class="emphasis"><em>
AXN_BKAccept</em></span>
</td><td align="left"><span class="emphasis"><em>
BounceKeys</em></span>
</td><td align="left">Key pressed while it was active.</td></tr><tr><td align="left"><span class="emphasis"><em>
AXN_BKReject</em></span>
</td><td align="left"><span class="emphasis"><em>
BounceKeys</em></span>
</td><td align="left">Key pressed while it was still disabled.</td></tr><tr><td align="left"><span class="emphasis"><em>
AXN_AXKWarning</em></span>
</td><td align="left"><span class="emphasis"><em>
AccessXKeys</em></span>
</td><td align="left">Shift key held down for four seconds</td></tr></tbody></table></div><p>
Each subclass of the AccessX notify event is generated only when the control
specified in the table above is enabled. The server sends an <span class="emphasis"><em>
XkbAccessXNotify</em></span>
 event to a client only if the bit which corresponds to the value of the
<span class="emphasis"><em>
detail</em></span>
 field for the event is set in the appropriate event details mask for the
client.
</p><p>
Regardless of the value of <span class="emphasis"><em>
detail</em></span>
, the <span class="emphasis"><em>
slowKeysDelay</em></span>
 and <span class="emphasis"><em>
debounceDelay</em></span>
 fields always reports the current slow keys acceptance delay (see
<a class="link" href="#The_SlowKeys_Control" title="The SlowKeys Control">The SlowKeys Control</a>) and
debounce delay (see <a class="link" href="#The_BounceKeys_Control" title="The BounceKeys Control">The BounceKeys
Control</a>) for the specified keyboard.
</p></div><div class="sect2" title="Tracking Changes To Extension Devices"><div class="titlepage"><div><div><h3 class="title"><a id="Tracking_Changes_To_Extension_Devices"></a>Tracking Changes To Extension Devices</h3></div></div></div><div class="proto"><table border="0"><colgroup><col align="left" class="c1" /></colgroup><thead><tr><th class="protoname" align="left">XkbExtensionDeviceNotify</th></tr></thead><tbody><tr><td class="protoargs" align="left">time: TIMESTAMP</td></tr><tr><td class="protoname" align="left">
deviceID: CARD16</td></tr><tr><td class="protoname" align="left">
ledClass: { KbdFeedbackClass, LedFeedbackClass }</td></tr><tr><td class="protoname" align="left">
ledID: CARD16</td></tr><tr><td class="protoname" align="left">
reason: KB_XIDETAILMASK</td></tr><tr><td class="protoname" align="left">
supported: KB_XIFEATUREMASK</td></tr><tr><td class="protoname" align="left">
unsupported: KB_XIFEATUREMASK</td></tr><tr><td class="protoname" align="left">
ledsDefined: KB_INDICATORMASK</td></tr><tr><td class="protoname" align="left">
ledState: KB_INDICATORMASK</td></tr><tr><td class="protoname" align="left">
firstButton, nButtons: CARD8</td></tr></tbody></table></div><p>
An <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event reports:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A change to some part of the XKB information for an extension device.
  </p></li><li class="listitem"><p>An attempt to use an XKB extension device feature that is not supported
for the specified device by the current implementation.
  </p></li></ul></div><p>
The <span class="emphasis"><em>
deviceID</em></span>
 field specifies the X Input Extension device identifier of some device on
which an XKB feature was requested, or <span class="emphasis"><em>
XkbUseCorePtr</em></span>
 if the request affected the core pointer device. The <span class="emphasis"><em>
reason</em></span>
 field explains why the event was generated in response to the request, and can
contain any combination of <span class="emphasis"><em>
XkbXI_UnsupportedFeature</em></span>
 and the values permitted for the change field of the <span class="emphasis"><em>
XkbSetDeviceInfo</em></span>
 request.
</p><p>
If <span class="emphasis"><em>
XkbXI_ButtonActions</em></span>
 is set in <span class="emphasis"><em>
reason</em></span>
, this event reports a successful change to the XKB actions bound to one or
more buttons on the core pointer or an extension device. The <span class="emphasis"><em>
firstButton</em></span>
 and <span class="emphasis"><em>
nButtons</em></span>
 fields report a range of device buttons that include all of the buttons for
which actions were changed.
</p><p>
If any combination of <span class="emphasis"><em>
XkbXI_IndicatorNames</em></span>
, <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
, or <span class="emphasis"><em>
XkbXI_IndicatorState</em></span>
 is set in either <span class="emphasis"><em>
reason</em></span>
 or <span class="emphasis"><em>
unsupported</em></span>
, the <span class="emphasis"><em>
ledClass</em></span>
 and <span class="emphasis"><em>
ledID</em></span>
 fields specify the X Input Extension feedback class and identifier of the
feedback for which the change is reported. If this event reports any changes to
an indicator feedback, the <span class="emphasis"><em>
ledsDefined</em></span>
 field reports all indicators on that feedback for which either a name or a
indicator map are defined, and <span class="emphasis"><em>
ledState</em></span>
 reports the current state of all of the indicators on the specified feedback.
</p><p>
If <span class="emphasis"><em>
XkbXI_IndicatorNames</em></span>
 is set in <span class="emphasis"><em>
reason</em></span>
, this event reports a successful change to the symbolic names bound to one or
more extension device indicators by XKB. If <span class="emphasis"><em>
XkbXI_IndicatorMaps</em></span>
 is set in <span class="emphasis"><em>
reason</em></span>
, this event reports a successful change to the indicator maps bound to one or
more extension device indicators by XKB. If <span class="emphasis"><em>
XkbXI_IndicatorState</em></span>
 is set in reason, this event reports that one or more indicators in the
specified device and feedback have changed state.
</p><p>
If <span class="emphasis"><em>
XkbXI_UnsupportedFeature</em></span>
 is set in reason, this event reports an unsuccessful attempt to use some XKB
extension device feature that is not supported by the XKB implementation in the
server for the specified device. The <span class="emphasis"><em>
unsupported</em></span>
 mask reports the requested features that are not available on the specified
device. See <a class="link" href="#Interactions_Between_XKB_and_the_X_Input_Extension" title="Chapter 15. Interactions Between XKB and the X Input Extension">Interactions Between
XKB and the X Input Extension</a> for more information about possible XKB
interactions with the X Input Extension.
</p><p>
The server sends an <span class="emphasis"><em>
XkbExtensionDeviceNotify</em></span>
 event to a client only if at least one of the bits that is set in the
<span class="emphasis"><em>
reason</em></span>
 field of the event is also set in the appropriate event details mask for the
client.
</p><p>
Events that report a successful change to some extension device feature are
reported to all clients that have expressed interest in the event; events that
report an attempt to use an unsupported feature are reported only to the client
which issued the request. Events which report a partial success are reported to
all interested clients, but only the client that issued the request is informed
of the attempt to use unsupported features.
</p></div></div></div><div class="appendix" title="Appendix A. Default Symbol Transformations"><div class="titlepage"><div><div><h2 class="title"><a id="default_symbol_transformations"></a>Appendix A. Default Symbol Transformations</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Interpreting_the_Control_Modifier">Interpreting the Control Modifier</a></span></dt><dt><span class="sect1"><a href="#Interpreting_the_Lock_Modifier">Interpreting the Lock Modifier</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Locale_Sensitive_Capitalization">Locale-Sensitive Capitalization</a></span></dt><dt><span class="sect2"><a href="#Locale_Insensitive_Capitalization">Locale-Insensitive Capitalization</a></span></dt></dl></dd></dl></div><div class="sect1" title="Interpreting the Control Modifier"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Interpreting_the_Control_Modifier"></a>Interpreting the Control Modifier</h2></div></div></div><p>
If the <span class="emphasis"><em>
Control</em></span>
 modifier is not consumed by the symbol lookup process, routines that determine
the symbol and string that correspond to an event should convert the symbol to
a string as defined in the table below. Only the string to be returned is
affected by the <span class="emphasis"><em>
Control</em></span>
 modifier; the symbol is not changed.
</p><p>
This table lists the decimal value of the standard control characters that
correspond to some keysyms for ASCII characters. Control characters for symbols
not listed in this table are application-specific.
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /><col align="left" class="c7" /><col align="left" class="c8" /></colgroup><thead><tr><th align="left">Keysyms</th><th align="left">Value</th><th align="left">Keysyms</th><th align="left">Value</th><th align="left">Keysyms</th><th align="left">Value</th><th align="left">Keysyms</th><th align="left">Value</th></tr></thead><tbody><tr><td align="left">atsign</td><td align="left">0</td><td align="left">h, H</td><td align="left">8</td><td align="left">p, P</td><td align="left">16</td><td align="left">x, X</td><td align="left">24</td></tr><tr><td align="left">a, A</td><td align="left">1</td><td align="left">i, I</td><td align="left">9</td><td align="left">q, Q</td><td align="left">17</td><td align="left">y, Y</td><td align="left">25</td></tr><tr><td align="left">b, B</td><td align="left">2</td><td align="left">j, J</td><td align="left">10</td><td align="left">r, R</td><td align="left">18</td><td align="left">z, Z</td><td align="left">26</td></tr><tr><td align="left">c, C</td><td align="left">3</td><td align="left">k, K</td><td align="left">11</td><td align="left">s, S</td><td align="left">19</td><td align="left">left_bracket</td><td align="left">27</td></tr><tr><td align="left">d, D</td><td align="left">4</td><td align="left">l, L</td><td align="left">12</td><td align="left">t, T</td><td align="left">20</td><td align="left">backslash</td><td align="left">28</td></tr><tr><td align="left">e, E</td><td align="left">5</td><td align="left">m, M</td><td align="left">13</td><td align="left">u, U</td><td align="left">21</td><td align="left">right_bracket</td><td align="left">29</td></tr><tr><td align="left">f, F</td><td align="left">6</td><td align="left">n, N</td><td align="left">14</td><td align="left">v, V</td><td align="left">22</td><td align="left">asciicircum</td><td align="left">30</td></tr><tr><td align="left">g, G</td><td align="left">8</td><td align="left">o, O</td><td align="left">15</td><td align="left">w, W</td><td align="left">23</td><td align="left">underbar</td><td align="left">31</td></tr></tbody></table></div></div><div class="sect1" title="Interpreting the Lock Modifier"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Interpreting_the_Lock_Modifier"></a>Interpreting the Lock Modifier</h2></div></div></div><p>
If the <span class="emphasis"><em>
Lock</em></span>
 modifier is not consumed by the symbol lookup process, routines that determine
the symbol and string that correspond to an event should capitalize the result.
Unlike the transformation for <span class="emphasis"><em>
Control</em></span>
, the capitalization transformation changes both the symbol and the string
returned by the event.
</p><div class="sect2" title="Locale-Sensitive Capitalization"><div class="titlepage"><div><div><h3 class="title"><a id="Locale_Sensitive_Capitalization"></a>Locale-Sensitive Capitalization</h3></div></div></div><p>
If <span class="emphasis"><em>
Lock</em></span>
 is set in an event and not consumed, applications should capitalize the string
and symbols that result from an event according to the capitalization rules in
effect for the system on which the application is running, taking the current
state of the user environment (e.g. locale) into account.
</p></div><div class="sect2" title="Locale-Insensitive Capitalization"><div class="titlepage"><div><div><h3 class="title"><a id="Locale_Insensitive_Capitalization"></a>Locale-Insensitive Capitalization</h3></div></div></div><p>
XKB recommends but does not require locale-sensitive capitalization. In cases
where the locale is unknown or where locale-sensitive capitalization is
prohibitively expensive, applications can capitalize according to the rules
defined in this extension.
</p><p>
The following tables list all of the keysyms for which XKB defines
capitalization behavior. Any keysyms not explicitly listed in these tables are
not capitalized by XKB when locale-insensitive capitalization is in effect and
are not automatically assigned the <span class="emphasis"><em>
ALPHABETIC</em></span>
 type as described in the <a class="link" href="#The_ALPHABETIC_Key_Type" title="The ALPHABETIC Key Type">Alphabetic Key Type</a>.
</p><div class="sect3" title="Capitalization Rules for Latin-1 Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Latin_1_Keysyms"></a>Capitalization Rules for Latin-1 Keysyms</h4></div></div></div><p>
This table lists the Latin-11 keysyms for which XKB defines upper and lower
case:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /><col align="left" class="c7" /><col align="left" class="c8" /></colgroup><thead><tr><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th></tr></thead><tbody><tr><td align="left">a</td><td align="left">A</td><td align="left">o</td><td align="left">O</td><td align="left">acircumflex</td><td align="left">Acircumflex</td><td align="left">eth</td><td align="left">ETH</td></tr><tr><td align="left">b</td><td align="left">B</td><td align="left">p</td><td align="left">P</td><td align="left">adiaeresis</td><td align="left">Adiaeresis</td><td align="left">ntilde</td><td align="left">Ntilde</td></tr><tr><td align="left">c</td><td align="left">C</td><td align="left">q</td><td align="left">Q</td><td align="left">atilde</td><td align="left">Atilde</td><td align="left">ograve</td><td align="left">Ograve</td></tr><tr><td align="left">d</td><td align="left">D</td><td align="left">r</td><td align="left">R</td><td align="left">aring</td><td align="left">Aring</td><td align="left">oacute</td><td align="left">Oacute</td></tr><tr><td align="left">e</td><td align="left">E</td><td align="left">s</td><td align="left">S</td><td align="left">ae</td><td align="left">AE</td><td align="left">ocircumflex</td><td align="left">Ocircumflex</td></tr><tr><td align="left">f</td><td align="left">F</td><td align="left">t</td><td align="left">T</td><td align="left">ccedilla</td><td align="left">Ccedilla</td><td align="left">otilde</td><td align="left">Otilde</td></tr><tr><td align="left">g</td><td align="left">G</td><td align="left">u</td><td align="left">U</td><td align="left">egrave</td><td align="left">Egrave</td><td align="left">odiaeresis</td><td align="left">Odiaeresis</td></tr><tr><td align="left">h</td><td align="left">H</td><td align="left">v</td><td align="left">V</td><td align="left">eacute</td><td align="left">Eacute</td><td align="left">oslash</td><td align="left">Ooblique</td></tr><tr><td align="left">i</td><td align="left">I</td><td align="left">w</td><td align="left">W</td><td align="left">ecircumflex</td><td align="left">Ecircumflex</td><td align="left">ugrave</td><td align="left">Ugrave</td></tr><tr><td align="left">j</td><td align="left">J</td><td align="left">x</td><td align="left">X</td><td align="left">ediaeresis</td><td align="left">Ediaeresis</td><td align="left">uacute</td><td align="left">Uacute</td></tr><tr><td align="left">k</td><td align="left">K</td><td align="left">y</td><td align="left">Y</td><td align="left">igrave</td><td align="left">Igrave</td><td align="left">ucircumflex</td><td align="left">Ucircumflex</td></tr><tr><td align="left">l</td><td align="left">L</td><td align="left">z</td><td align="left">Z</td><td align="left">iacute</td><td align="left">Iacute</td><td align="left">udiaeresis</td><td align="left">Udiaeresis</td></tr><tr><td align="left">m</td><td align="left">M</td><td align="left">agrave</td><td align="left">Agrave</td><td align="left">icircumflex</td><td align="left">Icircumflex</td><td align="left">yacute</td><td align="left">Yacute</td></tr><tr><td align="left">n</td><td align="left">N</td><td align="left">aacute</td><td align="left">Aacute</td><td align="left">idiaeresis</td><td align="left">Idiaeresis</td><td align="left">thorn</td><td align="left">THORN</td></tr></tbody></table></div></div><div class="sect3" title="Capitalization Rules for Latin-2 Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Latin_2_Keysyms"></a>Capitalization Rules for Latin-2 Keysyms</h4></div></div></div><p>
This table lists the Latin-2 keysyms for which XKB defines upper and lower case:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /></colgroup><thead><tr><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th></tr></thead><tbody><tr><td align="left">aogonek</td><td align="left">Aogonek</td><td align="left">zabovedot</td><td align="left">Zabovedot</td><td align="left">dstroke</td><td align="left">Dstroke</td></tr><tr><td align="left">lstroke</td><td align="left">Lstroke</td><td align="left">racute</td><td align="left">Racute</td><td align="left">nacute</td><td align="left">Nacute</td></tr><tr><td align="left">lcaron</td><td align="left">Lcaron</td><td align="left">abreve</td><td align="left">Abreve</td><td align="left">ncaron</td><td align="left">Ncaron</td></tr><tr><td align="left">sacute</td><td align="left">Sacute</td><td align="left">lacute</td><td align="left">Lacute</td><td align="left">odoubleacute</td><td align="left">Odoubleacute</td></tr><tr><td align="left">scaron</td><td align="left">Scaron</td><td align="left">cacute</td><td align="left">Cacute</td><td align="left">rcaron</td><td align="left">Rcaron</td></tr><tr><td align="left">scedilla</td><td align="left">Scedilla</td><td align="left">ccaron</td><td align="left">Ccaron</td><td align="left">uabovering</td><td align="left">Uabovering</td></tr><tr><td align="left">tcaron</td><td align="left">Tcaron</td><td align="left">eogonek</td><td align="left">Eogonek</td><td align="left">udoubleacute</td><td align="left">Udoubleacute</td></tr><tr><td align="left">zacute</td><td align="left">Zacute</td><td align="left">ecaron</td><td align="left">Ecaron</td><td align="left">tcedilla</td><td align="left">Tcedilla</td></tr><tr><td align="left">zcaron</td><td align="left">Zcaron</td><td align="left">dcaron</td><td align="left">Dcaron</td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><div class="sect3" title="Capitalization Rules for Latin-3 Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Latin_3_Keysyms"></a>Capitalization Rules for Latin-3 Keysyms</h4></div></div></div><p>
This table lists the Latin-3 keysyms for which XKB defines upper and lower case:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /></colgroup><thead><tr><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th></tr></thead><tbody><tr><td align="left">hstroke</td><td align="left">Hstroke</td><td align="left">jcircumflex</td><td align="left">Jcircumflex</td><td align="left">gcircumflex</td><td align="left">Gcircumflex</td></tr><tr><td align="left">hcircumflex</td><td align="left">Hcircumflex</td><td align="left">cabovedot</td><td align="left">Cabovedot</td><td align="left">ubreve</td><td align="left">Ubreve</td></tr><tr><td align="left">idotless</td><td align="left">Iabovedot</td><td align="left">ccircumflex</td><td align="left">Ccircumflex</td><td align="left">scircumflex</td><td align="left">Scircumflex</td></tr><tr><td align="left">gbreve</td><td align="left">Gbreve</td><td align="left">gabovedot</td><td align="left">Gabovedot</td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><div class="sect3" title="Capitalization Rules for Latin-4 Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Latin_4_Keysyms"></a>Capitalization Rules for Latin-4 Keysyms</h4></div></div></div><p>
This table lists the Latin-4 keysyms for which XKB defines upper and lower case:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /></colgroup><thead><tr><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th></tr></thead><tbody><tr><td align="left">rcedilla</td><td align="left">Rcedilla</td><td align="left">eng</td><td align="left">ENG</td><td align="left">omacron</td><td align="left">Omacron</td></tr><tr><td align="left">itilde</td><td align="left">Itilde</td><td align="left">amacron</td><td align="left">Amacron</td><td align="left">kcedilla</td><td align="left">Kcedilla</td></tr><tr><td align="left">lcedilla</td><td align="left">Lcedilla</td><td align="left">iogonek</td><td align="left">Iogonek</td><td align="left">uogonek</td><td align="left">Uogonek</td></tr><tr><td align="left">emacron</td><td align="left">Emacron</td><td align="left">eabovedot</td><td align="left">eabovedot</td><td align="left">utilde</td><td align="left">Utilde</td></tr><tr><td align="left">gcedilla</td><td align="left">Gcedilla</td><td align="left">imacron</td><td align="left">Imacron</td><td align="left">umacron</td><td align="left">Umacron</td></tr><tr><td align="left">tslash</td><td align="left">Tslash</td><td align="left">ncedilla</td><td align="left">Ncedilla</td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><div class="sect3" title="Capitalization Rules for Cyrillic Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Cyrillic_Keysyms"></a>Capitalization Rules for Cyrillic Keysyms</h4></div></div></div><p>
This table lists the Cyrillic keysyms for which XKB defines upper and lower
case:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th></tr></thead><tbody><tr><td align="left">Serbian_dje</td><td align="left">Serbian_DJE</td><td align="left">Cyrillic_i</td><td align="left">Cyrillic_I</td></tr><tr><td align="left">Macedonia_gje</td><td align="left">Macedonia_GJE</td><td align="left">Cyrillic_shorti</td><td align="left">Cyrillic_SHORTI</td></tr><tr><td align="left">Cyrillic_io</td><td align="left">Cyrillic_IO</td><td align="left">Cyrillic_ka</td><td align="left">Cyrillic_KA</td></tr><tr><td align="left">Ukrainian_ie</td><td align="left">Ukrainian_IE</td><td align="left">Cyrillic_el</td><td align="left">Cyrillic_EL</td></tr><tr><td align="left">Macedonia_dse</td><td align="left">Macedonia_DSE</td><td align="left">Cyrillic_em</td><td align="left">Cyrillic_EM</td></tr><tr><td align="left">Ukrainian_i</td><td align="left">Ukrainian_I</td><td align="left">Cyrillic_en</td><td align="left">Cyrillic_EN</td></tr><tr><td align="left">Ukrainian_yi</td><td align="left">Ukrainian_YI</td><td align="left">Cyrillic_o</td><td align="left">Cyrillic_O</td></tr><tr><td align="left">Cyrillic_je</td><td align="left">Cyrillic_JE</td><td align="left">Cyrillic_pe</td><td align="left">Cyrillic_PE</td></tr><tr><td align="left">Cyrillic_lje</td><td align="left">Cyrillic_LJE</td><td align="left">Cyrillic_ya</td><td align="left">Cyrillic_YA</td></tr><tr><td align="left">Cyrillic_nje</td><td align="left">Cyrillic_NJE</td><td align="left">Cyrillic_er</td><td align="left">Cyrillic_ER</td></tr><tr><td align="left">Serbian_tshe</td><td align="left">Serbian_TSHE</td><td align="left">Cyrillic_es</td><td align="left">Cyrillic_ES</td></tr><tr><td align="left">Macedonia_kje</td><td align="left">Macedonia_KJE</td><td align="left">Cyrillic_te</td><td align="left">Cyrillic_TE</td></tr><tr><td align="left">Byelorussian_shortu</td><td align="left">Byelorussian_SHORTU</td><td align="left">Cyrillic_u</td><td align="left">Cyrillic_U</td></tr><tr><td align="left">Cyrillic_dzhe</td><td align="left">Cyrillic_DZHE</td><td align="left">Cyrillic_zhe</td><td align="left">Cyrillic_ZHE</td></tr><tr><td align="left">Cyrillic_yu</td><td align="left">Cyrillic_YU</td><td align="left">Cyrillic_ve</td><td align="left">Cyrillic_VE</td></tr><tr><td align="left">Cyrillic_a</td><td align="left">Cyrillic_A</td><td align="left">Cyrillic_softsign</td><td align="left">Cyrillic_SOFTSIGN</td></tr><tr><td align="left">Cyrillic_be</td><td align="left">Cyrillic_BE</td><td align="left">Cyrillic_yeru</td><td align="left">Cyrillic_YERU</td></tr><tr><td align="left">Cyrillic_tse</td><td align="left">Cyrillic_TSE</td><td align="left">Cyrillic_ze</td><td align="left">Cyrillic_ZE</td></tr><tr><td align="left">Cyrillic_de</td><td align="left">Cyrillic_DE</td><td align="left">Cyrillic_sha</td><td align="left">Cyrillic_SHA</td></tr><tr><td align="left">Cyrillic_ie</td><td align="left">Cyrillic_IE</td><td align="left">Cyrillic_e</td><td align="left">Cyrillic_E</td></tr><tr><td align="left">Cyrillic_ef</td><td align="left">Cyrillic_EF</td><td align="left">Cyrillic_shcha</td><td align="left">Cyrillic_SHCHA</td></tr><tr><td align="left">Cyrillic_ghe</td><td align="left">Cyrillic_GHE</td><td align="left">Cyrillic_che</td><td align="left">Cyrillic_CHE</td></tr><tr><td align="left">Cyrillic_ha</td><td align="left">Cyrillic_HA</td><td align="left">Cyrillic_hardsign</td><td align="left">Cyrillic_HARDSIGN</td></tr></tbody></table></div></div><div class="sect3" title="Capitalization Rules for Greek Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Greek_Keysyms"></a>Capitalization Rules for Greek Keysyms</h4></div></div></div><p>
This table lists the Greek keysyms for which XKB defines upper and lower case:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Lower Case</th><th align="left">Upper Case</th><th align="left">Lower Case</th><th align="left">Upper Case</th></tr></thead><tbody><tr><td align="left">Greek_omegaaccent</td><td align="left">Greek_OMEGAACCENT</td><td align="left">Greek_iota</td><td align="left">Greek_IOTA</td></tr><tr><td align="left">Greek_alphaaccent</td><td align="left">Greek_ALPHAACCENT</td><td align="left">Greek_kappa</td><td align="left">Greek_KAPPA</td></tr><tr><td align="left">Greek_epsilonaccent</td><td align="left">Greek_EPSILONACCENT</td><td align="left">Greek_lamda</td><td align="left">Greek_LAMDA</td></tr><tr><td align="left">Greek_etaaccent</td><td align="left">Greek_ETAACCENT</td><td align="left">Greek_lambda</td><td align="left">Greek_LAMBDA</td></tr><tr><td align="left">Greek_iotaaccent</td><td align="left">Greek_IOTAACCENT</td><td align="left">Greek_mu</td><td align="left">Greek_MU</td></tr><tr><td align="left">Greek_iotadieresis</td><td align="left">Greek_IOTADIERESIS</td><td align="left">Greek_nu</td><td align="left">Greek_NU</td></tr><tr><td align="left">Greek_omicronaccent</td><td align="left">Greek_OMICRONACCENT</td><td align="left">Greek_xi</td><td align="left">Greek_XI</td></tr><tr><td align="left">Greek_upsilonaccent</td><td align="left">Greek_UPSILONACCENT</td><td align="left">Greek_omicron</td><td align="left">Greek_OMICRON</td></tr><tr><td align="left">Greek_upsilondieresis</td><td align="left">Greek_UPSILONDIERESIS</td><td align="left">Greek_pi</td><td align="left">Greek_PI</td></tr><tr><td align="left">Greek_alpha</td><td align="left">Greek_ALPHA</td><td align="left">Greek_rho</td><td align="left">Greek_RHO</td></tr><tr><td align="left">Greek_beta</td><td align="left">Greek_BETA</td><td align="left">Greek_sigma</td><td align="left">Greek_SIGMA</td></tr><tr><td align="left">Greek_gamma</td><td align="left">Greek_GAMMA</td><td align="left">Greek_tau</td><td align="left">Greek_TAU</td></tr><tr><td align="left">Greek_delta</td><td align="left">Greek_DELTA</td><td align="left">Greek_upsilon</td><td align="left">Greek_UPSILON</td></tr><tr><td align="left">Greek_epsilon</td><td align="left">Greek_EPSILON</td><td align="left">Greek_phi</td><td align="left">Greek_PHI</td></tr><tr><td align="left">Greek_zeta</td><td align="left">Greek_ZETA</td><td align="left">Greek_chi</td><td align="left">Greek_CHI</td></tr><tr><td align="left">Greek_eta</td><td align="left">Greek_ETA</td><td align="left">Greek_psi</td><td align="left">Greek_PSI</td></tr><tr><td align="left">Greek_theta</td><td align="left">Greek_THETA</td><td align="left">Greek_omega</td><td align="left">Greek_OMEGA</td></tr></tbody></table></div></div><div class="sect3" title="Capitalization Rules for Other Keysyms"><div class="titlepage"><div><div><h4 class="title"><a id="Capitalization_Rules_for_Other_Keysyms"></a>Capitalization Rules for Other Keysyms</h4></div></div></div><p>
XKB defines no capitalization rules for symbols in any other set of keysyms
provided by the consortium. Applications are free to apply additional rules for
private keysyms or for other keysyms not covered by XKB.
</p></div></div></div></div><div class="appendix" title="Appendix B. Canonical Key Types"><div class="titlepage"><div><div><h2 class="title"><a id="canonical_key_types"></a>Appendix B. Canonical Key Types</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Canonical_Key_Types">Canonical Key Types</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_ONE_LEVEL_Key_Type">The ONE_LEVEL Key Type</a></span></dt><dt><span class="sect2"><a href="#The_TWO_LEVEL_Key_Type">The TWO_LEVEL Key Type</a></span></dt><dt><span class="sect2"><a href="#The_ALPHABETIC_Key_Type">The ALPHABETIC Key Type</a></span></dt><dt><span class="sect2"><a href="#The_KEYPAD_Key_Type">The KEYPAD Key Type</a></span></dt></dl></dd></dl></div><div class="sect1" title="Canonical Key Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Canonical_Key_Types"></a>Canonical Key Types</h2></div></div></div><div class="sect2" title="The ONE_LEVEL Key Type"><div class="titlepage"><div><div><h3 class="title"><a id="The_ONE_LEVEL_Key_Type"></a>The ONE_LEVEL Key Type</h3></div></div></div><p>
The <span class="emphasis"><em>
ONE_LEVEL</em></span>
 key type describes groups that have only one symbol. The default <span class="emphasis"><em>
ONE_LEVEL</em></span>
 type has no map entries and does not pay attention to any modifiers.
</p></div><div class="sect2" title="The TWO_LEVEL Key Type"><div class="titlepage"><div><div><h3 class="title"><a id="The_TWO_LEVEL_Key_Type"></a>The TWO_LEVEL Key Type</h3></div></div></div><p>
The <span class="emphasis"><em>
TWO_LEVEL</em></span>
 key type describes groups that have two symbols but are neither alphabetic nor
numeric keypad keys. The default <span class="emphasis"><em>
TWO_LEVEL</em></span>
 type uses only the <span class="emphasis"><em>
Shift</em></span>
 modifier. It returns level two if <span class="emphasis"><em>
Shift</em></span>
 is set, level one if it is not.
</p></div><div class="sect2" title="The ALPHABETIC Key Type"><div class="titlepage"><div><div><h3 class="title"><a id="The_ALPHABETIC_Key_Type"></a>The ALPHABETIC Key Type</h3></div></div></div><p>
The <span class="emphasis"><em>
ALPHABETIC</em></span>
 key type describes groups that consist of two symbols — the lowercase form
of a symbol followed by the uppercase form of the same symbol. The default
<span class="emphasis"><em>
ALPHABETIC</em></span>
 type implements locale-sensitive "shift cancels caps lock" behavior using both
the <span class="emphasis"><em>
Shift</em></span>
 and <span class="emphasis"><em>
Lock</em></span>
 modifiers as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
Shift</em></span>
 and <span class="emphasis"><em>
Lock</em></span>
 are both set, the default <span class="emphasis"><em>
ALPHABETIC</em></span>
 type yields level one.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
Shift</em></span>
 alone is set, it yields level two.
  </p></li><li class="listitem"><p>If <span class="emphasis"><em>
Lock</em></span>
 alone is set, it yields level one but preserves the <span class="emphasis"><em>
Lock</em></span>
 modifier.
  </p></li><li class="listitem"><p>If neither <span class="emphasis"><em>
Shift</em></span>
 nor <span class="emphasis"><em>
Lock</em></span>
 are set, it yields level one.
  </p></li></ul></div></div><div class="sect2" title="The KEYPAD Key Type"><div class="titlepage"><div><div><h3 class="title"><a id="The_KEYPAD_Key_Type"></a>The KEYPAD Key Type</h3></div></div></div><p>
The <span class="emphasis"><em>
KEYPAD</em></span>
 key type describes that consist of two symbols, at least one of which is a
numeric keypad symbol. The default <span class="emphasis"><em>
KEYPAD</em></span>
 type implements "shift cancels numeric lock" behavior using the <span class="emphasis"><em>
Shift</em></span>
 modifier and the real modifier bound to the virtual modifier named "NumLock"
(the "NumLock" modifier) as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>If <span class="emphasis"><em>
Shift</em></span>
 and the "NumLock" modifier are both set, the default <span class="emphasis"><em>
KEYPAD </em></span>
type yields level one.
  </p></li><li class="listitem"><p>If either <span class="emphasis"><em>
Shift</em></span>
 or the "NumLock" modifier alone are set, it yields level two.
  </p></li><li class="listitem"><p>If neither <span class="emphasis"><em>
Shift</em></span>
 nor the "NumLock" modifier are set, it yields level one.
  </p></li></ul></div></div></div></div><div class="appendix" title="Appendix C. New KeySyms"><div class="titlepage"><div><div><h2 class="title"><a id="new_keysyms"></a>Appendix C. New KeySyms</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#New_KeySyms">New KeySyms</a></span></dt><dd><dl><dt><span class="sect2"><a href="#KeySyms_Used_by_the_ISO9995_Standard">KeySyms Used by the ISO9995 Standard</a></span></dt><dt><span class="sect2"><a href="#KeySyms_Used_to_Control_The_Core_Pointer">KeySyms Used to Control The Core Pointer</a></span></dt><dt><span class="sect2"><a href="#KeySyms_Used_to_Change_Keyboard_Controls">KeySyms Used to Change Keyboard Controls</a></span></dt><dt><span class="sect2"><a href="#KeySyms_Used_To_Control_The_Server">KeySyms Used To Control The Server</a></span></dt><dt><span class="sect2"><a href="#KeySyms_for_Non_Spacing_Diacritical_Keys">KeySyms for Non-Spacing Diacritical Keys</a></span></dt></dl></dd></dl></div><div class="sect1" title="New KeySyms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="New_KeySyms"></a>New KeySyms</h2></div></div></div><div class="sect2" title="KeySyms Used by the ISO9995 Standard"><div class="titlepage"><div><div><h3 class="title"><a id="KeySyms_Used_by_the_ISO9995_Standard"></a>KeySyms Used by the ISO9995 Standard</h3></div></div></div><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Byte 3</th><th align="left">Byte 4</th><th align="left">Character</th><th align="left">Name</th></tr></thead><tbody><tr><td align="left">254</td><td align="left">1</td><td align="left"> </td><td align="left">ISO LOCK</td></tr><tr><td align="left">254</td><td align="left">2</td><td align="left"> </td><td align="left">ISO LATCHING LEVEL TWO SHIFT</td></tr><tr><td align="left">254</td><td align="left">3</td><td align="left"> </td><td align="left">ISO LEVEL THREE SHIFT</td></tr><tr><td align="left">254</td><td align="left">4</td><td align="left"> </td><td align="left">ISO LATCHING LEVEL THREE SHIFT</td></tr><tr><td align="left">254</td><td align="left">5</td><td align="left"> </td><td align="left">ISO LEVEL THREE SHIFT LOCK</td></tr><tr><td align="left">254</td><td align="left">6</td><td align="left"> </td><td align="left">ISO LATCHING GROUP SHIFT</td></tr><tr><td align="left">254</td><td align="left">7</td><td align="left"> </td><td align="left">ISO GROUP SHIFT LOCK</td></tr><tr><td align="left">254</td><td align="left">8</td><td align="left"> </td><td align="left">ISO NEXT GROUP</td></tr><tr><td align="left">254</td><td align="left">9</td><td align="left"> </td><td align="left">ISO LOCK NEXT GROUP</td></tr><tr><td align="left">254</td><td align="left">10</td><td align="left"> </td><td align="left">ISO PREVIOUS GROUP</td></tr><tr><td align="left">254</td><td align="left">11</td><td align="left"> </td><td align="left">ISO LOCK PREVIOUS GROUP</td></tr><tr><td align="left">254</td><td align="left">12</td><td align="left"> </td><td align="left">ISO FIRST GROUP</td></tr><tr><td align="left">254</td><td align="left">13</td><td align="left"> </td><td align="left">ISO LOCK FIRST GROUP</td></tr><tr><td align="left">254</td><td align="left">14</td><td align="left"> </td><td align="left">ISO LAST GROUP</td></tr><tr><td align="left">254</td><td align="left">15</td><td align="left"> </td><td align="left">ISO LOCK LAST GROUP</td></tr><tr><td align="left">254</td><td align="left">32</td><td align="left"> </td><td align="left">LEFT TAB</td></tr><tr><td align="left">254</td><td align="left">33</td><td align="left"> </td><td align="left">MOVE LINE UP</td></tr><tr><td align="left">254</td><td align="left">34</td><td align="left"> </td><td align="left">MOVE LINE DOWN</td></tr><tr><td align="left">254</td><td align="left">35</td><td align="left"> </td><td align="left">PARTIAL LINE UP</td></tr><tr><td align="left">254</td><td align="left">36</td><td align="left"> </td><td align="left">PARTIAL LINE DOWN</td></tr><tr><td align="left">254</td><td align="left">37</td><td align="left"> </td><td align="left">PARTIAL SPACE LEFT</td></tr><tr><td align="left">254</td><td align="left">38</td><td align="left"> </td><td align="left">PARTIAL SPACE RIGHT</td></tr><tr><td align="left">254</td><td align="left">39</td><td align="left"> </td><td align="left">SET MARGIN LEFT</td></tr><tr><td align="left">254</td><td align="left">40</td><td align="left"> </td><td align="left">SET MARGIN RIGHT</td></tr><tr><td align="left">254</td><td align="left">41</td><td align="left"> </td><td align="left">RELEASE MARGIN LEFT</td></tr><tr><td align="left">254</td><td align="left">42</td><td align="left"> </td><td align="left">RELEASE MARGIN RIGHT</td></tr><tr><td align="left">254</td><td align="left">43</td><td align="left"> </td><td align="left">RELEASE MARGIN LEFT AND RIGHT</td></tr><tr><td align="left">254</td><td align="left">44</td><td align="left"> </td><td align="left">FAST CURSOR LEFT</td></tr><tr><td align="left">254</td><td align="left">45</td><td align="left"> </td><td align="left">FAST CURSOR RIGHT</td></tr><tr><td align="left">254</td><td align="left">46</td><td align="left"> </td><td align="left">FAST CURSOR UP</td></tr><tr><td align="left">254</td><td align="left">47</td><td align="left"> </td><td align="left">FAST CURSOR DOWN</td></tr><tr><td align="left">254</td><td align="left">48</td><td align="left"> </td><td align="left">CONTINUOUS UNDERLINE</td></tr><tr><td align="left">254</td><td align="left">49</td><td align="left"> </td><td align="left">DISCONTINUOUS UNDERLINE</td></tr><tr><td align="left">254</td><td align="left">50</td><td align="left"> </td><td align="left">EMPHASIZE</td></tr><tr><td align="left">254</td><td align="left">51</td><td align="left"> </td><td align="left">CENTER OBJECT</td></tr><tr><td align="left">254</td><td align="left">52</td><td align="left"> </td><td align="left">ISO_ENTER</td></tr></tbody></table></div></div><div class="sect2" title="KeySyms Used to Control The Core Pointer"><div class="titlepage"><div><div><h3 class="title"><a id="KeySyms_Used_to_Control_The_Core_Pointer"></a>KeySyms Used to Control The Core Pointer</h3></div></div></div><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Byte 3</th><th align="left">Byte 4</th><th align="left">Character</th><th align="left">Name</th></tr></thead><tbody><tr><td align="left">254</td><td align="left">224</td><td align="left"> </td><td align="left">POINTER LEFT</td></tr><tr><td align="left">254</td><td align="left">225</td><td align="left"> </td><td align="left">POINTER RIGHT</td></tr><tr><td align="left">254</td><td align="left">226</td><td align="left"> </td><td align="left">POINTER UP</td></tr><tr><td align="left">254</td><td align="left">227</td><td align="left"> </td><td align="left">POINTER DOWN</td></tr><tr><td align="left">254</td><td align="left">228</td><td align="left"> </td><td align="left">POINTER UP AND LEFT</td></tr><tr><td align="left">254</td><td align="left">229</td><td align="left"> </td><td align="left">POINTER UP AND RIGHT</td></tr><tr><td align="left">254</td><td align="left">230</td><td align="left"> </td><td align="left">POINTER DOWN AND LEFT</td></tr><tr><td align="left">254</td><td align="left">231</td><td align="left"> </td><td align="left">POINTER DOWN AND RIGHT</td></tr><tr><td align="left">254</td><td align="left">232</td><td align="left"> </td><td align="left">DEFAULT POINTER BUTTON</td></tr><tr><td align="left">254</td><td align="left">233</td><td align="left"> </td><td align="left">POINTER BUTTON ONE</td></tr><tr><td align="left">254</td><td align="left">234</td><td align="left"> </td><td align="left">POINTER BUTTON TWO</td></tr><tr><td align="left">254</td><td align="left">235</td><td align="left"> </td><td align="left">POINTER BUTTON THREE</td></tr><tr><td align="left">254</td><td align="left">236</td><td align="left"> </td><td align="left">POINTER BUTTON FOUR</td></tr><tr><td align="left">254</td><td align="left">237</td><td align="left"> </td><td align="left">POINTER BUTTON FIVE</td></tr><tr><td align="left">254</td><td align="left">238</td><td align="left"> </td><td align="left">DEFAULT POINTER BUTTON DOUBLE CLICK</td></tr><tr><td align="left">254</td><td align="left">239</td><td align="left"> </td><td align="left">POINTER BUTTON ONE DOUBLE CLICK</td></tr><tr><td align="left">254</td><td align="left">240</td><td align="left"> </td><td align="left">POINTER BUTTON TWO DOUBLE CLICK</td></tr><tr><td align="left">254</td><td align="left">241</td><td align="left"> </td><td align="left">POINTER BUTTON THREE DOUBLE CLICK</td></tr><tr><td align="left">254</td><td align="left">242</td><td align="left"> </td><td align="left">POINTER BUTTON FOUR DOUBLE CLICK</td></tr><tr><td align="left">254</td><td align="left">243</td><td align="left"> </td><td align="left">POINTER BUTTON FIVE DOUBLE CLICK</td></tr><tr><td align="left">254</td><td align="left">244</td><td align="left"> </td><td align="left">DRAG DEFAULT POINTER BUTTON</td></tr><tr><td align="left">254</td><td align="left">245</td><td align="left"> </td><td align="left">DRAG POINTER BUTTON ONE</td></tr><tr><td align="left">254</td><td align="left">246</td><td align="left"> </td><td align="left">DRAG POINTER BUTTON TWO</td></tr><tr><td align="left">254</td><td align="left">247</td><td align="left"> </td><td align="left">DRAG POINTER BUTTON THREE</td></tr><tr><td align="left">254</td><td align="left">248</td><td align="left"> </td><td align="left">DRAG POINTER BUTTON FOUR</td></tr><tr><td align="left">254</td><td align="left">249</td><td align="left"> </td><td align="left">ENABLE POINTER FROM KEYBOARD</td></tr><tr><td align="left">254</td><td align="left">250</td><td align="left"> </td><td align="left">ENABLE KEYBOARD POINTER ACCEL</td></tr><tr><td align="left">254</td><td align="left">251</td><td align="left"> </td><td align="left">SET DEFAULT POINTER BUTTON NEXT</td></tr><tr><td align="left">254</td><td align="left">252</td><td align="left"> </td><td align="left">SET DEFAULT POINTER BUTTON PREVIOUS</td></tr><tr><td align="left">254</td><td align="left">253</td><td align="left"> </td><td align="left">DRAG POINTER BUTTON FIVE</td></tr></tbody></table></div></div><div class="sect2" title="KeySyms Used to Change Keyboard Controls"><div class="titlepage"><div><div><h3 class="title"><a id="KeySyms_Used_to_Change_Keyboard_Controls"></a>KeySyms Used to Change Keyboard Controls</h3></div></div></div><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Byte 3</th><th align="left">Byte 4</th><th align="left">Character</th><th align="left">Name</th></tr></thead><tbody><tr><td align="left">254</td><td align="left">112</td><td align="left"> </td><td align="left">ENABLE ACCESSX KEYS</td></tr><tr><td align="left">254</td><td align="left">113</td><td align="left"> </td><td align="left">ENABLE ACCESSX FEEDBACK</td></tr><tr><td align="left">254</td><td align="left">114</td><td align="left"> </td><td align="left">TOGGLE REPEAT KEYS</td></tr><tr><td align="left">254</td><td align="left">115</td><td align="left"> </td><td align="left">TOGGLE SLOW KEYS</td></tr><tr><td align="left">254</td><td align="left">116</td><td align="left"> </td><td align="left">ENABLE BOUNCE KEYS</td></tr><tr><td align="left">254</td><td align="left">117</td><td align="left"> </td><td align="left">ENABLE STICKY KEYS</td></tr><tr><td align="left">254</td><td align="left">118</td><td align="left"> </td><td align="left">ENABLE MOUSE KEYS</td></tr><tr><td align="left">254</td><td align="left">119</td><td align="left"> </td><td align="left">ENABLE MOUSE KEYS ACCELERATION</td></tr><tr><td align="left">254</td><td align="left">120</td><td align="left"> </td><td align="left">ENABLE OVERLAY1</td></tr><tr><td align="left">254</td><td align="left">121</td><td align="left"> </td><td align="left">ENABLE OVERLAY2</td></tr><tr><td align="left">254</td><td align="left">122</td><td align="left"> </td><td align="left">ENABLE AUDIBLE BELL</td></tr></tbody></table></div></div><div class="sect2" title="KeySyms Used To Control The Server"><div class="titlepage"><div><div><h3 class="title"><a id="KeySyms_Used_To_Control_The_Server"></a>KeySyms Used To Control The Server</h3></div></div></div><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Byte</th><th align="left">Byte</th><th align="left">Character</th><th align="left">Name</th></tr></thead><tbody><tr><td align="left">254</td><td align="left">208</td><td align="left"> </td><td align="left">FIRST SCREEN</td></tr><tr><td align="left">254</td><td align="left">209</td><td align="left"> </td><td align="left">PREVIOUS SCREEN</td></tr><tr><td align="left">254</td><td align="left">210</td><td align="left"> </td><td align="left">NEXT SCREEN</td></tr><tr><td align="left">254</td><td align="left">211</td><td align="left"> </td><td align="left">LAST SCREEN</td></tr><tr><td align="left">254</td><td align="left">212</td><td align="left"> </td><td align="left">TERMINATE SERVER</td></tr></tbody></table></div></div><div class="sect2" title="KeySyms for Non-Spacing Diacritical Keys"><div class="titlepage"><div><div><h3 class="title"><a id="KeySyms_for_Non_Spacing_Diacritical_Keys"></a>KeySyms for Non-Spacing Diacritical Keys</h3></div></div></div><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Byte</th><th align="left">Byte</th><th align="left">Character</th><th align="left">Name</th></tr></thead><tbody><tr><td align="left">254</td><td align="left">80</td><td align="left"> </td><td align="left">DEAD GRAVE ACCENT</td></tr><tr><td align="left">254</td><td align="left">81</td><td align="left"> </td><td align="left">DEAD ACUTE ACCENT</td></tr><tr><td align="left">254</td><td align="left">82</td><td align="left"> </td><td align="left">DEAD CIRCUMFLEX</td></tr><tr><td align="left">254</td><td align="left">83</td><td align="left"> </td><td align="left">DEAD TILDE</td></tr><tr><td align="left">254</td><td align="left">84</td><td align="left"> </td><td align="left">DEAD MACRON</td></tr><tr><td align="left">254</td><td align="left">85</td><td align="left"> </td><td align="left">DEAD BREVE</td></tr><tr><td align="left">254</td><td align="left">86</td><td align="left"> </td><td align="left">DEAD DOT ABOVE</td></tr><tr><td align="left">254</td><td align="left">87</td><td align="left"> </td><td align="left">DEAD DIAERESIS</td></tr><tr><td align="left">254</td><td align="left">88</td><td align="left"> </td><td align="left">DEAD RING ABOVE</td></tr><tr><td align="left">254</td><td align="left">89</td><td align="left"> </td><td align="left">DEAD DOUBLE ACUTE ACCENT</td></tr><tr><td align="left">254</td><td align="left">90</td><td align="left"> </td><td align="left">DEAD CARON</td></tr><tr><td align="left">254</td><td align="left">91</td><td align="left"> </td><td align="left">DEAD CEDILLA</td></tr><tr><td align="left">254</td><td align="left">92</td><td align="left"> </td><td align="left">DEAD OGONEK</td></tr><tr><td align="left">254</td><td align="left">93</td><td align="left"> </td><td align="left">DEAD IOTA</td></tr><tr><td align="left">254</td><td align="left">94</td><td align="left"> </td><td align="left">DEAD VOICED SOUND</td></tr><tr><td align="left">254</td><td align="left">95</td><td align="left"> </td><td align="left">DEAD SEMI VOICED SOUND</td></tr><tr><td align="left">254</td><td align="left">96</td><td align="left"> </td><td align="left">DEAD DOT BELOW</td></tr></tbody></table></div></div></div></div><div class="appendix" title="Appendix D. Protocol Encoding"><div class="titlepage"><div><div><h2 class="title"><a id="protocol_encoding"></a>Appendix D. Protocol Encoding</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Syntactic_Conventions">Syntactic Conventions</a></span></dt><dt><span class="sect1"><a href="#appD::Common_Types">Common Types</a></span></dt><dt><span class="sect1"><a href="#appD::Errors">Errors</a></span></dt><dt><span class="sect1"><a href="#appD::Key_Actions">Key Actions</a></span></dt><dt><span class="sect1"><a href="#Key_Behaviors">Key Behaviors</a></span></dt><dt><span class="sect1"><a href="#appD::Requests">Requests</a></span></dt><dt><span class="sect1"><a href="#appD::Events">Events</a></span></dt></dl></div><div class="sect1" title="Syntactic Conventions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Syntactic_Conventions"></a>Syntactic Conventions</h2></div></div></div><p>
This document uses the same syntactic conventions as the encoding of the core X
protocol, with the following additions:
</p><p>
A LISTofITEMs contains zero or more items of variable type and size. The encode
form for a LISTofITEMs is:
</p><pre class="literallayout">
v     LISTofITEMs           NAME

      TYPE                  MASK-EXPRESSION
      value1                corresponding field(s)
      ...
      valuen                corresponding field(s)
</pre><p>
The MASK-EXPRESSION is an expression using C-style boolean operators and fields
of the request which specifies the bitmask used to determine whether or not a
mem ber of the LISTofITEMs is present. If present, TYPE specifies the
interpretation of the resulting bitmask and the values are listed using the
symbolic names of the members of the set. If TYPE is blank, the values are
numeric constants.
</p><p>
It is possible for a single bit in the MASK-EXPRESSION to control more than one
ITEM — if the bit is set, all listed ITEMs are present. It is also possible
for multiple bits in the MASK-EXPRESSION to control a single ITEM — if any of
the bits associated with an ITEM are set, it is present in the LISTofITEMs.
</p><p>
The size of a LISTofITEMS is derived from the items that are present in the
list, so it is always given as a variable in the request description, and the
request is followed by a section of the form:
</p><pre class="literallayout">
ITEMs
encode-form
...
encode-form
</pre><p>
listing an encode-form for each ITEM. The NAME in each encode-form keys to the
fields listed as corresponding to each bit in the MASK-EXPRESSION. Items are
not necessarily the same size, and the size specified in the encoding form is
the size that the item occupies if it is present.
</p><p>
Some types are of variable size. The encode-form for a list of items of a
single type but variable size is:
</p><pre class="literallayout">
S0+..Ss     LISTofTYPE     name
</pre><p>
Which indicates that the list has <span class="emphasis"><em>
s</em></span>
 elements of variable size and that the size of the list is the sum of the
sizes of all of the elements that make up the list. The notation Sn refers to
the size of the <span class="emphasis"><em>
n</em></span>
th element of the list and the notation S* refers to the size of the list as a
whole.
</p><p>
The definition of a type of variable size includes an expression which
specifies the size. The size is specified as a constant plus a variable
expression; the constant specifies the size of the fields that are always
present and the variables which make up the variable expression are defined in
the constant portion of the structure. For example, the following definition
specifies a counted string with a two-byte length field preceding the string:
</p><pre class="literallayout">
TYPE             2+n+p
2     n          length
n     STRING8    string
p                unused,p=pad(n)
</pre><p>
Some fields are optional. The size of an optional field has the form:
"[<span class="emphasis"><em>
expr</em></span>
]" where expr specifies the size of the field if it is present. An explanation
of the conditions under which the field is present follows the name in the
encode form:
</p><pre class="literallayout">
1       BOOL          more
3                     unused
[4]     CARD32        optData, if more==TRUE
</pre><p>
This portion of the structure is four bytes long if more is FALSE or eight
bytes long if more is TRUE. This notation can also be used in size expressions;
for example, the size of the previous structure is written as "4+[4]" bytes.
</p></div><div class="sect1" title="Common Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appD::Common_Types"></a>Common Types</h2></div></div></div><pre class="literallayout">
SETofKB_EVENTTYPE
     #x0001                  XkbNewKeyboardNotify
     #x0002                  XkbMapNotify
     #x0004                  XkbStateNotify
     #x0008                  XkbControlsNotify
     #x0010                  XkbIndicatorStateNotify
     #x0020                  XkbIndicatorMapNotify
     #x0040                  XkbNamesNotify
     #x0080                  XkbCompatMapNotify
     #x0100                  XkbBellNotify
     #x0200                  XkbActionMessage
     #x0400                  XkbAccessXNotify
     #x0800                  XkbExtensionDeviceNotify
</pre><pre class="literallayout">SETofKB_NKNDETAIL
     #x01                    XkbNKN_Keycodes
     #x02                    XkbNKN_Geometry
     #x04                    XkbNKN_DeviceID
</pre><pre class="literallayout">SETofKB_AXNDETAIL
     #x01                    XkbAXN_SKPress
     #x02                    XkbAXN_SKAccept
     #x04                    XkbAXN_SKReject
     #x08                    XkbAXN_SKRelease
     #x10                    XkbAXN_BKAccept
     #x20                    XkbAXN_BKReject
     #x40                    XkbAXN_AXKWarning
</pre><pre class="literallayout">SETofKB_MAPPART
     #x0001                  XkbKeyTypes
     #x0002                  XkbKeySyms
     #x0004                  XkbModifierMap
     #x0008                  XkbExplicitComponents
     #x0010                  XkbKeyActions
     #x0020                  XkbKeyBehaviors
     #x0040                  XkbVirtualMods
     #x0080                  XkbVirtualModMap
</pre><pre class="literallayout">SETofKB_STATEPART
     #x0001                  XkbModifierState
     #x0002                  XkbModifierBase
     #x0004                  XkbModifierLatch
     #x0008                  XkbModifierLock
     #x0010                  XkbGroupState
     #x0020                  XkbGroupBase
     #x0040                  XkbGroupLatch
     #x0080                  XkbGroupLock
     #x0100                  XkbCompatState
     #x0200                  XkbGrabMods
     #x0400                  XkbCompatGrabMods
     #x0800                  XkbLookupMods
     #x1000                  XkbCompatLookupMods
     #x2000                  XkbPointerButtons
</pre><pre class="literallayout">SETofKB_BOOLCTRL
     #x00000001                  XkbRepeatKeys
     #x00000002                  XkbSlowKeys
     #x00000004                  XkbBounceKeys
     #x00000008                  XkbStickyKeys
     #x00000010                  XkbMouseKeys
     #x00000020                  XkbMouseKeysAccel
     #x00000040                  XkbAccessXKeys
     #x00000080                  XkbAccessXTimeoutMask
     #x00000100                  XkbAccessXFeedbackMask
     #x00000200                  XkbAudibleBellMask
     #x00000400                  XkbOverlay1Mask
     #x00000800                  XkbOverlay2Mask
     #x00001000                  XkbIgnoreGroupLockMask
</pre><pre class="literallayout">SETofKB_CONTROL
     Encodings are the same as for SETofKB_BOOLCTRL, with the addition of:
     #x080000000                  XkbGroupsWrap
     #x100000000                  XkbInternalMods
     #x200000000                  XkbIgnoreLockMods
     #x400000000                  XkbPerKeyRepeat
     #x800000000                  XkbControlsEnabled
</pre><pre class="literallayout">SETofKB_AXFBOPT
     #x0001                  XkbAX_SKPressFB
     #x0002                  XkbAX_SKAcceptFB
     #x0004                  XkbAX_FeatureFB
     #x0008                  XkbAX_SlowWarnFB
     #x0010                  XkbAX_IndicatorFB
     #x0020                  XkbAX_StickyKeysFB
     #x0100                  XkbAX_SKReleaseFB
     #x0200                  XkbAX_SKRejectFB
     #x0400                  XkbAX_BKRejectFB
     #x0800                  XkbAX_DumbBell
</pre><pre class="literallayout">SETofKB_AXSKOPT
     #x0040                  XkbAX_TwoKeys
     #x0080                  XkbAX_LatchToLock
</pre><pre class="literallayout">SETofKB_AXOPTION
     Encoding same as the bitwise union of :
     SETofKB_AXFBOPT
     SETofKB_AXSKOPT
</pre><pre class="literallayout">KB_DEVICESPEC
     0..255     input extension device id
     #x100      XkbUseCoreKbd
     #x200      XkbUseCorePtr
</pre><pre class="literallayout">KB_LEDCLASSRESULT
     0     KbdFeedbackClass
     4     LedFeedbackClass
</pre><pre class="literallayout">KB_LEDCLASSSPEC
     Encoding same as KB_LEDCLASSRESULT, with the addition of:
     #x0300     XkbDfltXIClass
     #x0500     XkbAllXIClasses
</pre><pre class="literallayout">KB_BELLCLASSRESULT
     0     KbdFeedbackClass
     5     BellFeedbackClass
</pre><pre class="literallayout">KB_BELLCLASSSPEC
     Encoding same as KB_BELLCLASSRESULT, with the addition of:
     #x0300     XkbDfltXIClass
</pre><pre class="literallayout">KB_IDSPEC
     0..255     input extension feedback id
     #x0400     XkbDfltXIId
</pre><pre class="literallayout">KB_IDRESULT
     Encoding same as KB_IDSPEC, with the addition of:
     #xff00     XkbXINone
</pre><pre class="literallayout">KB_MULTIIDSPEC
     encodings same as KB_IDSPEC, with the addition of:
     #x0500     XkbAllXIIds
</pre><pre class="literallayout">KB_GROUP
     0     XkbGroup1
     1     XkbGroup2
     2     XkbGroup3
     3     XkbGroup4
</pre><pre class="literallayout">KB_GROUPS
     Encoding same as KB_GROUP, with the addition of:
     254     XkbAnyGroup
     255     XkbAllGroups
</pre><pre class="literallayout">SETofKB_GROUP
     #x01     XkbGroup1
     #x02     XkbGroup2
     #x04     XkbGroup3
     #x08     XkbGroup4
</pre><pre class="literallayout">SETofKB_GROUPS
     Encoding same as SETofKB_GROUP, with the addition of:
     #x80     XkbAnyGroup
</pre><pre class="literallayout">KB_GROUPSWRAP
     #x00     XkbWrapIntoRange
     #x40     XkbClampIntoRange
     #x80     XkbRedirectIntoRange
</pre><pre class="literallayout">SETofKB_VMODSHIGH
     #x80     virtual modifier 15
     #x40     virtual modifier 14
     #x20     virtual modifier 13
     #x10     virtual modifier 12
     #x08     virtual modifier 11
     #x04     virtual modifier 10
     #x02     virtual modifier 9
     #x01     virtual modifier 8
</pre><pre class="literallayout">SETofKB_VMODSLOW
     #x80     virtual modifier 7
     #x40     virtual modifier 6
     #x20     virtual modifier 5
     #x10     virtual modifier 4
     #x08     virtual modifier 3
     #x04     virtual modifier 2
     #x02     virtual modifier 1
     #x01     virtual modifier 0
</pre><pre class="literallayout">SETofKB_VMOD
     #x8000     virtual modifier 15
     #x4000     virtual modifier 14
     #x2000     virtual modifier 13
     #x1000     virtual modifier 12
     #x0800     virtual modifier 11
     #x0400     virtual modifier 10
     #x0200     virtual modifier 9
     #x0100     virtual modifier 8
     #x0080     virtual modifier 7
     #x0040     virtual modifier 6
     #x0020     virtual modifier 5
     #x0010     virtual modifier 4
     #x0008     virtual modifier 3
     #x0004     virtual modifier 2
     #x0002     virtual modifier 1
     #x0001     virtual modifier 0
</pre><pre class="literallayout">SETofKB_EXPLICIT
     #x80     XkbExplicitVModMap
     #x40     XkbExplicitBehavior
     #x20     XkbExplicitAutoRepeat
     #x10     XkbExplicitInterpret
     #x08     XkbExplicitKeyType4
     #x04     XkbExplicitKeyType3
     #x02     XkbExplicitKeyType2
     #x01     XkbExplicitKeyType1
</pre><pre class="literallayout">KB_SYMINTERPMATCH
     #x80     XkbSI_LevelOneOnly
     #x7f     operation, one of the following:
          0 XkbSI_NoneOf
          1 XkbSI_AnyOfOrNone
          2 XkbSI_AnyOf
          3 XkbSI_AllOf
          4 XkbSI_Exactly
</pre><pre class="literallayout">SETofKB_IMFLAG
     #x80     XkbIM_NoExplicit
     #x40     XkbIM_NoAutomatic
     #x20     XkbIM_LEDDrivesKB
</pre><pre class="literallayout">SETofKB_IMMODSWHICH
     #x10     XkbIM_UseCompat
     #x08     XkbIM_UseEffective
     #x04     XkbIM_UseLocked
     #x02     XkbIM_UseLatched
     #x01     XkbIM_UseBase
</pre><pre class="literallayout">SETofKB_IMGROUPSWHICH
     #x10     XkbIM_UseCompat
     #x08     XkbIM_UseEffective
     #x04     XkbIM_UseLocked
     #x02     XkbIM_UseLatched
     #x01     XkbIM_UseBase
</pre><pre class="literallayout">KB_INDICATORMAP
1     SETofKB_IMFLAGS          flags
1     SETofKB_IMGROUPSWHICH          whichGroups
1     SETofKB_GROUP          groups
1     SETofKB_IMMODSWHICH          whichMods
1     SETofKEYMASK          mods
1     SETofKEYMASK          realMods
2     SETofKB_VMOD          vmods
4     SETofKB_BOOLCTRL          ctrls
</pre><pre class="literallayout">SETofKB_CMDETAIL
     #x01     XkbSymInterp
     #x02     XkbGroupCompat
</pre><pre class="literallayout">SETofKB_NAMEDETAIL
     #x0001     XkbKeycodesName
     #x0002     XkbGeometryName
     #x0004     XkbSymbolsName
     #x0008     XkbPhysSymbolsName
     #x0010     XkbTypesName
     #x0020     XkbCompatName
     #x0040     XkbKeyTypeNames
     #x0080     XkbKTLevelNames
     #x0100     XkbIndicatorNames
     #x0200     XkbKeyNames
     #x0400     XkbKeyAliases
     #x0800     XkbVirtualModNames
     #x1000     XkbGroupNames
     #x2000     XkbRGNames
</pre><pre class="literallayout">SETofKB_GBNDETAIL
     #x01     XkbGBN_Types
     #x02     XkbGBN_CompatMap
     #x04     XkbGBN_ClientSymbols
     #x08     XkbGBN_ServerSymbols
     #x10     XkbGBN_IndicatorMaps
     #x20     XkbGBN_KeyNames
     #x40     XkbGBN_Geometry
     #x80     XkbGBN_OtherNames
</pre><pre class="literallayout">SETofKB_XIEXTDEVFEATURE
     #x02     XkbXI_ButtonActions
     #x04     XkbXI_IndicatorNames
     #x08     XkbXI_IndicatorMaps
     #x10     XkbXI_IndicatorState
</pre><pre class="literallayout">SETofKB_XIFEATURE
     Encoding same as SETofKB_XIEXTDEVFEATURE, with the addition of:
     #x01     XkbXI_Keyboards
</pre><pre class="literallayout">SETofKB_XIDETAIL
     Encoding same as SETofKB_XIFEATURE, with the addition of:
     #x8000     XkbXI_UnsupportedFeature
</pre><pre class="literallayout">SETofKB_PERCLIENTFLAG
     #x01     XkbDetectableAutorepeat
     #x02     XkbGrabsUseXKBState
     #x04     XkbAutoResetControls
     #x08     XkbLookupStateWhenGrabbed
     #x10     XkbSendEventUsesXKBState
</pre><pre class="literallayout">KB_MODDEF
1     SETofKEYMASK          mask
1     SETofKEYMASK          realMods
2     SETofVMOD          vmods
</pre><pre class="literallayout">KB_COUNTED_STRING8
1     l          length
l     STRING8          string
</pre><pre class="literallayout">KB_COUNTED_STRING16
2     l          length
l     STRING8          string
</pre><pre class="literallayout">KB_COUNTED_STRING16
p               unused,p=pad(2+l)
</pre></div><div class="sect1" title="Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appD::Errors"></a>Errors</h2></div></div></div><pre class="literallayout">1     0          Error
2     ??          code
2     CARD16          sequence
4     CARD32          error value
     most significant 8 bits of error value have the meaning:
     0xff     XkbErrBadDevice
     0xfe     XkbErrBadClass
     0xfd     XkbErrBadId
     the least significant 8 bits of the error value contain the device id,
class, or feedback
     id which failed.
2     CARD16          minor opcode
1     CARD8          major opcode
21               unused
</pre></div><div class="sect1" title="Key Actions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appD::Key_Actions"></a>Key Actions</h2></div></div></div><pre class="literallayout">1     0          type
7               unused
</pre><pre class="literallayout">1     1          type
1     BITMASK          flags
     #x01     XkbSA_ClearLocks
     #x02     XkbSA_LatchToLock
     #x04     XkbSA_UseModMapMods
1     SETofKEYMASK          mask
1     SETofKEYMASK          real modifiers
1     SETofKB_VMODSHIGH          virtual modifiers high
1     SETofKB_VMODSLOW          virtual modifiers low
2               unused
</pre><pre class="literallayout">1     2          type
1     BITMASK          flags
     #x01     XkbSA_ClearLocks
     #x02     XkbSA_LatchToLock
     #x04     XkbSA_UseModMapMods
1     SETofKEYMASK          mask
1     SETofKEYMASK          real modifiers
1     SETofKB_VMODSHIGH          virtual modifiers high
1     SETofKB_VMODSLOW          virtual modifiers low
2               unused
</pre><pre class="literallayout">1     3          type
1     BITMASK          flags
     #x01     XkbSA_LockNoLock
     #x02     XkbSA_LockNoUnlock
     #x04     XkbSA_UseModMapMods
1     SETofKEYMASK          mask
1     SETofKEYMASK          real modifiers
1     SETofKB_VMODSHIGH          virtual modifiers high
1     SETofKB_VMODSLOW          virtual modifiers low
2               unused
</pre><pre class="literallayout">1     4          type
1     BITMASK          flags
     #x01     XkbSA_ClearLocks
     #x02     XkbSA_LatchToLock
     #x04     XkbSA_GroupAbsolute
1     INT8          group
5               unused
</pre><pre class="literallayout">1     5          type
1     BITMASK          flags
     #x01     XkbSA_ClearLocks
     #x02     XkbSA_LatchToLock
     #x04     XkbSA_GroupAbsolute
1     INT8          group
5               unused
</pre><pre class="literallayout">1     6          type
1     BITMASK          flags
     #x01     XkbSA_LockNoLock
     #x02     XkbSA_LockNoUnlock
     #x04     XkbSA_GroupAbsolute
1     INT8          group
5               unused
</pre><pre class="literallayout">1     7          type
1     BITMASK          flags
     #x01     XkbSA_NoAcceleration
     #x02     XkbSA_MoveAbsoluteX
     #x04     XkbSA_MoveAbsoluteY
1     INT8          x high
1     CARD8          x low
1     INT8          y high
1     CARD8          y low
2               unused
</pre><pre class="literallayout">1     8          type
1     BITMASK          flags
1     CARD8          count
1     CARD8          button
4               unused
</pre><pre class="literallayout">1     9          type
1     BITMASK          flags
1               unused
1     CARD8          button
4               unused
</pre><pre class="literallayout">1     10          type
1     BITMASK          flags
     #x02     XkbSA_DfltBtnAbsolute
1     BITMASK          affect
     #x01     XkbSA_AffectDfltBtn
1     INT8          value
4               unused
</pre><pre class="literallayout">1     11          type
1     BITMASK          flags
     #x01     XkbSA_LockNoLock
     #x02     XkbSA_LockNoUnlock
     #x04     XkbSA_UseModMapMods (if SA_ISODfltIsGroup is 0)
     #x04     XkbSA_GroupAbsolute (if SA_ISODfltIsGroup is 1)
     #x80     XkbSA_ISODfltIsGroup
1     SETofKEYMASK          mask
1     SETofKEYMASK          real modifiers
1     INT8          group
1     BITMASK          affect
     #x08     XkbSA_ISONoAffectCtrls
     #x10     XkbSA_ISONoAffectPtr
     #x20     XkbSA_ISONoAffectGroup
     #x40     XkbSA_ISONoAffectMods
1     SETofKB_VMODSHIGH          virtual modifiers high
1     SETofKB_VMODSLOW          virtual modifiers low
</pre><pre class="literallayout">1     12          type
7               unused
</pre><pre class="literallayout">1     13          type
1     BITMASK          flags
     #x01     XkbSA_SwitchApplication
     #x04     XkbSA_SwitchAbsolute
1     INT8          new screen
5               unused (must be 0)
</pre><pre class="literallayout">1     14          type
3               unused (must be 0)
1     BITMASK          boolean controls high
     #x01     XkbAccessXFeedbackMask
     #x02     XkbAudibleBellMask
     #x04     XkbOverlay1Mask
     #x08     XkbOverlay2Mask
     #x10     XkbIgnoreGroupLockMask
1     BITMASK          boolean controls low
     #x01     XkbRepeatKeys
     #x02     XkbSlowKeys
     #x04     XkbBounceKeys
     #x08     XkbStickyKeys
     #x10     XkbMouseKeys
     #x20     XkbMouseKeysAccel
     #x40     XkbAccessXKeys
     #x80     XkbAccessXTimeoutMask
2          unused (must be 0)
</pre><pre class="literallayout">1     15          type
3               unused (must be 0)
1     BITMASK          boolean controls high
     #x01     XkbAccessXFeedbackMask
     #x02     XkbAudibleBellMask
     #x04     XkbOverlay1Mask
     #x08     XkbOverlay2Mask
     #x10     XkbIgnoreGroupLockMask
1     BITMASK          boolean controls low
     #x01     XkbRepeatKeys
     #x02     XkbSlowKeys
     #x04     XkbBounceKeys
     #x08     XkbStickyKeys
     #x10     XkbMouseKeys
     #x20     XkbMouseKeysAccel
     #x40     XkbAccessXKeys
     #x80     XkbAccessXTimeoutMask
</pre><pre class="literallayout">1     16          type
2               unused (must be 0)
</pre><pre class="literallayout">1     16          type
1     BITMASK          flags
     #x01          XkbSA_MessageOnPress
     #x02          XkbSA_MessageOnRelease
     #x04          XkbSA_MessageGenKeyEvent
6     STRING          message
</pre><pre class="literallayout">1     17          type
1     KEYCODE          new key
1     SETofKEYMASK          mask
1     SETofKEYMASK          real modifiers
1     SETofKB_VMODSHIGH          virtual modfiiers mask high
1     SETofKB_VMODSLOW          virtual modifiers mask low
1     SETofKB_VMODSHIGH          virtual modifiers high
1     SETofKB_VMODSLOW          virtual modfiers low
</pre><pre class="literallayout">1     18          type
1     0          flags
1     CARD8          count
1     CARD8          button
1     CARD8          device
3               unused (must be 0)
</pre><pre class="literallayout">1     19          type
1     BITMASK          flags
     #x01          XkbSA_LockNoLock
     #x02          XkbSA_LockNoUnlock
1               unused
1     CARD8          button
1     CARD8          device
</pre><pre class="literallayout">1     20          type
1     CARD8          device
1     KB_SA_VALWHAT          valuator 1 what
     #x00          XkbSA_IgnoreVal
     #x01          XkbSA_SetValMin
     #x02          XkbSA_SetValCenter
     #x03          XkbSA_SetValMax
     #x04          XkbSA_SetValRelative
     #x05          XkbSA_SetValAbsolute
1     CARD8          valuator 1 index
1     CARD8          valuator 1 value
1     KB_SA_VALWHAT          valuator 2 what
     Encodings as for "valuator 1 what" above
1     CARD8          valuator 2 index
1     CARD8          valuator 2 value
</pre></div><div class="sect1" title="Key Behaviors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Key_Behaviors"></a>Key Behaviors</h2></div></div></div><pre class="literallayout">1     #x00          type
1               unused
</pre><pre class="literallayout">1     #x01          type
1               unused
</pre><pre class="literallayout">1     #x02          type
1     0..31          group
</pre><pre class="literallayout">1     #x03          type
1     KEYCODE          key
</pre><pre class="literallayout">1     #x04          type
1     CARD8          key
</pre><pre class="literallayout">1     #x81          type
1               unused
</pre><pre class="literallayout">1     #x82          type
1     0..31          group
</pre><pre class="literallayout">1     #x83          type
1     KEYCODE          key
</pre><pre class="literallayout">1     #x84          type
1     KEYCODE          key
</pre></div><div class="sect1" title="Requests"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appD::Requests"></a>Requests</h2></div></div></div><pre class="literallayout">1     ??          opcode
1     0          xkb-opcode
2     2          request-length
2     CARD16          wantedMajor
2     CARD16          wantedMinor
</pre><pre class="literallayout">1     1          Reply
1     BOOL          supported
2     CARD16          sequence number
4     0           reply length
2     1          serverMajor
2     0          serverMinor
20               unused
</pre><pre class="literallayout">1     ??          opcode
1     1          xkb-opcode
2     4+(V+p)/4          request-length
2     KB_DEVICESPEC           deviceSpec
2     SETofKB_EVENTTYPE          affectWhich
2     SETofKB_EVENTTYPE          clear
2     SETofKB_EVENTTYPE          selectAll
2     SETofKB_MAPDETAILS          affectMap
2     SETofKB_MAPDETAILS          map
V     LISTofITEMs          details
     SETofKB_EVENTTYPE
(affectWhich&amp;(~clear)&amp;(~selectAll))
     XkbNewKeyboardNotify     affectNewKeyboard, newKeyboardDetails
     XkbStateNotify     affectState, stateDetails
     XkbControlsNotify     affectCtrls, ctrlDetails
     XkbIndicatorStateNotify     affectIndicatorState, indicatorStateDetails
     XkbIndicatorMapNotify     affectIndicatorMap, indicatorMapDetails
     XkbNamesNotify     affectNames, namesDetails
     XkbCompatMapNotify     affectCompat, compatDetails
     XkbBellNotify     affectBell, bellDetails
     XkbActionMessage     affectMsgDetails, msgDetails
     XkbExtensionDeviceNotify     affectExtDev, extdevDetails
</pre><pre class="literallayout">ITEMs
p          unused, p=pad(V)
</pre><pre class="literallayout">ITEMs
2     SETofKB_NKNDETAIL          affectNewKeyboard
2     SETofKB_NKNDETAIL          newKeyboardDetails
2     SETofKB_STATEPART          affectState
2     SETofKB_STATEPART          stateDetails
4     SETofKB_CONTROL          affectCtrls
4     SETofKB_CONTROL          ctrlDetails
4     SETofKB_INDICATOR          affectIndicatorState
4     SETofKB_INDICATOR          indicatorStateDetails
4     SETofKB_INDICATOR          affectIndicatorMaps
4     SETofKB_INDICATOR          indicatorMapDetails
2     SETofKB_NAME_DETAIL          affectNames
2     SETofKB_NAME_DETAIL          namesDetails
1     SETofKB_CMDETAIL          affectCompat
1     SETofKB_CMDETAIL          compatDetails
1     SETofKB_BELLDETAIL          affectBell
1     SETofKB_BELLDETAIL          bellDetails
1     SETofKB_MSGDETAIL          affectMsgDetails
1     SETofKB_MSGDETAIL          msgDetails
2     SETofKB_AXNDETAIL          affectAccessX
2     SETofKB_AXNDETAIL          accessXDetails
2     SETofKB_XIDETAIL          affectExtDev
2     SETofKB_XIDETAIL          extdevDetails
</pre><pre class="literallayout">1     ??          opcode
1     3          xkb-opcode
2     7          request-length
2     KB_DEVICESPEC           deviceSpec
2     KB_BELLCLASSSPEC          bellClass
2     KB_IDSPEC          bellID
1     INT8          percent
1     BOOL          forceSound
1     BOOL          eventOnly
1               unused
2     INT16          pitch
2     INT16          duration
2               unused
4     ATOM          name
4     WINDOW          window
</pre><pre class="literallayout">1     ??          opcode
1     4          xkb-opcode
2     2          request-length
2     KB_DEVICESPEC           deviceSpec
2               unused
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     0          length
1     SETofKEYMASK          mods
1     SETofKEYMASK          baseMods
1     SETofKEYMASK          latchedMods
1     SETofKEYMASK          lockedMods
1     KP_GROUP          group
1     KP_GROUP          lockedGroup
2     INT16          baseGroup
2     INT16          latchedGroup
1     SETofKEYMASK          compatState
1     SETofKEYMASK          grabMods
1     SETofKEYMASK          compatGrabMods
1     SETofKEYMASK          lookupMods
1     SETofKEYMASK          compatLookupMods
1               unused
2     SETofBUTMASK          ptrBtnState
6               unused
</pre><pre class="literallayout">1     ??          opcode
1     5          xkb-opcode
2     4          request-length
2     KB_DEVICESPEC           deviceSpec
1     SETofKEYMASK          affectModLocks
1     SETofKEYMASK          modLocks
1     BOOL          lockGroup
1     KB_GROUP          groupLock
1     SETofKEYMASK          affectModLatches
1     SETofKEYMASK          modLatches
1               unused
1     BOOL          latchGroup
2     INT16          groupLatch
</pre><pre class="literallayout">1     ??          opcode
1     6          xkb-opcode
2     2          request-length
2     KB_DEVICESPEC           deviceSpec
2               unused
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     15          length
1     CARD8          mouseKeysDfltBtn
1     CARD8          numGroups
1     CARD8          groupsWrap
1     SETofKEYMASK          internalMods.mask
1     SETofKEYMASK          ignoreLockMods.mask
1     SETofKEYMASK          internalMods.realMods
1     SETofKEYMASK          ignoreLockMods.realMods
1               unused
2     SETofKB_VMOD          internalMods.vmods
2     SETofKB_VMOD          ignoreLockMods.vmods
2     CARD16          repeatDelay
2     CARD16          repeatInterval
2     CARD16          slowKeysDelay
2     CARD16          debounceDelay
2     CARD16          mouseKeysDelay
2     CARD16          mouseKeysInterval
2     CARD16          mouseKeysTimeToMax
2     CARD16          mouseKeysMaxSpeed
2     INT16          mouseKeysCurve
2     SETofKB_AXOPTION          accessXOptions
2     CARD16          accessXTimeout
2     SETofKB_AXOPTION          accessXTimeoutOptionsMask
2     SETofKB_AXOPTION          accessXTimeoutOptionValues
2               unused
4     SETofKB_BOOLCTRL          accessXTimeoutMask
4     SETofKB_BOOLCTRL          accessXTimeoutValues
4     SETofKB_BOOLCTRL          enabledControls
32     LISTofCARD8          perKeyRepeat
</pre><pre class="literallayout">1     ??          opcode
1     7          xkb-opcode
2     25          request-length
2     KB_DEVICESPEC           deviceSpec
1     SETofKEYMASK          affectInternalRealMods
1     SETofKEYMASK          internalRealMods
1     SETofKEYMASK          affectIgnoreLockRealMods
1     SETofKEYMASK          ignoreLockRealMods
2     SETofKB_VMOD          affectInternalVirtualMods
2     SETofKB_VMOD          internalVirtualMods
2     SETofKB_VMOD          affectIgnoreLockVirtualMods
2     SETofKB_VMOD          ignoreLockVirtualMods
1     CARD8          mouseKeysDfltBtn
1     CARD8          groupsWrap
2     SETofKB_AXOPTION          accessXOptions
2               unused
4     SETofKB_BOOLCTRL          affectEnabledControls
4     SETofKB_BOOLCTRL          enabledControls
4     SETofKB_CONTROL          changeControls
2     CARD16          repeatDelay
2     CARD16          repeatInterval
2     CARD16          slowKeysDelay
2     CARD16          debounceDelay
2     CARD16          mouseKeysDelay
2     CARD16          mouseKeysInterval
2     CARD16          mouseKeysTimeToMax
2     CARD16          mouseKeysMaxSpeed
2     INT16          mouseKeysCurve
2     CARD16          accessXTimeout
4     SETofKB_BOOLCTRL          accessXTimeoutMask
4     SETofKB_BOOLCTRL          accessXTimeoutValues
2     SETofKB_AXOPTION          accessXTimeoutOptionsMask
2     SETofKB_AXOPTION          accessXTimeoutOptionsValues
32     LISTofCARD8          perKeyRepeat
</pre><pre class="literallayout">1     CARD8          opcode
1     8          xkb-opcode
2     7          request-length
2     KB_DEVICESPEC           deviceSpec
2     SETofKB_MAPPART          full
2     SETofKB_MAPPART          partial
1     CARD8          firstType
1     CARD8          nTypes
1     KEYCODE          firstKeySym
1     CARD8          nKeySyms
1     KEYCODE          firstKeyAction
1     CARD8          nKeyActions
1     KEYCODE          firstKeyBehavior
1     CARD8          nKeyBehaviors
2     SETofKB_VMOD          virtualMods
1     KEYCODE          firstKeyExplicit
1     CARD8          nKeyExplicit
1     KEYCODE          firstModMapKey
1     CARD8          nModMapKeys
1     KEYCODE          firstVModMapKey
1     CARD8          nVModMapKeys
2               unused
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     2+(I/4)          length
2               unused
1     KEYCODE          minKeyCode
1     KEYCODE          maxKeyCode
2     SETofKB_MAPPART          present
1     CARD8          firstType
1     t          nTypes
1     CARD8          totalTypes
1     KEYCODE          firstKeySym
2     S          totalSyms
1     s          nKeySyms
1     KEYCODE          firstKeyAction
2     A          totalActions
1     a          nKeyActions
1     KEYCODE          firstKeyBehavior
1     b          nKeyBehaviors
1     B          totalKeyBehaviors
1     KEYCODE          firstKeyExplicit
1     e          nKeyExplicit
1     E          totalKeyExplicit
1     KEYCODE          firstModMapKey
1     m          nModMapKeys
1     M          totalModMapKeys
1     KEYCODE          firstVModMapKey
1     0          nVModMapKeys
1     V          totalVModMapKeys
1               unused
2     SETofKB_VMOD          virtualMods (has v bits set to 1)
I     LISTofITEMs          map
     SETofKB_MAPPART               (present)
     XkbKeyTypes     typesRtrn
     XkbKeySyms     symsRtrn
     XkbKeyActions     actsRtrn.count, actsRtrn.acts
     XkbKeyBehaviors     behaviorsRtrn
     XkbVirtualMods     vmodsRtrn
     XkbExplicitComponents     explicitRtrn
     XkbModifierMap     modmapRtrn
     XkbVirtualModMap     vmodMapRtrn
</pre><pre class="literallayout">ITEMs
T1+..Tt     LISTofKB_KEYTYPE          typesRtrn
8s+4S     LISTofKB_KEYSYMMAP          symsRtrn
a     LISTofCARD8          actsRtrn.count
p               unused,p=pad(a)
8A     LISTofKB_ACTION          actsRtrn.acts
4B     LISTofKB_SETBEHAVIOR          behaviorsRtrn
v     LISTofSETofKEYMASK          vmodsRtrn
p               unused, p=pad(v)
2E     LISTofKB_SETEXPLICIT          explicitRtrn
p               unused,p=pad(2E)
2M     LISTofKB_KEYMODMAP          modmapRtrn
p               unused, p=pad(2M)
4V     LISTofKB_KEYVMODMAP          vmodMapRtrn
</pre><pre class="literallayout">KB_KEYTYPE     8+8m+[4m]
1     SETofKEYMASK          mods.mask
1     SETofKEYMASK          mods.mods
2     SETofKB_VMOD          mods.vmods
1     CARD8          numLevels
1     m          nMapEntries
1     BOOL          hasPreserve
1               unused
8m     LISTofKB_KTMAPENTRY          map
[4m]     LISTofKB_MODDEF          preserve
</pre><pre class="literallayout">KB_KTMAPENTRY
1     BOOL          active
1     SETofKEYMASK          mods.mask
1     CARD8          level
1     SETofKEYMASK          mods.mods
2     SETofKB_VMOD          mods.vmods
2               unused
</pre><pre class="literallayout">KB_KEYSYMMAP     8+4n
4     LISTofCARD8          ktIndex
1     CARD8          groupInfo
1     CARD8          width
2     n          nSyms
4n     LISTofKEYSYM          syms
</pre><pre class="literallayout">KB_SETBEHAVIOR
1     KEYCODE          keycode
2     KB_BEHAVIOR          behavior
1               unused
</pre><pre class="literallayout">KB_SETEXPLICIT
1     KEYCODE          keycode
1     SETofKB_EXPLICIT          explicit
</pre><pre class="literallayout">KB_KEYMODMAP
1     KEYCODE          keycode
1     SETofKB_KEYMASK          mods
</pre><pre class="literallayout">KB_KEYVMODMAP
1     KEYCODE          keycode
1               unused
2     SETofKB_VMOD          vmods
</pre><pre class="literallayout">1     CARD8          opcode
1     9          xkb-opcode
2     9+(I/4)          request-length
2     KB_DEVICESPEC           deviceSpec
2     SETofKB_MAPPART          present
2     SETofKB_SETMAPFLAGS          flags
     #0001     SetMapResizeTypes
     #0002     SetMapRecomputeActions
1     KEYCODE          minKeyCode
1     KEYCODE          maxKeyCode
1     CARD8          firstType
1     t          nTypes
1     KEYCODE          firstKeySym
1     s          nKeySyms
2     S          totalSyms
1     KEYCODE          firstKeyAction
1     a          nKeyActions
2     A          totalActions
1     KEYCODE          firstKeyBehavior
1     b          nKeyBehaviors
1     B          totalKeyBehaviors
1     KEYCODE          firstKeyExplicit
1     e          nKeyExplicit
1     E          totalKeyExplicit
1     KEYCODE          firstModMapKey
1     m          nModMapKeys
1     M          totalModMapKeys
1     KEYCODE          firstVModMapKey
1     v          nVModMapKeys
1     V          totalVModMapKeys
2     SETofKB_VMOD          virtualMods (has n bits set to 1)
I     LISTofITEMs          values
     SETofKB_MAPPART          (present)
     XkbKeyTypes     types
     XkbKeySymbols     syms
     XkbKeyActions     actions.count,actions.actions
     XkbKeyBehaviors     behaviors
     XkbVirtualMods     vmods
     XkbExplicitComponents     explicit
     XkbModifierMap     modmap
     XkbVirtualModMap     vmodmap
</pre><pre class="literallayout">ITEMs
T0+..Tt     LISTofKB_SETKEYTYPE          types
8s+4S     LISTofKB_KEYSYMMAP          syms
a     LISTofCARD8          actions.count
p               unused,p=pad(a)
8A     LISTofKB_ACTION          actions.actions
4B     LISTofKB_SETBEHAVIOR          behaviors
v     LISTofSETofKEYMASK          vmods
p               unused, p=pad(v)
2E     LISTofKB_SETEXPLICIT          explicit
p               unused,p=pad(2E)
2M     LISTofKB_KEYMODMAP          modmap
P               unused, p=pad(2M)
4V     LISTofKB_KEYVMODMAP          vmodmap
</pre><pre class="literallayout">KB_SETKEYTYPE     8+4m+[4m]
1     SETofKEYMASK          mask
1     SETofKEYMASK          realMods
2     SETofKB_VMOD          virtualMods
1     CARD8          numLevels
1     m          nMapEntries
1     BOOL          preserve
1               unused
4m     LISTofKB_KTSETMAPENTRY          entries
[4m]     LISTofKB_MODDEF          preserveEntries (if preserve==TRUE)
</pre><pre class="literallayout">KB_KTSETMAPENTRY
1     CARD8          level
1     SETofKEYMASK          realMods
2     SETofKB_VMOD          virtualMods
</pre><pre class="literallayout">1     ??          opcode
1     10          xkb-opcode
2     3          request-length
2     KB_DEVICESPEC           deviceSpec
1     SETofKB_GROUP          groups
1     BOOL          getAllSI
2     CARD16          firstSI
2     CARD16          nSI
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     (16n+4g)/4          length
1     SETofKB_GROUP          groupsRtrn (has g bits set to 1)
1               unused
2     CARD16          firstSIRtrn
2     n          nSIRtrn
2     CARD16          nTotalSI
16               unused
16n     LISTofKB_SYMINTERPRET          siRtrn
4g     LISTofKB_MODDEF          groupRtrn
</pre><pre class="literallayout">1     ??          opcode
1     11          xkb-opcode
2     4+(16n+4g)          request-length
2     KB_DEVICESPEC           deviceSpec
1               unused
1     BOOL          recomputeActions
1     BOOL          truncateSI
1     SETofKB_GROUP          groups (has g bits set to 1)
2     CARD16          firstSI
2     n          nSI
2               unused
16n     LISTofKB_SYMINTERPRET          si
4g     LISTofKB_MODDEF          groupMaps
</pre><pre class="literallayout">1     ??          opcode
1     12          xkb-opcode
2     2          request-length
2     KB_DEVICESPEC           deviceSpec
</pre><pre class="literallayout">ITEMs
2               unused
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     0          length
4     SETofKB_INDICATOR          state
20               unused
</pre><pre class="literallayout">1     ??          opcode
1     13          xkb-opcode
2     3          request-length
2     KB_DEVICESPEC           deviceSpec
2               unused
4     SETofKB_INDICATOR          which
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     12n/4          length
4     SETofKB_INDICATOR          which (has n bits set to 1)
4     SETofKB_INDICATOR          realIndicators
1     n          nIndicators
15               unused
12n     LISTofKB_INDICATORMAP          maps
</pre><pre class="literallayout">1     ??          opcode
1     14          xkb-opcode
2     3+3n          request-length
2     KB_DEVICESPEC           deviceSpec
2               unused
4     SETofKB_INDICATOR          which (has n bits set to 1)
12n     LISTofKB_INDICATORMAP          maps
</pre><pre class="literallayout">1     CARD8          opcode
1     15          xkb-opcode
2     4          request-length
2     KB_DEVICESPEC           deviceSpec
2     KB_LEDCLASSSPEC          ledClass
2     KB_IDSPEC          ledID
2               unused
4     ATOM          indicator
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     0          length
4     ATOM          indicator
1     BOOL          found
1     BOOL          on
1     BOOL          realIndicator
1     KB_INDICATOR          ndx
1     SETofKB_IMFLAGS          map.flags
1     SETofKB_IMGROUPSWHICH          map.whichGroups
1     SETofKB_GROUPS          map.groups
1     SETofKB_IMMODSWHICH          map.whichMods
1     SETofKEYMASK          map.mods
1     SETofKEYMASK          map.realMods
2     SETofKB_VMOD          map.vmods
4     SETofKB_BOOLCTRL          map.ctrls
1     BOOL          supported
3               unused
</pre><pre class="literallayout">1     ??          opcode
1     16          xkb-opcode
2     8          request-length
2     KB_DEVICESPEC           deviceSpec
2     KB_LEDCLASSSPEC          ledClass
2     KB_IDSPEC          ledID
2               unused
4     ATOM          indicator
1     BOOL          setState
1     BOOL          on
1     BOOL          setMap
1     BOOL          createMap
1               unused
1     SETofKB_IMFLAGS          map.flags
1     SETofKB_IMGROUPSWHICH          map.whichGroups
1     SETofKB_GROUP          map.groups
1     SETofKB_IMMODSWHICH          map.whichMods
1     SETofKEYMASK          map.realMods
2     SETofKB_VMOD          map.vmods
4     SETofKB_BOOLCTRL          map.ctrls
</pre><pre class="literallayout">1     CARD8          opcode
1     17          xkb-opcode
2     3          request-length
2     KB_DEVICESPEC           deviceSpec
2               unused
4     SETofKB_NAMEDETAIL          which
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     V/4          length
4     SETofKB_NAMEDETAIL          which
1     KEYCODE          minKeyCode
1     KEYCODE          maxKeyCode
1     t          nTypes
1     SETofKB_GROUP          groupNames (has g bits set to 1)
2     SETofKB_VMOD          virtualMods (has v bits set to 1)
1     KEYCODE          firstKey
1     k          nKeys
4     SETofKB_INDICATOR          indicators (has i bits set to 1)
1     r          nRadioGroups
1     a          nKeyAliases
2     l          nKTLevels
4               unused
V     LISTofITEMs          valueList
     SETofKB_NAMEDETAIL          (which)
     XkbKeycodesName     keycodesName
     XkbGeometryName     geometryName
     XkbSymbolsName     symbolsName
     XkbPhySymbolsName     physSymbolsName
     XkbTypesName     typesName
     XkbCompatName     compatName
     XkbKeyTypeNames     typeNames
     XkbKTLevelNames     nLevelsPerType, ktLevelNames
     XkbIndicatorNames     indicatorNames
     XkbVirtualModNames     virtualModNames
     XkbGroupNames     groupNames
     XkbKeyNames     keyNames
     XkbKeyAliases     keyAliases
     XkbRGNames     radioGroupNames
</pre><pre class="literallayout">ITEMs
4     ATOM          keycodesName
4     ATOM          geometryName
4     ATOM          symbolsName
4     ATOM          physSymbolsName
4     ATOM          typesName
4     ATOM          compatName
4t     LISTofATOM          typeNames
l     LISTofCARD8          nLevelsPerType, sum of all elements=L
p               unused, p=pad(l)
4L     LISTofATOM          ktLevelNames
4i     LISTofATOM          indicatorNames
4v     LISTofATOM          virtualModNames
4g     LISTofATOM          groupNames
4k     LISTofKB_KEYNAME          keyNames
8a     LISTofKB_KEYALIAS          keyAliases
4r     LISTofATOM          radioGroupNames
</pre><pre class="literallayout">1     CARD8          opcode
1     18          xkb-opcode
2     7+(V/4)          request-length
2     KB_DEVICESPEC           deviceSpec
2     SETofKB_VMOD          virtualMods
4     SETofKB_NAMEDETAIL          which
1     CARD8          firstType
1     t          nTypes
1     CARD8          firstKTLevel
1     l          nKTLevels
4     SETofKB_INDICATOR          indicators (has i bits set to 1)
1     SETofKB_GROUP          groupNames (has g bits set to 1)
1     r          nRadioGroups
1     KEYCODE          firstKey
1     k          nKeys
1     a          nKeyAliases
1               unused
2     L          totalKTLevelNames
V     LISTofITEMs          values
     SETofKB_NAMEDETAIL          (which)
     XkbKeycodesName     keycodesName
     XkbGeometryName     geometryName
     XkbSymbolsName     symbolsName
     XkbPhySymbolsName     physSymbolsName
     XkbTypesName     typesName
     XkbCompatName     compatName
     XkbKeyTypeNames     typeNames
     XkbKTLevelNames     nLevelsPerType, ktLevelNames
     XkbIndicatorNames     indicatorNames
     XkbVirtualModNames     virtualModNames
     XkbGroupNames     groupNames
     XkbKeyNames     keyNames
     XkbKeyAliases     keyAliases
     XkbRGNames     radioGroupNames
</pre><pre class="literallayout">ITEMs
4     ATOM          keycodesName
4     ATOM          geometryName
4     ATOM          symbolsName
4     ATOM          physSymbolsName
4     ATOM          typesName
4     ATOM          compatName
4t     LISTofATOM          typeNames
l     LISTofCARD8          nLevelsPerType
p               unused, p=pad(l)
4L     LISTofATOM          ktLevelNames
4i     LISTofATOM          indicatorNames
4v     LISTofATOM          virtualModNames
4g     LISTofATOM          groupNames
4k     LISTofKB_KEYNAME          keyNames
8a     LISTofKB_KEYALIAS          keyAliases
4r     LISTofATOM          radioGroupNames
</pre><pre class="literallayout">1     CARD8          opcode
1     19          xkb-opcode
2     3          request-length
2     KB_DEVICESPEC           deviceSpec
2               unused
4     ATOM          name
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     (f+8p+C*+H*+S*+D*+A*)/4          length
4     ATOM          name
1     BOOL          found
1               unused
2     CARD16          widthMM
2     CARD16          heightMM
2     p          nProperties
2     c          nColors
2     h          nShapes
2     s          nSections
2     d          nDoodads
2     a          nKeyAliases
1     CARD8          baseColorNdx
1     CARD8          labelColorNdx
f     KB_COUNTED_STRING16          labelFont
8p     LISTofKB_PROPERTY          properties
C0+..Cc     LISTofKB_COUNTED_STRING16          colors
H0+..Hh     LISTofKB_SHAPE          shapes
S0+..Ss     LISTofKB_SECTION          sections
D0+..Dd     LISTofKB_DOODAD          doodads
A0+..Aa     LISTofKB_KEYALIAS          keyAliases
</pre><pre class="literallayout">KB_PROPERTY     4+n+v
2     n          nameLength
n     STRING8          name
2     v          valueLength
v     STRING8          value
</pre><pre class="literallayout">KB_SHAPE     8+O*
4     ATOM          name
1     o          nOutlines
1     CARD8          primaryNdx
1     CARD8          approxNdx
1               unused
O0+..Oo     LISTofKB_OUTLINE          outlines
</pre><pre class="literallayout">KB_OUTLINE     4+4p
1     p          nPoints
1     CARD8          cornerRadius
2               unused
4p     LISTofKB_POINT          points
</pre><pre class="literallayout">KB_POINT
2     INT16          x
2     INT16          y
</pre><pre class="literallayout">KB_SECTION     20+R*+D*+O*
4     ATOM          name
2     INT16          top
2     INT16          left
2     CARD16          width
2     CARD16          height
2     INT16          angle
1     CARD8          priority
1     r          nRows
1     d          nDoodads
1     o          nOverlays
2               unused
R0+..Rr     LISTofKB_ROW          rows
D0+..Dd     LISTofKB_DOODAD          doodads
O0+..Oo     LISTofKB_OVERLAY          overlays
</pre><pre class="literallayout">KB_ROW     8+8k
2     INT16          top
2     INT16          left
1     k          nKeys
1     BOOL          vertical
2               unused
8k     LISTofKB_KEY          keys
</pre><pre class="literallayout">KB_KEY
4     STRING8          name
2     INT16          gap
1     CARD8          shapeNdx
1     CARD8          colorNdx
</pre><pre class="literallayout">KB_OVERLAY     8+R*
4     ATOM          name
1     r          nRows
3               unused
R0+..Rr     LISTofKB_OVERLAYROW          rows
</pre><pre class="literallayout">KB_OVERLAYROW     4+8k
1     CARD8          rowUnder
1     k          nKeys
2               unused
8k     LISTofKB_OVERLAYKEY          keys
</pre><pre class="literallayout">KB_OVERLAYKEY
4     STRING8          over
4     STRING8          under
</pre><pre class="literallayout">KB_SHAPEDOODAD
4     ATOM          name
1     CARD8          type
</pre><pre class="literallayout">KB_SHAPEDOODAD
     #1     XkbOutlineDoodad
     #2     XkbSolidDoodad
1     CARD8          priority
2     INT16          top
2     INT16          left
2     INT16          angle
1     CARD8          colorNdx
1     CARD8          shapeNdx
6               unused
</pre><pre class="literallayout">KB_TEXTDOODAD     20+t+f
4     ATOM          name
1     CARD8          type
     #3     XkbTextDoodad
1     CARD8          priority
2     INT16          top
2     INT16          left
2     INT16          angle
2     CARD16          width
2     CARD16          height
1     CARD8          colorNdx
3               unused
t     KB_COUNTED_STRING16          text
f     KB_COUNTED_STRING16          font
</pre><pre class="literallayout">KB_INDICATORDOODAD
4     ATOM          name
1     CARD8          type
     #4     XkbIndicatorDoodad
1     CARD8          priority
2     INT16          top
2     INT16          left
2     INT16          angle
1     CARD8          shapeNdx
1     CARD8          onColorNdx
1     CARD8          offColorNdx
5               unused
</pre><pre class="literallayout">KB_LOGODOODAD     20+n
4     ATOM          name
1     CARD8          type
     #5     XkbLogoDoodad
1     CARD8          priority
2     INT16          top
2     INT16          left
2     INT16          angle
1     CARD8          colorNdx
1     CARD8          shapeNdx
6               unused
n     KB_COUNTED_STRING16          logoName
</pre><pre class="literallayout">KB_DOODAD:
     KB_SHAPEDOODAD, or KB_TEXTDOODAD, or
     KB_INDICATORDOODAD, or KB_LOGODOODAD
</pre><pre class="literallayout">1     CARD8          opcode
1     20          xkb-opcode
2     7+(f+8p+C*+H*+S*+D*+A*)/4          request-length
2     KB_DEVICESPEC           deviceSpec
1     h          nShapes
1     s          nSections
4     ATOM          name
2     CARD16          widthMM
2     CARD16          heightMM
2     p          nProperties
2     c          nColors
2     d          nDoodads
2     a          nKeyAliases
1     CARD8          baseColorNdx
1     CARD8          labelColorNdx
2               unused
f     KB_COUNTED_STRING16          labelFont
8p     LISTofKB_PROPERTY          properties
C0+..Cc     LISTofKB_COUNTED_STRING16          colors
H0+..Hh     LISTofKB_SHAPE          shapes
S0+..Ss     LISTofKB_SECTION          sections
D0+..Dd     LISTofKB_DOODAD          doodads
A0+..Aa     LISTofKB_KEYALIAS          keyAliases
</pre><pre class="literallayout">1     CARD8          opcode
1     21          xkb-opcode
2     7          request-length
2     KB_DEVICESPEC          deviceSpec
2               unused
4     SETofKB_PERCLIENTFLAG          change
4     SETofKB_PERCLIENTFLAG          value
4     SETofKB_BOOLCTRL          ctrlsToChange
4     SETofKB_BOOLCTRL          autoCtrls
4     SETofKB_BOOLCTRL          autoCtrlValues
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     0          length
4     SETofKB_PERCLIENTFLAG          supported
4     SETofKB_PERCLIENTFLAG          value
4     SETofKB_BOOLCTRL          autoCtrls
4     SETofKB_BOOLCTRL          autoCtrlValues
8               unused
</pre><pre class="literallayout">1     CARD8          opcode
1     22          xkb-opcode
2     2+(6+m+k+t+c+s+g+p)/4          request-length
2     KB_DEVICESPEC           deviceSpec
2     CARD16          maxNames
1     m          keymapsSpecLen
m     STRING          keymapsSpec
1     k          keycodesSpecLen
k     STRING          keycodesSpec
1     t          typesSpecLen
t     STRING          typesSpec
1     c          compatMapSpecLen
c     STRING          compatMapSpec
1     s          symbolsSpecLen
s     STRING          symbolsSpec
1     g          geometrySpecLen
g     STRING          geometrySpec
p               unused,p=pad(6+m+k+t+c+s+g)
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     (M*+K*+T*+C*+S*+G*+p)/4          length
2     m          nKeymaps
2     k          nKeycodes
2     t          nTypes
2     c          nCompatMaps
2     s          nSymbols
2     g          nGeometries
2     CARD16          extra
10               unused
M0+..Mm     LISTofKB_LISTING          keymaps
K0+..Kk     LISTofKB_LISTING          keycodes
T0+..Tt     LISTofKB_LISTING          types
C0+..Cc     LISTofKB_LISTING          compatMaps
S0+..Ss     LISTofKB_LISTING          symbols
G0+..Gg     LISTofKB_LISTING          geometries
p               unused,p=pad(M*+K*+T*+C*+S*+G*)
</pre><pre class="literallayout">KB_LISTING     4+n+p
2     CARD16          flags
2     n          length
n     STRING8          string
p               unused,p=pad(n) to a 2-byte boundary
</pre><pre class="literallayout">1     CARD8          opcode
1     23          xkb-opcode
2     3+(6+m+k+t+c+s+g+p)/4          request-length
2     KB_DEVICESPEC           deviceSpec
2     SETofKB_GBNDETAILMASK          need
2     SETofKB_GBNDETAILMASK          want
1     BOOL          load
1               unused
1     m          keymapsSpecLen
m     STRING8          keymapsSpec
1     k          keycodesSpecLen
k     STRING8          keycodesSpec
1     t          typesSpecLen
t     STRING8          typesSpec
1     c          compatMapSpecLen
c     STRING8          compatMapSpec
1     s          symbolsSpecLen
s     STRING8          symbolsSpec
1     g          geometrySpecLen
g     STRING8          geometrySpec
p               unused,p=pad(6+m+k+t+c+s+g)
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     V/4          length
1     KEYCODE          minKeyCode
1     KEYCODE          maxKeyCode
1     BOOL          loaded
1     BOOL          newKeyboard
2     SETofKB_GBNDETAILMASK          found
2     SETofKB_GBNDETAILMASK          reported
16               unused
V     LISTofITEMs          replies
     SETofKB_GBNDETAILMASK          (reported)
     XkbGBN_Types     map
     XkbGBN_CompatMap     compat
     XkbGBN_ClientSymbols     map
     XkbGBN_ServerSymbols     map
     XkbGBN_IndicatorMap     indicators
     XkbGBN_KeyNames     names
     XkbGBN_OtherNames     names
     XkbGBN_Geometry     geometry
</pre><pre class="literallayout">ITEMs
M     XkbGetMap reply          map
C     XkbGetCompatMap reply          compat
I     XkbGetIndicatorMap reply          indicators
N     XkbGetNames reply          names
G     XkbGetGeometry reply          geometry
</pre><pre class="literallayout">1     CARD8          opcode
1     24          xkb-opcode
2     4          request-length
2     KB_DEVICESPEC           deviceSpec
2     SETofKB_DEVFEATURE          wanted
1     BOOL          allButtons
1     CARD8          firstButton
1     CARD8          nButtons
1               unused
2     KB_LEDCLASSSPEC          ledClass
2     KB_IDSPEC          ledID
</pre><pre class="literallayout">1     1          Reply
1     CARD8          deviceID
2     CARD16          sequence number
4     (2+n+p+8b+L*)/4          length
2     SETofKB_DEVFEATURE          present
2     SETofKB_FEATURE          supported
2     SETofKB_FEATURE          unsupported
2     l          nDeviceLedFBs
1     CARD8          firstBtnWanted
1     CARD8          nBtnsWanted
1     CARD8          firstBtnRtrn
1     b          nBtnsRtrn
1     CARD8          totalBtns
1     BOOL          hasOwnState
2     SETofKB_IDRESULT          dfltKbdFB
2     SETofKB_IDRESULT          dfltLedFB
2               unused
4     ATOM          devType
2     n          nameLen
n     STRING8          name
p               unused,p=pad(2+n)
8b     LISTofKB_ACTION          btnActions
L0+..Ll     LISTofKB_DEVICELEDINFO          leds
</pre><pre class="literallayout">KB_DEVICELEDINFO     20+4n+12m
2     KB_LEDCLASSSPEC          ledClass
2     KB_IDSPEC          ledID
4     SETofKB_INDICATOR          namesPresent (has n bits set to 1)
4     SETofKB_INDICATOR          mapsPresent (has m bits set to 1)
4     SETofKB_INDICATOR          physIndicators
4     SETofKB_INDICATOR          state
4n     LISTofATOM          names
12m     LISTofKB_INDICATORMAP          maps
</pre><pre class="literallayout">1     ??          opcode
1     25          xkb-opcode
2     3+(8b+L*)/4          request-length
2     KB_DEVICESPEC           deviceSpec
1     CARD8          firstBtn
1     b          nBtns
2     SETofKB_DEVFEATURE          change
2     l          nDeviceLedFBs
8b     LISTofKB_ACTION          btnActions
L0+..Ll     LISTofKB_DEVICELEDINFO          leds
     Encoding of KB_DEVICELEDINFO is as for XkbGetDeviceInfo
</pre><pre class="literallayout">1     ??          opcode
1     101          xkb-opcode
2     6+(n+p)/4          request-length
2     n          msgLength
2               unused
4     CARD32          affectFlags
4     CARD32          flags
4     CARD32          affectCtrls
4     CARD32          ctrls
n     STRING8          message
p               unused, p=pad(n)
</pre><pre class="literallayout">1     1          Reply
1               unused
2     CARD16          sequence number
4     0          length
4     CARD32          currentFlags
4     CARD32          currentCtrls
4     CARD32          supportedFlags
4     CARD32          supportedCtrls
8               unused
</pre></div><div class="sect1" title="Events"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appD::Events"></a>Events</h2></div></div></div><pre class="literallayout">1     ??          code
1     0          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     CARD8          oldDeviceID
1     KEYCODE          minKeyCode
1     KEYCODE          maxKeyCode
1     KEYCODE          oldMinKeyCode
1     KEYCODE          oldMaxKeyCode
1     CARD8          requestMajor
1     CARD8          requestMinor
2     SETofKB_NKNDETAIL          changed
14               unused
</pre><pre class="literallayout">1     ??          code
1     1          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     SETofBUTMASK          ptrBtnActions
2     SETofKB_MAPPART          changed
1     KEYCODE          minKeyCode
1     KEYCODE          maxKeyCode
1     CARD8          firstType
1     CARD8          nTypes
1     KEYCODE          firstKeySym
1     CARD8          nKeySyms
1     KEYCODE          firstKeyAct
1     CARD8          nKeyActs
1     KEYCODE          firstKeyBehavior
1     CARD8          nKeyBehavior
1     KEYCODE          firstKeyExplicit
1     CARD8          nKeyExplicit
1     KEYCODE          firstModMapKey
1     CARD8          nModMapKeys
1     KEYCODE          firstVModMapKey
1     CARD8          nVModMapKeys
2     SETofKB_VMOD          virtualMods
2               unused
</pre><pre class="literallayout">1     ??          code
1     2          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     SETofKEYMASK          mods
1     SETofKEYMASK          baseMods
1     SETofKEYMASK          latchedMods
1     SETofKEYMASK          lockedMods
1     KB_GROUP          group
2     INT16          baseGroup
2     INT16          latchedGroup
1     KB_GROUP          lockedGroup
1     SETofKEYMASK          compatState
1     SETofKEYMASK          grabMods
1     SETofKEYMASK          compatGrabMods
1     SETofKEYMASK          lookupMods
1     SETofKEYMASK          compatLookupMods
2     SETofBUTMASK          ptrBtnState
2     SETofKB_STATEPART          changed
1     KEYCODE          keycode
1     CARD8          eventType
1     CARD8          requestMajor
1     CARD8          requestMinor
</pre><pre class="literallayout">1     ??          code
1     3          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     CARD8          numGroups
2               unused
4     SETofKB_CONTROL          changedControls
4     SETofKB_BOOLCTRL          enabledControls
4     SETofKB_BOOLCTRL          enabledControlChanges
1     KEYCODE          keycode
1     CARD8          eventType
1     CARD8          requestMajor
1     CARD8          requestMinor
4               unused
</pre><pre class="literallayout">1     ??          code
1     4          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
3               unused
4     SETofKB_INDICATOR          state
4     SETofKB_INDICATOR          stateChanged
12               unused
</pre><pre class="literallayout">1     ??          code
1     5          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
3               unused
4     SETofKB_INDICATOR          state
4     SETofKB_INDICATOR          mapChanged
12               unused
</pre><pre class="literallayout">1     ??          code
1     6          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1               unused
2     SETofKB_NAMEDETAIL          changed
1     CARD8          firstType
1     CARD8          nTypes
1     CARD8          firstLevelName
1     CARD8          nLevelNames
1               unused
1     CARD8          nRadioGroups
1     CARD8          nKeyAliases
1     SETofKB_GROUP          changedGroupNames
2     SETofKB_VMOD          changedVirtualMods
1     KEYCODE          firstKey
1     CARD8          nKeys
4     SETofKB_INDICATOR          changedIndicators
4               unused
</pre><pre class="literallayout">1     ??          code
1     7          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     SETofKB_GROUP          changedGroups
2     CARD16          firstSI
2     CARD16          nSI
2     CARD16          nTotalSI
16               unused
</pre><pre class="literallayout">1     ??          code
1     8          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     KB_BELLCLASSRESULT          bellClass
1     CARD8          bellID
1     CARD8          percent
2     CARD16          pitch
2     CARD16          duration
4     ATOM          name
4     WINDOW          window
1     BOOL          eventOnly
7               unused
</pre><pre class="literallayout">1     ??          code
1     9          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     KEYCODE          keycode
1     BOOL          press
1     BOOL          keyEventFollows
1     SETofKEYMASK          mods
1     KB_GROUP          group
8     STRING8          message
10               unused
</pre><pre class="literallayout">1     ??          code
1     10          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1     KEYCODE          keycode
2     SETofKB_AXNDETAIL          detail
2     CARD16          slowKeysDelay
2     CARD16          debounceDelay
</pre><pre class="literallayout">1     ??          code
16               unused
</pre><pre class="literallayout">1     ??          code
1     11          xkb code
2     CARD16          sequence number
4     TIMESTAMP          time
1     CARD8          deviceID
1               unused
2     SETofKB_XIDETAIL          reason
2     KB_LEDCLASSRESULT          ledClass
2     CARD8          ledID
4     SETofKB_INDICATOR          ledsDefined
4     SETofKB_INDICATOR          ledState
1     CARD8          firstButton
1     CARD8          nButtons
2     SETofKB_XIFEATURE          supported
2     SETofKB_XIFEATURE          unsupported
2               unused
</pre></div></div></div></body></html>