blob: 6f88e9a5a22d5694e83e72270b0466c0d8cb493a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" href="http://www.unicode.org/reports/reports.css"
type="text/css">
<title>UTS #35: Unicode LDML: Keyboards</title>
<style type="text/css">
<!--
.dtd {
font-family: monospace;
font-size: 90%;
background-color: #CCCCFF;
border-style: dotted;
border-width: 1px;
}
.xmlExample {
font-family: monospace;
font-size: 80%
}
.blockedInherited {
font-style: italic;
font-weight: bold;
border-style: dashed;
border-width: 1px;
background-color: #FF0000
}
.inherited {
font-weight: bold;
border-style: dashed;
border-width: 1px;
background-color: #00FF00
}
.element {
font-weight: bold;
color: red;
}
.attribute {
font-weight: bold;
color: maroon;
}
.attributeValue {
font-weight: bold;
color: blue;
}
li, p {
margin-top: 0.5em;
margin-bottom: 0.5em
}
h2, h3, h4, table {
margin-top: 1.5em;
margin-bottom: 0.5em;
}
-->
</style>
</head>
<body>
<table class="header" width="100%">
<tr>
<td class="icon"><a href="http://unicode.org"> <img
alt="[Unicode]" src="http://unicode.org/webscripts/logo60s2.gif"
width="34" height="33"
style="vertical-align: middle; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px; border-top-width: 0px;"></a>&nbsp;
<a class="bar" href="http://www.unicode.org/reports/">Technical
Reports</a></td>
</tr>
<tr>
<td class="gray">&nbsp;</td>
</tr>
</table>
<div class="body">
<h2 style="text-align: center">
Unicode Technical
Standard #35
</h2>
<h1>
Unicode Locale Data Markup Language (LDML)<br>Part 7: Keyboards
</h1>
<!-- This header table should be identical across the parts of this UTS. -->
<table border="1" cellpadding="2" cellspacing="0" class="wide">
<tr>
<td>Version</td>
<td>32</td>
</tr>
<tr>
<td>Editors</td>
<td>Steven Loomis (<a href="mailto:srl@icu-project.org">srl@icu-project.org</a>)
and <a href="tr35.html#Acknowledgments">other CLDR committee
members</a></td>
</tr>
</table>
<p>
For the full header, summary, and status, see <a href="tr35.html">
Part 1: Core</a>
</p>
<h3>
<i>Summary</i>
</h3>
<p>
This document describes parts of an XML format (<i>vocabulary</i>)
for the exchange of structured locale data. This format is used in
the <a href="http://cldr.unicode.org/">Unicode Common Locale Data
Repository</a>.
</p>
<p>
This is a partial document, describing keyboard mappings. For the
other parts of the LDML see the <a href="tr35.html">main LDML
document</a> and the links above.
</p>
<h3>
<i>Status</i>
</h3>
<!-- NOT YET APPROVED
<p>
<i class="changed">This is a<b><font color="#ff3333">
draft </font></b>document which may be updated, replaced, or superseded by
other documents at any time. Publication does not imply endorsement
by the Unicode Consortium. This is not a stable document; it is
inappropriate to cite this document as other than a work in
progress.
</i>
</p>
END NOT YET APPROVED -->
<!-- APPROVED -->
<p>
<i>This document has been reviewed by Unicode members and other
interested parties, and has been approved for publication by the
Unicode Consortium. This is a stable document and may be used as
reference material or cited as a normative reference by other
specifications.</i>
</p>
<!-- END APPROVED -->
<blockquote>
<p>
<i><b>A Unicode Technical Standard (UTS)</b> is an independent
specification. Conformance to the Unicode Standard does not imply
conformance to any UTS.</i>
</p>
</blockquote>
<p>
<i>Please submit corrigenda and other comments with the CLDR bug
reporting form [<a href="tr35.html#Bugs">Bugs</a>]. Related
information that is useful in understanding this document is found
in the <a href="tr35.html#References">References</a>. For the latest
version of the Unicode Standard see [<a href="tr35.html#Unicode">Unicode</a>].
For a list of current Unicode Technical Reports see [<a
href="tr35.html#Reports">Reports</a>]. For more information about
versions of the Unicode Standard, see [<a href="tr35.html#Versions">Versions</a>].
</i>
</p>
<h2>
<a name="Parts" href="#Parts">Parts</a>
</h2>
<!-- This section of Parts should be identical in all of the parts of this UTS. -->
<p>The LDML specification is divided into the following parts:</p>
<ul class="toc">
<li>Part 1: <a href="tr35.html#Contents">Core</a> (languages,
locales, basic structure)
</li>
<li>Part 2: <a href="tr35-general.html#Contents">General</a>
(display names &amp; transforms, etc.)
</li>
<li>Part 3: <a href="tr35-numbers.html#Contents">Numbers</a>
(number &amp; currency formatting)
</li>
<li>Part 4: <a href="tr35-dates.html#Contents">Dates</a> (date,
time, time zone formatting)
</li>
<li>Part 5: <a href="tr35-collation.html#Contents">Collation</a>
(sorting, searching, grouping)
</li>
<li>Part 6: <a href="tr35-info.html#Contents">Supplemental</a>
(supplemental data)
</li>
<li>Part 7: <a href="tr35-keyboards.html#Contents">Keyboards</a>
(keyboard mappings)
</li>
</ul>
<h2>
<a name="Contents" href="#Contents">Contents of Part 7, Keyboards</a>
</h2>
<!-- START Generated TOC: CheckHtmlFiles -->
<ul class="toc">
<li>1 <a href="#Introduction">Keyboards</a></li>
<li>2 <a href="#Goals_and_Nongoals">Goals and Nongoals</a></li>
<li>3 <a href="#Definitions">Definitions</a></li>
<li>4 <a href="#File_and_Dir_Structure">File and Directory
Structure</a></li>
<li>5 <a href="#Element_Heirarchy_Layout_File">Element
Hierarchy - Layout File</a>
<ul class="toc">
<li>5.1 <a href="#Element_Keyboard">Element: keyboard</a></li>
<li>5.2 <a href="#Element_version">Element: version</a></li>
<li>5.3 <a href="#Element_generation">Element: generation</a></li>
<li>5.4 <a href="#Element_names">Element: names</a></li>
<li>5.5 <a href="#Element_name">Element: name</a></li>
<li>5.6 <a href="#Element_settings">Element: settings</a></li>
<li>5.7 <a href="#Element_keyMap">Element: keyMap</a>
<ul class="toc">
<li>Table: <a href="#Possible_Modifier_Keys">Possible
Modifier Keys</a></li>
</ul>
</li>
<li>5.8 <a href="#Element_map">Element: map</a></li>
<li>5.9 <a href="#Element_transforms">Element: transforms</a></li>
<li>5.10 <a href="#Element_transform">Element: transform</a></li>
</ul>
</li>
<li>6 <a href="#Element_Heirarchy_Platform_File">Element
Hierarchy - Platform File</a>
<ul class="toc">
<li>6.1 <a href="#Element_platform">Element: platform</a></li>
<li>6.2 <a href="#Element_hardwareMap">Element:
hardwareMap</a></li>
<li>6.3 <a href="#Element_hardwareMap_map">Element: map</a></li>
</ul>
</li>
<li>7 <a href="#Invariants">Invariants</a></li>
<li>8 <a href="#Data_Sources">Data Sources</a>
<ul class="toc">
<li>Table: <a href="#Key_Map_Data_Sources">Key Map Data
Sources</a></li>
</ul>
</li>
<li>9 <a href="#Keyboard_IDs">Keyboard IDs</a>
<ul class="toc">
<li>9.1 <a href="#Principles_for_Keyboard_Ids">Principles
for Keyboard Ids</a></li>
</ul>
</li>
<li>10 <a href="#Platform_Behaviors_in_Edge_Cases">Platform
Behaviors in Edge Cases</a></li>
</ul>
<!-- END Generated TOC: CheckHtmlFiles -->
<h2>
1 <a name="Introduction" href="#Introduction">Keyboards</a><a
name="Keyboards" href="#Keyboards"></a>
</h2>
<p>The CLDR keyboard format provides for the communication of
keyboard mapping data between different modules, and the comparison
of data across different vendors and platforms. The standardized
identifier for keyboards can be used to communicate, internally or
externally, a request for a particular keyboard mapping that is to be
used to transform either text or keystrokes. The corresponding data
can then be used to perform the requested actions.</p>
<p>For example, a web-based virtual keyboard may transform text in
the following way. Suppose the user types a key that produces a
&quot;W&quot; on a qwerty keyboard. A web-based tool using an azerty
virtual keyboard can map that text (&quot;W&quot;) to the text that
would have resulted from typing a key on an azerty keyboard, by
transforming &quot;W&quot; to &quot;Z&quot;. Such transforms are in
fact performed in existing web applications.</p>
<p>The data can also be used in analysis of the capabilities of
different keyboards. It also allows better interoperability by making
it easier for keyboard designers to see which characters are
generally supported on keyboards for given languages.</p>
<p>To illustrate this specification, here is an abridged layout
representing the English US 101 keyboard on the Mac OSX operating
system (with an inserted long-press example). For more complete
examples, and information collected about keyboards, see keyboard
data in XML.</p>
<pre>&lt;keyboard locale=&quot;en-t-k0-osx&quot;&gt;<br> &lt;version platform=&quot;10.4&quot; number=&quot;$Revision: 8294 $&quot; /&gt;<br> &lt;names&gt;<br> &lt;name value=&quot;U.S.&quot; /&gt;<br> &lt;/names&gt;<br> &lt;keyMap&gt;<br> &lt;map iso=&quot;E00&quot; to=&quot;`&quot; /&gt;<br> &lt;map iso=&quot;E01&quot; to=&quot;1&quot; /&gt;<br> &lt;map iso=&quot;D01&quot; to=&quot;q&quot; /&gt;<br> &lt;map iso=&quot;D02&quot; to=&quot;w&quot; /&gt;<br> &lt;map iso=&quot;D03&quot; to=&quot;e&quot; longPress=&quot;é è ê ë&quot; /&gt;<br><br> &lt;/keyMap&gt;<br> &lt;keyMap modifiers=&quot;caps&quot;&gt;<br> &lt;map iso=&quot;E00&quot; to=&quot;`&quot; /&gt;<br> &lt;map iso=&quot;E01&quot; to=&quot;1&quot; /&gt;<br> &lt;map iso=&quot;D01&quot; to=&quot;Q&quot; /&gt;<br> &lt;map iso=&quot;D02&quot; to=&quot;W&quot; /&gt;<br><br> &lt;/keyMap&gt;<br> &lt;keyMap modifiers=&quot;opt&quot;&gt;<br> &lt;map iso=&quot;E00&quot; to=&quot;`&quot; /&gt;<br> &lt;map iso=&quot;E01&quot; to=&quot;¡&quot; /&gt; &lt;!-- key=1 --&gt;<br> &lt;map iso=&quot;D01&quot; to=&quot;œ&quot; /&gt; &lt;!-- key=Q --&gt;<br> &lt;map iso=&quot;D02&quot; to=&quot;∑&quot; /&gt; &lt;!-- key=W --&gt;<br><br> &lt;/keyMap&gt;<br> &lt;transforms type=&quot;simple&quot;&gt;<br> &lt;transform from=&quot;` &quot; to=&quot;`&quot; /&gt;<br> &lt;transform from=&quot;`a&quot; to=&quot;à&quot; /&gt;<br> &lt;transform from=&quot;`A&quot; to=&quot;À&quot; /&gt;<br> &lt;transform from=&quot;´ &quot; to=&quot;´&quot; /&gt;<br> &lt;transform from=&quot;´a&quot; to=&quot;á&quot; /&gt;<br> &lt;transform from=&quot;´A&quot; to=&quot;Á&quot; /&gt;<br> &lt;transform from=&quot;˜ &quot; to=&quot;˜&quot; /&gt;<br> &lt;transform from=&quot;˜a&quot; to=&quot;ã&quot; /&gt;<br> &lt;transform from=&quot;˜A&quot; to=&quot;Ã&quot; /&gt;<br><br> &lt;/transforms&gt;<br>&lt;/keyboard&gt;</pre>
<p>And its associated platform file (which includes the hardware
mapping):</p>
<pre>&lt;platform id=&quot;osx&quot;&gt;<br> &lt;hardwareMap&gt;<br> &lt;map keycode=&quot;0&quot; iso=&quot;C01&quot; /&gt;<br> &lt;map keycode=&quot;1&quot; iso=&quot;C02&quot; /&gt;<br> &lt;map keycode=&quot;6&quot; iso=&quot;B01&quot; /&gt;<br> &lt;map keycode=&quot;7&quot; iso=&quot;B02&quot; /&gt;<br> &lt;map keycode=&quot;12&quot; iso=&quot;D01&quot; /&gt;<br> &lt;map keycode=&quot;13&quot; iso=&quot;D02&quot; /&gt;<br> &lt;map keycode=&quot;18&quot; iso=&quot;E01&quot; /&gt;<br> &lt;map keycode=&quot;50&quot; iso=&quot;E00&quot; /&gt;<br> &lt;/hardwareMap&gt;<br>&lt;/platform&gt;</pre>
<h2>
2 <a name="Goals_and_Nongoals" href="#Goals_and_Nongoals">Goals
and Nongoals</a>
</h2>
<p>Some goals of this format are:</p>
<ol>
<li>Make the XML as readable as possible.</li>
<li>Represent faithfully keyboard data from major platforms: it
should be possible to create a functionally-equivalent data file
(such that given any input, it can produce the same output).</li>
<li>Make as much commonality in the data across platforms as
possible to make comparison easy.</li>
</ol>
<p>Some non-goals (outside the scope of the format) currently are:</p>
<ol>
<li>Display names or symbols for keycaps (eg, the German name
for "Return"). If that were added to LDML, it would be in a
different structure, outside the scope of this section.</li>
<li>Advanced IME features, handwriting recognition, etc.</li>
<li>Roundtrip mappings—the ability to recover precisely the same
format as an original platform's representation. In particular, the
internal structure may have no relation to the internal structure of
external keyboard source data, the only goal is functional
equivalence.</li>
<li>More sophisticated transforms, such as for Indic character
rearrangement. It is anticipated that these would be added to a
future version, after working out a reasonable representation.</li>
</ol>
<p>Note: During development of this section, it was considered
whether the modifier RAlt (=AltGr) should be merged with Option. In
the end, they were kept separate, but for comparison across platforms
implementers may choose to unify them.</p>
<h2>
3 <a name="Definitions" href="#Definitions">Definitions</a>
</h2>
<p>Keyboard: The physical keyboard.</p>
<p>Key: A key on a physical keyboard.</p>
<p>Modifier: A key that is held to change the behavior of a
keyboard. For example, the "Shift" key allows access to upper-case
characters on a US keyboard. Other modifier keys include but is not
limited to: Ctrl, Alt, Option, Command and Caps Lock.</p>
<p>Key code: The integer code sent to the application on pressing
a key.</p>
<p>
ISO position: The corresponding position of a key using the ISO
layout convention where rows are identified by letters and columns
are identified by numbers. For example, "D01" corresponds to the "Q"
key on a US keyboard. For the purposes of this document, an ISO
layout position is depicted by a one-letter row identifier followed
by a two digit column number (like "B03", "E12" or "C00"). The
following diagram depicts a typical US keyboard layout superimposed
with the ISO layout indicators (it is important to note that the
number of keys and their physical placement relative to each-other in
this diagram is irrelevant, rather what is important is their logical
placement using the ISO convention):<img
src="images/keyPositions.png"
alt="keyboard layout example showing ISO key numbering">
</p>
<p>One may also extend the notion of the ISO layout to support
keys that don't map directly to the diagram above (such as the
Android device - see diagram). Per the ISO standard, the space bar is
mapped to "A03", so the period and comma keys are mapped to "A02" and
"A04" respectively based on their relative position to the space bar.
Also note that the "E" row does not exist on the Android keyboard.</p>
<p>
<img src="images/androidKeyboard.png"
alt="keyboard layout example showing extension of ISO key numbering">
</p>
<p>If it becomes necessary in the future, the format could extend
the ISO layout to support keys that are located to the left of the
"00" column by using negative column numbers "-01", "-02" and so on,
or 100's complement "99", "98",...</p>
<p>Hardware map: A mapping between key codes and ISO layout
positions.</p>
<p>Base character: The character emitted by a particular key when
no modifiers are active. In ISO terms, this is group 1, level 1.</p>
<p>Base map: A mapping from the ISO positions to the base
characters. There is only one base map per layout. The characters on
this map can be output by not using any modifier keys.</p>
<p>Key map: The basic mapping between ISO positions and the output
characters for each set of modifier combinations associated with a
particular layout. There may be multiple key maps for each layout.</p>
<p>Transform: A transform is simply a combination of key presses
that gets transformed into one (or more) final characters. For
example, in most latin keyboards hitting the "^" dead-key followed by
the "e" key produces "ê".</p>
<p>Layout: A layout is the overall keyboard configuration for a
particular locale. Within a keyboard layout, there is a single base
map, one or more key maps and one or more transforms.</p>
<h2>
4 <a name="File_and_Dir_Structure" href="#File_and_Dir_Structure">File
and Directory Structure</a>
</h2>
<p>Each platform has its own directory, where a "platform" is a
designation for a set of keyboards available from a particular
source, such as Windows or Chromeos. This directory name is the
platform name (see Table 2 located further in the document). Within
this directory there are two types of files:</p>
<ol>
<li>A single platform file (see XML structure for Platform
file), this file includes a mapping of hardware key codes to the ISO
layout positions. This file is also open to expansion for any
configuration elements that are valid across the whole platform and
that are not layout specific. This file is simply called
_platform.xml.</li>
<li>Multiple layout files named by their locale identifiers.
(eg. lt-t-k0-chromeos.xml or ne-t-k0-windows.xml).</li>
</ol>
<p>Keyboard data that is not supported on a given platform, but
intended for use with that platform, may be added to the directory
/und/. For example, there could be a file /und/lt-t-k0-chromeos.xml,
where the data is intended for use with ChromeOS, but does not
reflect data that is distributed as part of a standard ChromeOS
release.</p>
<h2>
5 <a name="Element_Heirarchy_Layout_File"
href="#Element_Heirarchy_Layout_File">Element Hierarchy - Layout
File</a>
</h2>
<h3>
5.1 <a name="Element_Keyboard" href="#Element_Keyboard">Element:
keyboard</a>
</h3>
<p>This is the top level element. All other elements defined below
are under this element.</p>
<p>Syntax</p>
<p>&lt;keyboard locale=&quot;{locale ID}&quot;&gt;</p>
<p>{definition of the layout as described by the elements defined
below}</p>
<p>&lt;/keyboard&gt;</p>
<p>Attribute: locale (required)</p>
<p>
This mandatory attribute represents the locale of the keyboard using
Unicode locale identifiers (see <a href="tr35.html">LDML</a>) - for
example &#39;el&#39; for Greek. Sometimes, the locale may not specify
the base language. For example, a Devanagari keyboard for many
languages could be specified by BCP-47 code: 'und-Deva'. For details,
see <a href="#Keyboard_IDs">Keyboard IDs</a> .
</p>
<p>Examples (for illustrative purposes only, not indicative of the
real data)</p>
<pre>&lt;keyboard locale=&quot;ka-t-k0-qwerty-windows&quot;&gt;
&lt;/keyboard&gt;
&lt;keyboard locale=&quot;fr-CH-t-k0-android&quot;&gt;
&lt;/keyboard&gt;</pre>
<hr>
<h3>
5.2 <a name="Element_version" href="#Element_version">Element:
version</a>
</h3>
<p>
Element used to keep track of the source data version.<br> <br>
Syntax
</p>
<p>
&lt;version platform=&quot;..&quot; revision=&quot;..&quot;&gt;<br>
</p>
<p>Attribute: platform (required)</p>
<p>The platform source version. Specifies what version of the
platform the data is from. For example, data from Mac OSX 10.4 would
be specified as platform=&quot;10.4&quot;. For platforms that have
unstable version numbers which change frequently (like Linux), this
field is set to an integer representing the iteration of the data
starting with "1". This number would only increase if there were any
significant changes in the keyboard data.</p>
<p>Attribute: number (required)</p>
<p>The data revision version.</p>
<p>Attribute: cldrVersion (fixed by DTD)</p>
<p>The CLDR specification version that is associated with this
data file. This value is fixed and is inherited from the DTD file and
therefore does not show up directly in the XML file.</p>
<p>Example</p>
<p>&lt;keyboard locale=&quot;..-osx&quot;&gt;</p>
<p></p>
<p>&lt;version platform=&quot;10.4&quot; number=&quot;1&quot;/&gt;</p>
<p></p>
<p>&lt;/keyboard&gt;</p>
<hr>
<h3>
5.3 <a name="Element_generation" href="#Element_generation">Element:
generation</a>
</h3>
<p>
The generation element is now deprecated. It was used to keep track
of the generation date of the data.<br> <br> Syntax
</p>
<p>
&lt;generation date=&quot;..&quot;&gt;<br>
</p>
<p>Attribute: date (required)</p>
<p>The date the data was generated.</p>
<p>Example</p>
<p>&lt;keyboard locale=&quot;..&quot;&gt;</p>
<p></p>
<!-- This appears to be intentionally left in, as a removed item for demonstration. -->
<p class="removed">&lt;generation date=&quot;$Date: 2013-03-09
01:08:49 -0800 (Sat, 09 Mar 2013) $&quot;/&gt;</p>
<p></p>
<p>&lt;/keyboard&gt;</p>
<hr>
<h3>
5.4 <a name="Element_names" href="#Element_names">Element: names</a>
</h3>
<p>
Element used to store any names given to the layout by the platform.<br>
<br> Syntax
</p>
<p>&lt;names&gt;</p>
<p>{set of name elements}</p>
<p>
&lt;/names&gt;<br>
</p>
<h3>
5.5 <a name="Element_name" href="#Element_name">Element: name</a>
</h3>
<p>
A single name given to the layout by the platform.<br> <br>
Syntax
</p>
<p>
&lt;name value=&quot;..&quot;&gt;<br>
</p>
<p>Attribute: value (required)</p>
<p>The name of the layout.</p>
<p>Example</p>
<p>&lt;keyboard
locale=&quot;bg-t-k0-windows-phonetic-trad&quot;&gt;</p>
<p></p>
<p>&lt;names&gt;</p>
<p>&lt;name value=&quot;Bulgarian (Phonetic
Traditional)&quot;/&gt;</p>
<p>&lt;/names&gt;</p>
<p></p>
<p>&lt;/keyboard&gt;</p>
<hr>
<h3>
5.6 <a name="Element_settings" href="#Element_settings">Element:
settings</a>
</h3>
<p>
An element used to keep track of layout specific settings. This
element may or may not show up on a layout. These settings reflect
the normal practice on the platform. However, an implementation using
the data may customize the behavior. For example, for
transformFailures the implementation could ignore the setting, or
modify the text buffer in some other way (such as by emitting
backspaces).<br> <br> Syntax
</p>
<p>
&lt;settings [fallback=&quot;omit&quot;]
[transformFailure=&quot;omit&quot;]
[transformPartial=&quot;hide&quot;]&gt;<br>
</p>
<p>Attribute: fallback=&quot;omit&quot; (optional)</p>
<p>The presence of this attribute means that when a modifier key
combination goes unmatched, no output is produced. The default
behavior (when this attribute is not present) is to fallback to the
base map when the modifier key combination goes unmatched.</p>
<p>If this attribute is present, it must have a value of omit.</p>
<p>Attribute: transformFailure=&quot;omit&quot; (optional)</p>
<p>This attribute describes the behavior of a transform when it is
escaped (see the transform element in the Layout file for more
information). A transform is escaped when it can no longer continue
due to the entry of an invalid key. For example, suppose the
following set of transforms are valid:</p>
<blockquote>
<p>^e → ê</p>
<p>^a → â</p>
</blockquote>
<p>Suppose a user now enters the "^" key then "^" is now stored in
a buffer and may or may not be shown to the user (see the partial
attribute).</p>
<p>If a user now enters d, then the transform has failed and there
are two options for output.</p>
<p>1. default behavior - "^d"</p>
<p>2. omit - "" (nothing and the buffer is cleared)</p>
<p>The default behavior (when this attribute is not present) is to
emit the contents of the buffer upon failure of a transform.</p>
<p>If this attribute is present, it must have a value of omit.</p>
<p>Attribute: transformPartial=&quot;hide&quot; (optional)</p>
<p>This attribute describes the behavior the system while in a
transform. When this attribute is present then don't show the values
of the buffer as the user is typing a transform (this behavior can be
seen on Windows or Linux platforms).</p>
<p>By default (when this attribute is not present), show the
values of the buffer as the user is typing a transform (this behavior
can be seen on the Mac OSX platform).</p>
<p>If this attribute is present, it must have a value of hide.</p>
<p>Example</p>
<p>&lt;keyboard
locale=&quot;bg-t-k0-windows-phonetic-trad&quot;&gt;</p>
<p></p>
<p>&lt;settings fallback=&quot;omit&quot;
transformPartial=&quot;hide&quot;&gt;</p>
<p></p>
<p>&lt;/keyboard&gt;</p>
<p>Indicates that:</p>
<ol>
<li>When a modifier combination goes unmatched, do not output
anything when a key is pressed.</li>
<li>If a transform is escaped, output the contents of the
buffer.</li>
<li>During a transform, hide the contents of the buffer as the
user is typing.</li>
</ol>
<hr>
<h3>
5.7 <a name="Element_keyMap" href="#Element_keyMap">Element:
keyMap</a>
</h3>
<p>This element defines the group of mappings for all the keys
that use the same set of modifier keys. It contains one or more map
elements.</p>
<p>Syntax</p>
<p>&lt;keyMap [modifiers=&quot;{Set of Modifier
Combinations}&quot;]&gt;</p>
<p>{a set of map elements}</p>
<p>&lt;/keyMap&gt;</p>
<p>Attribute: modifiers (optional)</p>
<p>
A set of modifier combinations that cause this key map to be
"active". Each combination is separated by a space. The
interpretation is that there is a match if any of the combinations
match, that is, they are ORed. Therefore, the order of the
combinations within this attribute does not matter.<br> <br>
A combination is simply a concatenation of words to represent the
simultaneous activation of one or more modifier keys. The order of
the modifier keys within a combination does not matter, although
don't care cases are generally added to the end of the string for
readability (see next paragraph). For example: "cmd+caps" represents
the Caps Lock and Command modifier key combination. Some keys have
right or left variant keys, specified by a 'R' or 'L' suffix. For
example: "ctrlR+caps" would represent the Right-Control and Caps Lock
combination. For simplicity, the presence of a modifier without a 'R'
or 'L' suffix means that either its left or right variants are valid.
So "ctrl+caps" represents the same as "ctrlL+ctrlR?+caps
ctrlL?+ctrlR+caps"
</p>
<p>A modifier key may be further specified to be in a "don't care"
state using the '?' suffix. The "don't care" state simply means that
the preceding modifier key may be either ON or OFF. For example
"ctrl+shift?" could be expanded into "ctrl ctrl+shift".</p>
<p>Within a combination, the presence of a modifier WITHOUT the
'?' suffix indicates this key MUST be on. The converse is also true,
the absence of a modifier key means it MUST be off for the
combination to be active.</p>
<p>Here is an exhaustive list of all possible modifier keys:</p>
<p>Possible Modifier Keys</p>
<table cellpadding="0" cellspacing="0" border='1'>
<caption>
<a name="Possible_Modifier_Keys" href="#Possible_Modifier_Keys">Possible
Modifier Keys</a>
</caption>
<tbody>
<tr>
<td><p>Modifier Keys</p></td>
<td>&nbsp;</td>
<td><p>Comments</p></td>
</tr>
<tr>
<td><p>altL</p></td>
<td><p>altR</p></td>
<td><p>xAlty → xAltR+AltL? xAltR?AltLy</p></td>
</tr>
<tr>
<td><p>ctrlL</p></td>
<td><p>ctrlR</p></td>
<td><p>ditto for Ctrl</p></td>
</tr>
<tr>
<td><p>shiftL</p></td>
<td><p>shiftR</p></td>
<td><p>ditto for Shift</p></td>
</tr>
<tr>
<td><p>optL</p></td>
<td><p>optR</p></td>
<td><p>ditto for Opt</p></td>
</tr>
<tr>
<td><p>caps</p></td>
<td>&nbsp;</td>
<td><p>Caps Lock</p></td>
</tr>
<tr>
<td><p>cmd</p></td>
<td>&nbsp;</td>
<td><p>Command on the Mac</p></td>
</tr>
</tbody>
</table>
<p>All sets of modifier combinations within a layout are disjoint
with no-overlap existing between the key maps. That is, for every
possible modifier combination, there is at most a single match within
the layout file. There are thus never multiple matches. If no exact
match is available, the match falls back to the base map unless the
fallback=&quot;omit&quot; attribute in the settings element is set,
in which case there would be no output at all.</p>
<p>To illustrate, the following example produces an invalid layout
because pressing the "Ctrl" modifier key produces an indeterminate
result:</p>
<p>&lt;keyMap modifiers=&quot;ctrl+shift?&quot;&gt;</p>
<p></p>
<p>&lt;/keyMap&gt;</p>
<p>&lt;keyMap modifiers=&quot;ctrl&quot;&gt;</p>
<p></p>
<p>&lt;/keyMap&gt;</p>
<p>Modifier Examples:</p>
<p>&lt;keyMap modifiers=&quot;cmd?+opt+caps?+shift&quot; /&gt;</p>
<p>Caps-Lock may be ON or OFF, Option must be ON, Shift must be ON
and Command may be ON or OFF.</p>
<p>&lt;keyMap modifiers=&quot;shift caps&quot;
fallback=&quot;true&quot; /&gt;</p>
<p>Caps-Lock must be ON OR Shift must be ON. Is also the fallback
key map.</p>
<p>If the modifiers attribute is not present on a keyMap then that
particular key map is the base map.</p>
<h3>
5.8 <a name="Element_map" href="#Element_map">Element: map</a>
</h3>
<p>This element defines a mapping between the base character and
the output for a particular set of active modifier keys. This element
must have the keyMap element as its parent.</p>
<p>If a map element for a particular ISO layout position has not
been defined then if this key is pressed, no output is produced.</p>
<p>Syntax</p>
<pre>&lt;map
iso=&quot;{the iso position}&quot;
to=&quot;{the output}&quot;
[longPress=&quot;{long press keys}&quot;]
[transform=&quot;no&quot;]
/&gt;&lt;!-- {Comment to improve readability (if needed)} --&gt;</pre>
<p>Attribute: iso (exactly one of base and iso is required)</p>
<p>The iso attribute represents the ISO layout position of the key
(see the definition at the beginning of the document for more
information).</p>
<p>Attribute: to (required)</p>
<p>The to attribute contains the output sequence of characters
that is emitted when pressing this particular key. Control
characters, whitespace (other than the regular space character) and
combining marks in this attribute are escaped using the \u{...}
notation.</p>
<p>Attribute: longPress (optional)</p>
<p>The longPress attribute contains any characters that can be
emitted by "long-pressing" a key, this feature is prominent in mobile
devices. The possible sequences of characters that can be emitted are
whitespace delimited. Control characters, combining marks and
whitespace (which is intended to be a long-press option) in this
attribute are escaped using the \u{...} notation.</p>
<p>Attribute: transform=&quot;no&quot; (optional)</p>
<p>The transform attribute is used to define a key that never
participates in a transform but its output shows up as part of a
transform. This attribute is necessary because two different keys
could output the same characters (with different keys or modifier
combinations) but only one of them is intended to be a dead-key and
participate in a transform. This attribute value must be no if it is
present.</p>
<p>For example, suppose there are the following keys, their output
and one transform:</p>
<blockquote>
<p>E00 outputs `</p>
<p>Option+E00 outputs ` (the dead-version which participates in
transforms).</p>
<p>`e → è</p>
</blockquote>
<p>Then the first key must be tagged with transform=&quot;no&quot;
to indicate that it should never participate in a transform.</p>
<p>Comment: US key equivalent, base key, escaped output and
escaped longpress</p>
<p>In the generated files, a comment is included to help the
readability of the document. This comment simply shows the English
key equivalent (with prefix key=), the base character (base=), the
escaped output (to=) and escaped long-press keys (long=). These
comments have been inserted strategically in places to improve
readability. Not all comments include include all components since
some of them may be obvious.</p>
<p>Examples</p>
<pre>&lt;keyboard locale=&quot;fr-BE-t-k0-windows&quot;&gt;<br><br> &lt;keyMap modifiers=&quot;shift&quot;&gt;<br> &lt;map iso=&quot;D01&quot; to=&quot;A&quot; /&gt; &lt;!-- key=Q --&gt;<br> &lt;map iso=&quot;D02&quot; to=&quot;Z&quot; /&gt; &lt;!-- key=W --&gt;<br> &lt;map iso=&quot;D03&quot; to=&quot;E&quot; /&gt;<br> &lt;map iso=&quot;D04&quot; to=&quot;R&quot; /&gt;<br> &lt;map iso=&quot;D05&quot; to=&quot;T&quot; /&gt;<br> &lt;map iso=&quot;D06&quot; to=&quot;Y&quot; /&gt;<br><br> &lt;/keyMap&gt;<br><br>&lt;/keyboard&gt;<br>&lt;keyboard locale=&quot;ps-t-k0-windows&quot;&gt;<br><br> &lt;keyMap modifiers='altR+caps? ctrl+alt+caps?'&gt;<br> &lt;map iso=&quot;D04&quot; to=&quot;\u{200e}&quot; /&gt; &lt;!-- key=R base=ق --&gt;<br> &lt;map iso=&quot;D05&quot; to=&quot;\u{200f}&quot; /&gt; &lt;!-- key=T base=ف --&gt;<br> &lt;map iso=&quot;D08&quot; to=&quot;\u{670}&quot; /&gt; &lt;!-- key=I base=ه to= ٰ --&gt;<br><br> &lt;/keyMap&gt;<br><br>&lt;/keyboard&gt;</pre>
<hr>
<h3>
5.9 <a name="Element_transforms" href="#Element_transforms">Element:
transforms</a>
</h3>
<p>This element defines a group of one or more transform elements
associated with this keyboard layout. This is used to support
dead-keys using a straightforward structure that works for all the
keyboards tested, and that results in readable source data.</p>
<p>There can be multiple &lt;transforms&gt; elements; at this
point the "simple" one is defined.</p>
<p>Syntax</p>
<p>&lt;transforms type=&quot;...&quot;&gt;</p>
<p>{a set of transform elements}</p>
<p>&lt;/transforms&gt;</p>
<p>Attribute: type (required)</p>
<p>The value is "simple" for the transforms listed below. People
have legitimate needs for more complex transforms, and more
sophisticated types of transforms may be added over time. (Doing the
more sophisticated transforms would take much more time, since it
would require a thorough survey of the major keyboard mechanisms that
use them, development of a unified mechanism that handles all the
requirements, and coding to ensure sure programmatically mapping
those mechanisms into the standard is possible, and so on.)</p>
<h3>
5.10 <a name="Element_transform" href="#Element_transform">Element:
transform</a>
</h3>
<p>This element must have the transforms element as its parent.
This element represents a single transform that may be performed
using the keyboard layout. A transform is simply a combination of key
presses that gets transformed into one (or more) final characters.
For example, in most French keyboards hitting the "^" dead-key
followed by the "e" key produces "ê".</p>
<p>Syntax</p>
<p>&lt;transform from="{combination of characters}"
to="{output}"&gt;</p>
<p>Attribute: from (required)</p>
<p>This is the combination of keys that must be pressed in order
to activate this transform. Each character in this series of
characters must match a character that is located in some chars
attribute in the document.</p>
<p>For example, suppose there are the following transforms:</p>
<blockquote>
<p>^e → ê</p>
<p>^a → â</p>
<p>^o → ô</p>
</blockquote>
<p>If the user types a key that produces "^", the keyboard enters
a dead state. When the user then types a key that produces an "e",
the transform is invoked, and "ê" is output. Suppose a user presses
keys producing "^" then "u". In this case, there is no match for the
"^u", and the "^" is output if the failure attribute in the transform
element is set to emit. If there is no transform starting with "u",
then it is also output (again only if failure is set to emit) and the
mechanism leaves the "dead" state.</p>
<p>The UI may show an initial sequence of matching characters with
a special format, as is done with dead-keys on the Mac, and modify
them as the transform completes. This behavior is specified in the
partial attribute in the transform element.</p>
<p>Most transforms in practice have only a couple of characters.
But for completeness, the behavior is defined on all strings:</p>
<ol>
<li>If there could be a longer match if the user were to type
additional keys, go into a 'dead' state.</li>
<li>If there could not be a longer match, find the longest
actual match, emit the transformed text (if failure is set to emit),
and start processing again with the remainder.</li>
<li>If there is no possible match, output the first character,
and start processing again with the remainder.</li>
</ol>
<p>Suppose that there is the following transforms:</p>
<blockquote>
<p>ab → x</p>
<p>abc → y</p>
<p>abef → z</p>
<p>bc → m</p>
<p>beq → n</p>
</blockquote>
<p>Here's what happens when the user types various sequence
characters:</p>
<table cellpadding="0" cellspacing="0" border='1'>
<!-- nocaption -->
<tbody>
<tr>
<td><p>Input characters</p></td>
<td><p>Result</p></td>
<td><p>Comments</p></td>
</tr>
<tr>
<td><p>ab</p></td>
<td>&nbsp;</td>
<td><p>No output, since there is a longer transform with
this as prefix.</p></td>
</tr>
<tr>
<td><p>abc</p></td>
<td><p>y</p></td>
<td><p>Complete transform match.</p></td>
</tr>
<tr>
<td><p>abd</p></td>
<td><p>xd</p></td>
<td><p>The longest match is "ab", so that is converted and
output. The 'd' follows, since it is not the start of any
transform.</p></td>
</tr>
<tr>
<td><p>abeq</p></td>
<td><p>xeq</p></td>
<td><p>"ab" wins over "beq", since it comes first. That
is, there is no longer possible match starting with 'a'.</p></td>
</tr>
<tr>
<td><p>bc</p></td>
<td><p>m</p></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>Control characters, combining marks and whitespace in this
attribute are escaped using the \u{...} notation.</p>
<p>Attribute: to (required)</p>
<p>This attribute represents the characters that are output from
the transform. This may be more than one, so you could have
&lt;transform from=&quot;´A&quot; to=&quot;Fred&quot;/&gt;</p>
<p>Control characters, whitespace (other than the regular space
character) and combining marks in this attribute are escaped using
the \u{...} notation.</p>
<p>Examples</p>
<pre>&lt;keyboard locale=&quot;fr-CA-t-k0-CSA-osx&quot;&gt;<br> &lt;transforms type=&quot;simple&quot;&gt;<br> &lt;transform from=&quot;´a&quot; to=&quot;á&quot; /&gt;<br> &lt;transform from=&quot;´A&quot; to=&quot;Á&quot; /&gt;<br> &lt;transform from=&quot;´e&quot; to=&quot;é&quot; /&gt;<br> &lt;transform from=&quot;´E&quot; to=&quot;É&quot; /&gt;<br> &lt;transform from=&quot;´i&quot; to=&quot;í&quot; /&gt;<br> &lt;transform from=&quot;´I&quot; to=&quot;Í&quot; /&gt;<br> &lt;transform from=&quot;´o&quot; to=&quot;ó&quot; /&gt;<br> &lt;transform from=&quot;´O&quot; to=&quot;Ó&quot; /&gt;<br> &lt;transform from=&quot;´u&quot; to=&quot;ú&quot; /&gt;<br> &lt;transform from=&quot;´U&quot; to=&quot;Ú&quot; /&gt;<br> &lt;/transforms&gt;<br> ...<br>&lt;/keyboard&gt;<br>&lt;keyboard locale=&quot;nl-BE-t-k0-chromeos&quot;&gt;<br> &lt;transforms type=&quot;simple&quot;&gt;<br> &lt;transform from=&quot;\u{30c}a&quot; to=&quot;ǎ&quot; /&gt; &lt;!-- ̌a → ǎ --&gt;<br> &lt;transform from=&quot;\u{30c}A&quot; to=&quot;Ǎ&quot; /&gt; &lt;!-- ̌A → Ǎ --&gt;<br> &lt;transform from=&quot;\u{30a}a&quot; to=&quot;å&quot; /&gt; &lt;!-- ̊a → å --&gt;<br> &lt;transform from=&quot;\u{30a}A&quot; to=&quot;Å&quot; /&gt; &lt;!-- ̊A → Å --&gt;<br> &lt;/transforms&gt;<br> ...<br>&lt;/keyboard&gt;</pre>
<h2>
6 <a name="Element_Heirarchy_Platform_File"
href="#Element_Heirarchy_Platform_File">Element Hierarchy -
Platform File</a>
</h2>
<p>There is a separate XML structure for platform-specific
configuration elements. The most notable component is a mapping
between the hardware key codes to the ISO layout positions for that
platform.</p>
<h3>
6.1 <a name="Element_platform" href="#Element_platform">Element:
platform</a>
</h3>
<p>This is the top level element. This element contains a set of
elements defined below. A document shall only contain a single
instance of this element.</p>
<p>Syntax</p>
<p>&lt;platform&gt;</p>
<p>{platform-specific elements}</p>
<p>&lt;/platform&gt;</p>
<h3>
6.2 <a name="Element_hardwareMap" href="#Element_hardwareMap">Element:
hardwareMap</a>
</h3>
<p>This element must have a platform element as its parent. This
element contains a set of map elements defined below. A document
shall only contain a single instance of this element.</p>
<p>Syntax</p>
<pre>&lt;platform&gt;
&lt;hardwareMap&gt;
{a set of map elements}
&lt;/hardwareMap&gt;
&lt;/platform&gt;</pre>
<h3>
6.3 <a name="Element_hardwareMap_map" href="#Element_hardwareMap_map">Element:
map</a>
</h3>
<p>This element must have a hardwareMap element as its parent.
This element maps between a hardware keycode and the corresponding
ISO layout position of the key.</p>
<p>Syntax</p>
<p>&lt;map keycode=&quot;{hardware keycode}&quot; iso=&quot;{ISO
layout position}&quot;/&gt;</p>
<p>Attribute: keycode (required)</p>
<p>The hardware key code value of the key. This value is an
integer which is provided by the keyboard driver.</p>
<p>Attribute: iso (required)</p>
<p>The corresponding position of a key using the ISO layout
convention where rows are identified by letters and columns are
identified by numbers. For example, "D01" corresponds to the "Q" key
on a US keyboard. (See the definition at the beginning of the
document for a diagram).</p>
<p>Examples</p>
<pre>&lt;platform&gt;<br> &lt;hardwareMap&gt;<br> &lt;map keycode=&quot;2&quot; iso=&quot;E01&quot; /&gt;<br> &lt;map keycode=&quot;3&quot; iso=&quot;E02&quot; /&gt;<br> &lt;map keycode=&quot;4&quot; iso=&quot;E03&quot; /&gt;<br> &lt;map keycode=&quot;5&quot; iso=&quot;E04&quot; /&gt;<br> &lt;map keycode=&quot;6&quot; iso=&quot;E05&quot; /&gt;<br> &lt;map keycode=&quot;7&quot; iso=&quot;E06&quot; /&gt;<br> &lt;map keycode=&quot;41&quot; iso=&quot;E00&quot; /&gt;<br> &lt;/hardwareMap&gt;<br>&lt;/platform&gt;</pre>
<h2>
7 <a name="Invariants" href="#Invariants">Invariants</a>
</h2>
<p>Beyond what the DTD imposes, certain other restrictions on the
data are imposed on the data.</p>
<ol>
<li>For a given platform, every map[@iso] value must be in the
hardwareMap if there is one (_keycodes.xml)</li>
<li>Every map[@base] value must also be in base[@base] value</li>
<li>No keyMap[@modifiers] value can overlap with another
keyMap[@modifiers] value.
<ul>
<li>eg you can't have "RAlt Ctrl" in one keyMap, and "Alt
Shift" in another (because Alt = RAltLAlt).</li>
</ul>
</li>
<li>Every sequence of characters in a transform[@from] value
must be a concatenation of two or more map[@to] values.
<ul>
<li>eg with &lt;transform from="xyz" to="q"&gt; there must be
some map values to get there, such as &lt;map... to="xy"&gt; &amp;
&lt;map... to="z"&gt;</li>
</ul>
</li>
<li>There must be either 0 or 1 of (keyMap[@fallback] or
baseMap[@fallback]) attributes</li>
<li>If the base and chars values for modifiers="" are all
identical, and there are no longpresses, that keyMap must not appear
(??)</li>
<li>There will never be overlaps among modifier values.</li>
<li>A modifier set will never have ? (optional) on all values
<ul>
<li>eg, you'll never have RCtrl?Caps?LShift?</li>
</ul>
</li>
<li>Every base[@base] value must be unique.</li>
<li>A modifier attribute value will aways be minimal, observing
the following simplification rules. <br>
</li>
</ol>
<table cellpadding="0" cellspacing="0" border='1'>
<!-- nocaption -->
<tbody>
<tr>
<td><p>Notation</p></td>
<td><p>Notes</p></td>
</tr>
<tr>
<td><p>
Lower case character (eg. <i>x</i> )
</p></td>
<td><p>
Interpreted as any combination of modifiers.<br> (eg. <i>x</i>
= CtrlShiftOption)
</p></td>
</tr>
<tr>
<td><p>
Upper-case character (eg. <i>Y </i>)
</p></td>
<td><p>
Interpreted as a single modifier key (which may or may not have a
L and R variant)<br> (eg. <i>Y</i> = Ctrl, <i>RY</i> =
RCtrl, etc..)
</p></td>
</tr>
<tr>
<td><p>Y? ⇔ Y ∨ ∅</p>
<p>Y ⇔ LY ∨ RY ∨ LYRY</p></td>
<td><p>
Eg. Opt? ⇔ ROpt ∨ LOpt ∨ ROptLOpt ∨ ∅<br> Eg. Opt ⇔ ROpt ∨
LOpt ∨ ROptLOpt
</p></td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" border='1'>
<!-- nocaption -->
<tbody>
<tr>
<td><p>Axiom</p></td>
<td><p>Example</p></td>
</tr>
<tr>
<td><p>xY ∨ x ⇒ xY?</p></td>
<td><p>OptCtrlShift OptCtrl → OptCtrlShift?</p></td>
</tr>
<tr>
<td><p>xRY ∨ xY? ⇒ xY?</p>
<p>xLY ∨ xY? ⇒ xY?</p></td>
<td><p>OptCtrlRShift OptCtrlShift? → OptCtrlShift?</p></td>
</tr>
<tr>
<td><p>xRY? ∨ xY ⇒ xY?</p>
<p>xLY? ∨ xY ⇒ xY?</p></td>
<td><p>OptCtrlRShift? OptCtrlShift → OptCtrlShift?</p></td>
</tr>
<tr>
<td><p>xRY? ∨ xY? ⇒ xY?</p>
<p>xLY? ∨ xY? ⇒ xY?</p></td>
<td><p>OptCtrlRShift? OptCtrlShift? → OptCtrlShift?</p></td>
</tr>
<tr>
<td><p>xRY ∨ xY ⇒ xY</p>
<p>xLY ∨ xY ⇒ xY</p></td>
<td><p>OptCtrlRShift OptCtrlShift → OptCtrlShift?</p></td>
</tr>
<tr>
<td><p>LY?RY?</p></td>
<td><p>OptRCtrl?LCtrl? → OptCtrl?</p></td>
</tr>
<tr>
<td><p>xLY? ⋁ xLY ⇒ xLY?</p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><p>xY? ⋁ xY ⇒ xY?</p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><p>xY? ⋁ x ⇒ xY?</p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><p>xLY? ⋁ x ⇒ xLY?</p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><p>xLY ⋁ x ⇒ xLY?</p></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<h2>
8 <a name="Data_Sources" href="#Data_Sources">Data Sources</a>
</h2>
<p>Here is a list of the data sources used to generate the initial
key map layouts:</p>
<table cellpadding="0" cellspacing="0" border='1'>
<caption>
<a name="Key_Map_Data_Sources" href="#Key_Map_Data_Sources">Key
Map Data Sources</a>
</caption>
<tbody>
<tr>
<td><p>Platform</p></td>
<td><p>Source</p></td>
<td><p>Notes</p></td>
</tr>
<tr>
<td><p>Android</p></td>
<td><p>
Android 4.0 - Ice Cream Sandwich<br> (<a
href="http://source.android.com/source/downloading.html">http://source.android.com/source/downloading.html</a>)
</p></td>
<td><p>Parsed layout files located in
packages/inputmethods/LatinIME/java/res</p></td>
</tr>
<tr>
<td><p>ChromeOS</p></td>
<td><p>
XKB (<a href="http://www.x.org/wiki/XKB">http://www.x.org/wiki/XKB</a>)
</p></td>
<td><p>The ChromeOS represents a very small subset of the
keyboards available from XKB.</p></td>
</tr>
<tr>
<td><p>Mac OSX</p></td>
<td><p>
Ukelele bundled System Keyboards (<a
href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=ukelele">http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=ukelele</a>)
</p></td>
<td><p>These layouts date from Mac OSX 10.4 and are
therefore a bit outdated</p></td>
</tr>
<tr>
<td><p>Windows</p></td>
<td><p>
Generated .klc files from the Microsoft Keyboard Layout Creator (<a
href="http://msdn.microsoft.com/en-us/goglobal/bb964665">http://msdn.microsoft.com/en-us/goglobal/bb964665</a>)
</p></td>
<td><p>
For interactive layouts, see also <a
href="http://msdn.microsoft.com/en-us/goglobal/bb964651">http://msdn.microsoft.com/en-us/goglobal/bb964651</a>
</p></td>
</tr>
</tbody>
</table>
<h2>
9 <a name="Keyboard_IDs" href="#Keyboard_IDs">Keyboard IDs</a>
</h2>
<p>There is a set of subtags that help identify the keyboards.
Each of these are used after the "t-k0" subtags to help identify the
keyboards. The first tag appended is a mandatory platform tag
followed by zero or more tags that help differentiate the keyboard
from others with the same locale code.</p>
<h3>
9.1 <a name="Principles_for_Keyboard_Ids"
href="#Principles_for_Keyboard_Ids">Principles for Keyboard Ids</a>
</h3>
<p>The following are the design principles for the ids.</p>
<ol>
<li>BCP47 compliant.
<ol>
<li>Eg, "en-t-k0-extended".</li>
</ol>
</li>
<li>Use the minimal language id based on likelySubtags.
<ol>
<li>Eg, instead of en-US-t-k0-xxx, use en-t-k0-xxx. Because
there is &lt;likelySubtag from=&quot;en&quot;
to=&quot;en_Latn_US&quot;/&gt;, en-US → en.</li>
<li>The data is in <a
href="http://unicode.org/repos/cldr/tags/latest/common/supplemental/likelySubtags.xml">http://unicode.org/repos/cldr/tags/latest/common/supplemental/likelySubtags.xml</a></li>
</ol>
</li>
<li>The platform goes first, if it exists. If a keyboard on the
platform changes over time, both are dated, eg
bg-t-k0-chromeos-2011. When selecting, if there is no date, it means
the latest one.</li>
<li>Keyboards are only tagged that differ from the "standard for
each platform". That is, for each language on a platform, there will
be a keyboard with no subtags other than the platform.Subtags with a
common semantics across platforms are used, such as '-extended',
-phonetic, -qwerty, -qwertz, -azerty, …</li>
<li>In order to get to 8 letters, abbreviations are reused that
are already in <a
href="http://unicode.org/repos/cldr/tags/latest/common/bcp47/">bcp47</a>
-u/-t extensions and in <a
href="http://www.iana.org/assignments/language-subtag-registry">language-subtag-registry</a>
variants, eg for Traditional use "-trad" or "-traditio" (both exist
in <a href="http://unicode.org/repos/cldr/tags/latest/common/bcp47/">bcp47</a>).
</li>
<li>Multiple languages cannot be indicated, so the predominant
target is used.
<ol>
<li>For Finnish + Sami, use fi-t-k0-smi or extended-smi</li>
</ol>
</li>
<li>In some cases, there are multiple subtags, like
en-US-t-k0-chromeos-intl-altgr.xml</li>
<li>Otherwise, platform names are used as a guide.</li>
</ol>
<h2>
10 <a name="Platform_Behaviors_in_Edge_Cases"
href="#Platform_Behaviors_in_Edge_Cases">Platform Behaviors in
Edge Cases</a>
</h2>
<table cellpadding="0" cellspacing="0" border="1">
<!-- nocaption -->
<tbody>
<tr>
<td><p>Platform</p></td>
<td><p>No modifier combination match is available</p></td>
<td><p>No map match is available for key position</p></td>
<td><p>Transform fails (ie. if ^d is pressed when that
transform does not exist)</p></td>
</tr>
<tr>
<td><p>ChromeOS</p></td>
<td><p>Fall back to base</p></td>
<td><p>
Fall back to character in a keyMap with same "level" of modifier
combination. If this character does not exist, fall back to (n-1)
level. (This is handled data-generation side).<br> In the
spec: No output
</p></td>
<td><p>No output at all</p></td>
</tr>
<tr>
<td><p>Mac OSX</p></td>
<td><p>Fall back to base (unless combination is some sort
of keyboard shortcut, eg. cmd-c)</p></td>
<td><p>No output</p></td>
<td><p>Both keys are output separately</p></td>
</tr>
<tr>
<td><p>Windows</p></td>
<td><p>No output</p></td>
<td><p>No output</p></td>
<td><p>Both keys are output separately</p></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<hr>
<p class="copyright">
Copyright © 2001–2017 Unicode, Inc. All
Rights Reserved. The Unicode Consortium makes no expressed or implied
warranty of any kind, and assumes no liability for errors or
omissions. No liability is assumed for incidental and consequential
damages in connection with or arising out of the use of the
information or programs contained or accompanying this technical
report. The Unicode <a href="http://unicode.org/copyright.html">Terms
of Use</a> apply.
</p>
<p class="copyright">Unicode and the Unicode logo are trademarks
of Unicode, Inc., and are registered in some jurisdictions.</p>
</div>
</body>
</html>