1ea1d6981Smrg<chapter id='Symbolic_Names'> 2ea1d6981Smrg<title>Symbolic Names</title> 3ea1d6981Smrg 4ea1d6981Smrg<para> 5ea1d6981SmrgThe core protocol does not provide any information to clients other than that 6ea1d6981Smrgactually used to interpret events. This makes it difficult to write a client 7ea1d6981Smrgwhich presents the keyboard to a user in an easy-to-understand way. Such 8ea1d6981Smrgapplications have to examine the vendor string and keycodes to determine the 9ea1d6981Smrgtype of keyboard connected to the server and have to examine keysyms and 10ea1d6981Smrgmodifier mappings to determine the effects of most modifiers (the <emphasis> 11ea1d6981SmrgShift</emphasis> 12ea1d6981Smrg, <emphasis> 13ea1d6981SmrgLock</emphasis> 14ea1d6981Smrg and <emphasis> 15ea1d6981SmrgControl</emphasis> 16ea1d6981Smrg modifiers are defined by the core protocol but no semantics are implied for 17ea1d6981Smrgany other modifiers). 18ea1d6981Smrg</para> 19ea1d6981Smrg 20ea1d6981Smrg 21ea1d6981Smrg<para> 22ea1d6981SmrgThis extension provides such applications with symbolic names for most 23ea1d6981Smrgcomponents of the keyboard extension and a description of the physical layout 24ea1d6981Smrgof the keyboard. 25ea1d6981Smrg</para> 26ea1d6981Smrg 27ea1d6981Smrg 28ea1d6981Smrg<para> 29ea1d6981SmrgThe <emphasis> 30ea1d6981Smrgkeycodes</emphasis> 31ea1d6981Smrg name describes the range and meaning of the keycodes returned by the keyboard 32ea1d6981Smrgin question; the <emphasis> 33ea1d6981Smrgkeyboard</emphasis> 34ea1d6981Smrg <emphasis> 35ea1d6981Smrggeometry </emphasis> 36ea1d6981Smrgname describes the physical location, size and shape of the various keys on the 37ea1d6981Smrgkeyboard. As an example to distinguish between these two names, consider 38ea1d6981Smrgfunction keys on PC-compatible keyboards. Function keys are sometimes above the 39ea1d6981Smrgmain keyboard and sometimes to the left of the main keyboard, but the same 40ea1d6981Smrgkeycode is used for the key that is logically <emphasis> 41ea1d6981SmrgF1</emphasis> 42ea1d6981Smrg regardless of physical position. Thus, all PC-compatible keyboards might share 43ea1d6981Smrga keycodes name but different geometry names. 44ea1d6981Smrg</para> 45ea1d6981Smrg 46ea1d6981Smrg<note><para>The keycodes name is intended to be a very general description of 47ea1d6981Smrgthe keycodes returned by a keyboard; A single keycodes name might cover 48ea1d6981Smrgkeyboards with differing numbers of keys provided that the keys that all keys 49ea1d6981Smrghave the same semantics when present. For example, 101 and 102 key PC keyboards 50ea1d6981Smrgmight use the same name. Applications can use the keyboard geometry to 51ea1d6981Smrgdetermine which subset of the named keyboard type is in use.</para></note> 52ea1d6981Smrg 53ea1d6981Smrg<para> 54ea1d6981SmrgThe <emphasis> 55ea1d6981Smrgsymbols</emphasis> 56ea1d6981Smrg name identifies the symbols bound to the keys. The symbols name is a human or 57ea1d6981Smrgapplication-readable description of the intended locale or usage of the 58ea1d6981Smrgkeyboard with these symbols. The <emphasis> 59ea1d6981Smrgphysical symbols</emphasis> 60ea1d6981Smrg name describes the symbols actually engraved on the keyboard, which might be 61ea1d6981Smrgdifferent than the symbols currently being used. 62ea1d6981Smrg</para> 63ea1d6981Smrg 64ea1d6981Smrg 65ea1d6981Smrg<para> 66ea1d6981SmrgThe <emphasis> 67ea1d6981Smrgtypes</emphasis> 68ea1d6981Smrg name provides some information about the set of key types that can be 69ea1d6981Smrgassociated with the keyboard keys. The <emphasis> 70ea1d6981Smrgcompat</emphasis> 71ea1d6981Smrg name provides some information about the rules used to bind actions to keys 72ea1d6981Smrgchanged using core protocol requests. 73ea1d6981Smrg</para> 74ea1d6981Smrg 75ea1d6981Smrg 76ea1d6981Smrg<para> 77ea1d6981SmrgThe <emphasis> 78ea1d6981Smrgcompat</emphasis> 79ea1d6981Smrg, <emphasis> 80ea1d6981Smrgtypes</emphasis> 81ea1d6981Smrg, <emphasis> 82ea1d6981Smrgkeycodes</emphasis> 83ea1d6981Smrg, <emphasis> 84ea1d6981Smrgsymbols</emphasis> 85ea1d6981Smrg and <emphasis> 86ea1d6981Smrggeometry</emphasis> 87ea1d6981Smrg names typically correspond to the keyboard components from which the current 88ea1d6981Smrgkeyboard description was assembled. These components are stored individually in 89ea1d6981Smrgthe server’s database of keyboard components, described in 90ea1d6981Smrg<link linkend='The_Server_Database_of_Keyboard_Components'> 91ea1d6981SmrgThe Server Database of Keyboard 92ea1d6981SmrgComponents</link>, and can be combined to assemble a complete keyboard 93ea1d6981Smrgdescription. 94ea1d6981Smrg</para> 95ea1d6981Smrg 96ea1d6981Smrg 97ea1d6981Smrg<para> 98ea1d6981SmrgEach key has a four-byte symbolic name. The key name links keys with similar 99ea1d6981Smrgfunctions or in similar positions on keyboards that report different scan 100ea1d6981Smrgcodes. <emphasis> 101ea1d6981SmrgKey aliases</emphasis> 102ea1d6981Smrg allow the keyboard layout designer to assign multiple names to a single key, 103ea1d6981Smrgto make it easier to refer to keys using either their position <emphasis> 104ea1d6981Smrgor</emphasis> 105ea1d6981Smrg their "function." 106ea1d6981Smrg</para> 107ea1d6981Smrg 108ea1d6981Smrg 109ea1d6981Smrg<para> 110ea1d6981SmrgFor example, consider the common keyboard customizations: 111ea1d6981Smrg</para> 112ea1d6981Smrg 113ea1d6981Smrg<itemizedlist> 114ea1d6981Smrg<listitem> 115ea1d6981Smrg <para>Set the "key to the left of the letter a" to be a control key. 116ea1d6981Smrg </para> 117ea1d6981Smrg</listitem> 118ea1d6981Smrg<listitem> 119ea1d6981Smrg <para>Change the "caps lock" key, wherever it might be, to a control key. 120ea1d6981Smrg </para> 121ea1d6981Smrg</listitem> 122ea1d6981Smrg</itemizedlist> 123ea1d6981Smrg 124ea1d6981Smrg<para> 125ea1d6981SmrgIf we specify key names by position, the first customization is simple but the 126ea1d6981Smrgsecond is impossible; if we specify key names by function, the second 127ea1d6981Smrgcustomization is simple but the first is impossible. Using key aliases, we can 128ea1d6981Smrgspecify both function and position for "troublesome" keys, and both 129ea1d6981Smrgcustomizations are straightforward. 130ea1d6981Smrg</para> 131ea1d6981Smrg 132ea1d6981Smrg 133ea1d6981Smrg<para> 134ea1d6981SmrgKey aliases can be specified both in the symbolic names component and in the 135ea1d6981Smrgkeyboard geometry (see <link linkend='Keyboard_Geometry'>Keyboard 136ea1d6981SmrgGeometry</link>). Both sets of aliases are always valid, but key alias 137ea1d6981Smrgdefinitions in the keyboard geometry have priority; if both symbolic names and 138ea1d6981Smrggeometry include aliases, applications should consider the definitions from the 139ea1d6981Smrggeometry before considering the definitions from the symbolic names section. 140ea1d6981Smrg</para> 141ea1d6981Smrg 142ea1d6981Smrg 143ea1d6981Smrg<para> 144ea1d6981SmrgXKB provides symbolic names for each of the four keyboard groups, sixteen 145ea1d6981Smrgvirtual modifiers, thirty-two keyboard indicators, and up to <emphasis> 146ea1d6981SmrgMaxRadioGroups</emphasis> 147ea1d6981Smrg (32) radio groups. 148ea1d6981Smrg</para> 149ea1d6981Smrg 150ea1d6981Smrg 151ea1d6981Smrg<para> 152ea1d6981SmrgXKB allows keyboard layout designers or editors to assign names to each key 153ea1d6981Smrgtype and to each of the levels in a key type. For example, the second position 154ea1d6981Smrgon an alphabetic key might be called the "Caps" level while the second position 155ea1d6981Smrgon a numeric keypad key might be called the "Num Lock" level. 156ea1d6981Smrg</para> 157ea1d6981Smrg</chapter> 158