--- a/source_respec.htm Tue May 27 12:31:33 2014 -0700
+++ b/source_respec.htm Tue Jun 10 08:48:12 2014 -0700
@@ -65,392 +65,9 @@
</ul>
</section>
- <!-- This section and its constructors have moved into DOM L3 Events
-
- <section id="event-constructors">
- <h1>Event Constructors</h1>
-
- <p><em>This section is informative</em></p>
-
- <p>DOM Level 3 Events defines several events, but does not normatively provide a
- mechanism for programmatically-creating those events. Traditionally, an
- <code>init*Event</code> method was defined, but the parameter list to such
- methods became cumbersome and required an explicit order that was hard to
- maintain without the help of a tool.
- </p>
-
- <p>For each event interface defined in [[!DOM-LEVEL-3-EVENTS]], there exists an initialization
- method for synthesizing untrusted events. This mechanism does not scale well
- to event interfaces with many members. Event Constructors (introduced for
- the Event interface in [[DOM4]]) are a mechanism for creating and
- initializing untrusted event objects more easily.
- </p>
-
- <div class="example">
- <p class="example-title">Synthesizing an untrusted event <em>using legacy initialization methods</em>:
- </p>
- <pre>
-var event = document.createEvent("MouseEvent");
-event.initMouseEvent("mouseover",
- true,
- true,
- window,
- null,
- null,
- null,
- 0,
- 0,
- null,
- null,
- null,
- null,
- previousEventTarget);
-eventTarget.dispatchEvent(event);
- </pre>
- </div><!-- Synthesizing events - legacy -->
-<!--
- <div class="example">
- <p class="example-title">Synthesizing an untrusted event <em>using constructors</em>:
- </p>
- <pre>
-var event = new MouseEvent("mouseover",
- {bubbles: true,
- cancelable: true,
- relatedTarget: previousEventTarget
- });
-eventTarget.dispatchEvent(event);
- </pre>
- </div><!-- Synthesizing events - constructors -->
-<!--
- <p>In the above example, the author only has to set the event object properties
- that he or she wants. Using legacy initialization methods, such as
- <code>initMouseEvent()</code>, often requires the author to specify values
- for numerous additional properties that are not needed.
- </p>
-
- <p>The following sections define constructors for the interfaces from DOM3 Events
- [[!DOM-LEVEL-3-EVENTS]].
- </p>
-
- <section id="constructor-uievent">
- <h2><code>UIEvent</code> Constructor</h2>
-
- <dl class="idl" title="[Constructor(DOMString type, optional UIEventInit eventInitDict)] partial interface UIEvent : Event">
- </dl>
-
- <dl class="idl" title="dictionary UIEventInit : EventInit">
- <dt>Window? view = null</dt>
- <dd>Should be initialized to the Window object of the global environment
- in which this event will be dispatched. If this event will be dispatched
- to an element, the view property should be set to the Window object
- containing the element's <code>ownerDocument</code>.
- </dd>
- <dt>long detail = 0</dt>
- <dd>This value is initialized to a number that is application-specific.</dd>
- </dl>
- </section>
-
- <section id="constructor-focusevent">
- <h2><code>FocusEvent</code> Constructor</h2>
-
- <dl class="idl" title="[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict)] partial interface FocusEvent: UIEvent">
- </dl>
-
- <dl class="idl" title="dictionary FocusEventInit : UIEventInit">
- <dt>EventTarget? relatedTarget = null</dt>
- <dd>The <code>relatedTarget</code> should be initialized to the element
- losing focus (in the case of a <em>focus</em> or <em>focusin</em>
- event) or the element gaining focus (in the case of a <em>blur</em>
- or <em>focusout</em> event).
- </dd>
- </dl>
- </section>
-
- <section id="constructor-mouseevent">
- <h2><code>MouseEvent</code> Constructor</h2>
-
- <dl class="idl" title="[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)] partial interface MouseEvent: UIEvent">
- </dl>
-
- <dl class="idl" title="dictionary MouseEventInit : UIEventInit">
-
- <dt>long screenX = 0</dt>
- <dd>See <code>screenY</code> (substituting "horizontal" for "veritcal")</dd>
-
- <dt>long screenY = 0</dt>
- <dd>Initializes the <code>screenY</code> attribute of the MouseEvent
- object to the desired vertical relative position of the mouse
- pointer on the user's screen.
-
- <p>Initializing the event object to the given mouse position must
- not move the user's mouse pointer to the initialized position.
- </p>
- </dd>
-
- <dt>long clientX = 0</dt>
- <dd>See <code>clientY</code> (substituting "horizontal" for "vertical")</dd>
-
- <dt>long clientY = 0</dt>
- <dd>Initializes the <code>clientY</code> attribute of the MouseEvent
- object to the desired vertical position of the mouse pointer
- relative to the client window of the user's browser.
-
- <p>Initializing the event object to the given mouse position must
- not move the user's mouse pointer to the initialized position.
- </p>
- </dd>
-
- <dt>boolean ctrlKey = false</dt>
- <dd>Initializes the <code>ctrlKey</code> attribute of the MouseEvent
- object to <code>true</code> if the <code>ctrlKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
-
- <dt>boolean shiftKey = false</dt>
- <dd>Initializes the <code>shiftKey</code> attribute of the MouseEvent
- object to <code>true</code> if the <code>shiftKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
-
- <dt>boolean altKey = false</dt>
- <dd>Initializes the <code>altKey</code> attribute of the MouseEvent
- object to <code>true</code> if the <code>altKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
-
- <dt>boolean metaKey = false</dt>
- <dd>Initializes the <code>metaKey</code> attribute of the MouseEvent
- object to <code>true</code> if the <code>metaKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
-
- <dt>unsigned short button = 0</dt>
- <dd>
- Initializes the <code>button</code> attribute of the MouseEvent
- object to a number representing one of the button(s) of the mouse
- that is to be considered active.
-
- <p class="note"><strong>Note: </strong>The value 0 is used to represent
- the primary mouse button, 1 is used to represent the auxillery/
- middle mouse button, and 2 to represent the right mouse button.
- Numbers greater than 2 are also possible, but not well-defined
- in DOM Level 3 Events [[DOM-LEVEL-3-EVENTS]].
- </p>
- </dd>
-
- <dt>unsigned short buttons = 0</dt>
- <dd>
- Initializes the <code>buttons</code> attribute of the MouseEvent
- object to a number representing one <em>or more</em> of the button(s) of the mouse
- that are to be considered active.
-
- <p class="note"><strong>Note: </strong>The <code>buttons</code>
- attribute is a bit-field. To apply a value according to the
- definition in DOM Level 3 Events [[DOM-LEVEL-3-EVENTS]], first, determine the
- buttons that are to be considered active, then apply a bit-wise
- OR operation the the result set. The value 1 is used to represent
- the primary mouse button, 2 to represent the right mouse button,
- and 4 to represent the auxillery/middle button. Numbers greater
- than 4 are also possible and should be subsequent powers of 2 (8,
- 16, etc.), but these additional values are not well-defined in DOM
- Level 3 Events.
- </p>
-
- <div class="example">
- <p>
- In JavaScript, to initialize the
- <code>buttons</code> attribute as if the right (2) and middle
- button (4) were being pressed simultaneously, the buttons value
- can be assigned as either:<br/>
- <code>{ buttons: 2 | 4 }</code></br/>
- or:<br/>
- <code>{ buttons: 6 }</code>
- </p>
- </div><!-- Initializing buttons -->
-<!--
- </dd>
-
- <dt>EventTarget? relatedTarget = null</dt>
- <dd>The <code>relatedTarget</code> should be initialized to the element
- whose bounds the mouse pointer just left (in the case of a
- <em>mouseover</em> or <em>mouseenter</em> event) or the element
- whose bounds the mouse pointer is entering (in the case of a
- <em>mouseout</em> or <em>mouseleave</em>
- or <em>focusout</em> event). For other events, this value need not
- be assigned (and will default to null).
- </dd>
- </dl>
- </section>
-
- <section id="constructor-wheelevent">
- <h2><code>WheelEvent</code> Constructor</h2>
-
- <dl class="idl" title="[Constructor(DOMString typeArg, optional WheelEventInit wheelEventInitDict)] partial interface WheelEvent: MouseEvent">
- </dl>
-
- <dl class="idl" title="dictionary WheelEventInit: MouseEventInit">
- <dt>double deltaX = 0.0</dt>
- <dd>See <code>deltaZ</code> attribute.</dd>
- <dt>double deltaY = 0.0</dt>
- <dd>See <code>deltaZ</code> attribute.</dd>
- <dt>double deltaZ = 0.0</dt>
- <dd>Initializes the <code>deltaZ</code> attribute of the WheelEvent object.
- Relative positive values for this attribute (as well as the
- <code>deltaX</code> and <code>deltaY</code> attributes) are given by
- a right-hand coordinate system where the X, Y, and Z axes are
- directed towards the right-most edge, bottom-most edge, and farthest
- depth (away from the user) of the document, respectively. Negative
- relative values are in the respective opposite directions.
- </dd>
- <dt>unsigned long deltaMode = 0</dt>
- <dd>Initializes the <code>deltaMode</code> attribute on the WheelEvent
- object to the enumerated values 0, 1, or 2, which represent the amount
- of pixels scrolled (DOM_DELTA_PIXEL), lines scrolled (DOM_DELTA_LINE),
- or pages scrolled (DOM_DELTA_PAGE) if the rotation of the wheel would
- have resulted in scrolling.
- </dd>
- </dl>
- </section>
-
- <section id="constructor-keyboardevent">
- <h2><code>KeyboardEvent</code> Constructor</h2>
-
- <dl class="idl" title="[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] partial interface KeyboardEvent: UIEvent">
- </dl>
-
- <dl class="idl" title="dictionary KeyboardEventInit : UIEventInit">
- <dt>DOMString char = ""</dt>
- <dd>Initializes the <code>char</code> attribute of the KeyboardEvent
- object to the unicode character string representing a printable
- character. If the related <code>key</code> value is not a printable
- character, then this attribute should be assigned the empty string
- (which is the default value).
- </dd>
- <dt>DOMString key = ""</dt>
- <dd>Initializes the <code>key</code> attribute of the KeyboardEvent
- object to the unicode character string representing the meaning of a
- key after taking into account all keyboard modifications (such as
- shift-state). This value is the final effective value of the key.
- If the key is not a printable character, then it should be one of
- the key values defined in [[DOM-LEVEL-3-EVENTS]].
- </dd>
- <dt>DOMString code = ""</dt>
- <dd>Initializes the <code>code</code> attribute of the KeyboardEvent
- object to the unicode character string representing the key that
- was pressed, ignoring any keyboard modifications such as keyboard
- layout.
- This value should be one of the code values defined in the
- <a href="#keyboard-events">Keyboard Events</a> section.
- </dd>
- <dt>unsigned long location = 0</dt>
- <dd>
- Initializes the <code>location</code> attribute of the KeyboardEvent
- object to one of the following location numerical constants:
- <ul>
- <li><code>KeyboardEvent.DOM_KEY_LOCATION_STANDARD</code> (numerical value 0)</li>
- <li><code>KeyboardEvent.DOM_KEY_LOCATION_LEFT</code> (numerical value 1)</li>
- <li><code>KeyboardEvent.DOM_KEY_LOCATION_RIGHT</code> (numerical value 2)</li>
- <li><code>KeyboardEvent.DOM_KEY_LOCATION_NUMPAD</code> (numerical value 3)</li>
- </ul>
- </dd>
- <dt>boolean ctrlKey = false</dt>
- <dd>Initializes the <code>ctrlKey</code> attribute of the KeyboardEvent
- object to <code>true</code> if the <code>ctrlKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
- <dt>boolean shiftKey = false</dt>
- <dd>Initializes the <code>shiftKey</code> attribute of the KeyboardEvent
- object to <code>true</code> if the <code>shiftKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
- <dt>boolean altKey = false</dt>
- <dd>Initializes the <code>altKey</code> attribute of the KeyboardEvent
- object to <code>true</code> if the <code>altKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
- <dt>boolean metaKey = false</dt>
- <dd>Initializes the <code>metaKey</code> attribute of the KeyboardEvent
- object to <code>true</code> if the <code>metaKey</code> modifier
- key is to be considered depressed, <code>false</code> otherwise.
- </dd>
- <dt>boolean repeat = false</dt>
- <dd>Initializes the <code>repeat</code> attribute of the KeyboardEvent
- object to <code>true</code> if the the current KeyboardEvent is
- considered part of a repeating sequence of similar events caused
- by the long depression of any single key, <code>false</code> otherwise.
- </dd>
- <dt>DOMString locale = ""</dt>
- <dd>Initializes the <code>locale</code> attribute of the KeyboardEvent
- object to a [[!BCP47]] string. This string should reflect the current language
- that the keyboard originaing this event is configured to, for example <code>"en-US"</code>
- for a keyboard configured for US English input. This value may be the
- empty string if the locale of the given input is unknown.
- </dd>
- </dl>
- </section>
-
- <section id="constructor-compositionevent">
- <h2><code>CompositionEvent</code> Constructor</h2>
-
- <dl class="idl" title="[Constructor(DOMString typeArg, optional CompositionEventInit compositionEventInitDict)] partial interface CompositionEvent: UIEvent">
- </dl>
-
- <dl class="idl" title="dictionary CompositionEventInit : UIEventInit">
- <dt>DOMString? data = ""</dt>
- <dd>Initializes the <code>data</code> attribute of the CompositionEvent
- object to the characters generated by the IME composition.
- </dd>
- <dt>DOMString locale = ""</dt>
- <dd>Initializes the <code>locale</code> attribute of the CompositionEvent
- object to a [[!BCP47]] string. This string should reflect the current language
- that the IME originaing this event is configured to, for example <code>"ja"</code>
- for an IME configured for Japanese input. This value may be the
- empty string if the locale of the IME is unknown.
- </dd>
- </dl>
- </section>
- </section>
-
- <section id="composition-events">
- <h1>Composition Events</h1>
- <p>The DOM Level 3 Events specification introduced composition events. This document extends
- composition events by adding a <code>locale</code> attribute.
- </p>
-
- <section id="composition-event-interface">
- <h1>Interface <code>CompositionEvent</code></h1>
-
- <dl class="idl" title="partial interface CompositionEvent : UIEvent">
- <dt>readonly attribute DOMString locale</dt>
- <dd>
- <p>The <code>locale</code> <code>DOMString</code> attribute contains a [[!BCP47]] tag indicating the locale for which the IME originating
- the event is configured, e.g. <code>"ja"</code>, <code>"zh-Hans"</code>, <code>"ko"</code>. MAY be the <a class="def" href="#glossary-empty-string">empty string</a>
- when inapplicable or unknown, e.g. when this information is not exposed by the underlying platform or application.</p>
-
- <p class="note"><strong>Note:</strong> <code>locale</code> does not necessarily indicate the locale of the data or the context in
- which it is being entered. For example, a French user often might not switch to an English keyboard setting when typing English, in which case the <code>locale</code>
- will still indicate French, even though the data is actually English. Similarly, an IME application could fail to distinguish between the locale of Chinese and
- Kanji characters.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute MUST be <code>""</code> (the empty string).</p>
- </dd>
- </dl>
-
- </section>
--->
<section id="keyboard-events">
<h1>Keyboard Events</h1>
-<!-- 'code' has moved from UIEvents into DOM L3 Events
-
- <p>The DOM Level 3 Events specification defines keyboard events that include <code>char</code> and <code>key</code>
- attributes to replace the legacy keyboard event attributes <code>keycode</code> and <code>charCode</code>.
- </p>
- <p>This document extends the DOM Level 3 keyboard event by adding a <code>code</code> attribute
- (to help identify the physical key being pressed on the keyboard) and methods to identify the <code>char</code>
- associated with a given key.
- </p>
--->
<p>This section extends the KeyboardEvent interface defined in DOM Level 3 by adding methods
for querying the keyboard state without requiring a Keyboard event to be dispatched, and by providing locale information during the dispatch of a Keyboard event.</p>
@@ -459,18 +76,6 @@
<dl class="idl" title="partial interface KeyboardEvent : UIEvent">
-<!-- Moved to DOM L3 Events
- <dt>readonly attribute DOMString code</dt>
- <dd>
- <p><code>code</code> holds a string that identifies the physical key being pressed.
- The value is not affected by the current keyboard layout or modifier state, so a particular
- key will always return the same value.
- </p>
- <p>The un-initialized value of this attribute must be "" (the empty string).</p>
- <p class="note">The <code>code</code> value for a single key will never exceed 23 bytes.</p>
- </dd>
--->
-
<dt>static DOMString queryKeyCap()</dt>
<dd>
<p>Given a <code>code</code> corresponding to a key on a standard keyboard and a [[!BCP47]] <code>locale</code>,
@@ -564,905 +169,6 @@
</pre>
</div>
</section>
-
-<!-- Moved to DOM L3 Events
- <section id="key-codes">
- <h1>Key codes</h1>
- <p>A key <code>code</code> is an attribute of a keyboard event that can be used to identify the physical
- key associated with the keyboard event. It is similar to USB Usage IDs [***REF***] in that it provides
- a low-level value (similar to a scancode) that is vendor-neutral.
- </p>
- <p>The primary purpose of the <code>code</code> attribute is to provide a consistent and coherent way
- to identify keys based on their physical location. In addition, it also provides a stable name
- (unaffected by the current keyboard state) that uniquely identifies each key on the keyboard.
- </p>
-
- <section id="key-event-motivation">
- <h1>Motivation for Adding the <code>code</code> Attribute</h1>
- <p>As discussed in more detail later in this document, the standard PC keyboard has a set of keys (which
- we refer to as <em><a href="#key-alphanumeric-writing-system">writing system keys</a></em>)
- that generate different <code>char</code> and <code>key</code> values
- based on the current keyboard layout selected by the user.
- This situation makes it difficult to write code that detects keys based on their physical
- location since the code would need to know which layout is in effect in order to know which
- <code>char</code> or <code>key</code> values to check for. A real-world example of this is
- a game that wants to use the
- <code class="keycap">'W'</code>, <code class="keycap">'A'</code>, <code class="keycap">'S'</code> and <code class="keycap">'D'</code>
- keys to control player movement.
- The <code>code</code> attribute solves this problem by providing
- a stable value to check that is <em>not affected by the current keyboard layout</em>.
- </p>
- <p>In addition, the values in the <code>char</code> and <code>key</code> attributes depend as well
- on the current keyboard state. Because of this, the order in which keys are pressed and released
- in relation to modifier keys
- can affect the values stored in the <code>char</code> and <code>key</code> attributes.
- The <code>code</code> attribute solves this problem by providing
- a stable value that is <em>not affected by the current keyboard state</em>.
- </p>
- </section>
-
- <section id="key-event-attributes">
- <h1>The Relationship Between <code>char</code>, <code>key</code> and <code>code</code></h1>
- <dl>
- <dt><code>char</code></dt>
- <dd>The <code>char</code> attribute is intended for users who are interested only in the printable final character
- that the user typed (or entered through some other means).
- Example use case: Detecting character input (e.g., to validate the contents of a textbox after each character is entered).
- </dd>
- <dt><code>key</code></dt>
- <dd>The <code>key</code> attribute is intended for users who are interested in the meaning of the key
- being pressed, taking into account the current keyboard layout (and IME and dead keys).
- Example use case: Detecting modified keys or bare modifier keys (e.g., to perform an action in response to a keyboard shortcut).
- </dd>
- <dt><code>code</code></dt>
- <dd>The <code>code</code> attribute is intended for users who are interested in the key that was pressed
- by the user, without any layout modifications applied.
- Example use case: Detecting WASD keys (e.g., for movement controls in a game) or trapping all keys
- (e.g., in a remote desktop client to send all keys to the remote host).
- </dd>
- </dl>
-
- </section>
-
- <div class="example">
- <p class="example-title">Handling the Left and Right Alt Keys
- </p>
- <table class="data-table">
- <thead><tr><th>Keyboard Layout</th><th><code>char</code></th><th><code>key</code></th><th><code>code</code></th><th>Notes</th></tr></thead>
- <tbody>
- <tr><td>US</td><td><code class="glyph">''</code></td><td><code class="key-code">'Alt'</code></td><td><code class="key-code">'AltLeft'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></td></tr>
- <tr><td>French</td><td><code class="glyph">''</code></td><td><code class="key-code">'Alt'</code></td><td><code class="key-code">'AltLeft'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></td></tr>
- <tr><td>US</td><td><code class="glyph">''</code></td><td><code class="key-code">'Alt'</code></td><td><code class="key-code">'AltRight'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_RIGHT</code></td></tr>
- <tr><td>French</td><td><code class="glyph">''</code></td><td><code class="key-code">'AltGr'</code></td><td><code class="key-code">'AltRight'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_RIGHT</code></td></tr>
- </tbody>
- </table>
- <p>In this example, checking the <code>key</code> attribute permits matching <code class="key-code">'Alt'</code> without worrying about which Alt key (left or right) was pressed.
- Checking the <code>code</code> attribute permits matching the right Alt key (<code class="key-code">'AltRight'</code>) without worrying about which layout is currently in effect.
- </p>
- <p>Note that, in the French example, the <code class="key-code">'Alt'</code> and
- <code class="key-code">'AltGr'</code> keys retain their left and right location, even through there
- is only one of each key.
- </p>
- </div><!-- Handling Left and Right Alt Keys -->
-<!--
- <div class="example">
- <p class="example-title">Handling the Single Quote Key
- </p>
- <table class="data-table">
- <thead><tr><th>Keyboard Layout</th><th><code>char</code></th><th><code>key</code></th><th><code>code</code></th><th>Notes</th></tr></thead>
- <tbody>
- <tr><td>US</td><td><code class="glyph">'''</code></td><td><code class="key-code">'''</code></td><td><code class="key-code">'Quote'</code></td><td></td></tr>
- <tr><td>Japanese</td><td><code class="glyph">':'</code></td><td><code class="key-code">':'</code></td><td><code class="key-code">'Quote'</code></td><td></td></tr>
- <tr><td>US Intl</td><td><code class="glyph">''</code></td><td><code class="key-code">'DeadAcute'</code></td><td><code class="key-code">'Quote'</code></td><td></td></tr>
- </tbody>
- </table>
- <p>This example shows how dead key values are encoded in the attributes. The <code>char</code> and
- <code>key</code> values vary based on the current locale, whereas the <code>code</code> attribute
- returns a consistent value.
- </p>
- </div><!-- Handling the Single Quote Key -->
-<!--
- <div class="example" id="example-key-2">
- <p class="example-title">Handling the '2' Key (with and without Shift pressed)
- </p>
- <table class="data-table">
- <thead><tr><th>Keyboard Layout</th><th><code>char</code></th><th><code>key</code></th><th><code>code</code></th><th>Notes</th></tr></thead>
- <tbody>
- <tr><td>US</td><td><code class="glyph">'2'</code></td><td><code class="key-code">'2'</code></td><td><code class="key-code">'Digit2'</code></td><td></td></tr>
- <tr><td>US</td><td><code class="glyph">'@'</code></td><td><code class="key-code">'@'</code></td><td><code class="key-code">'Digit2'</code></td><td><code class="constant-name">shiftKey</code></td></tr>
- <tr><td>UK</td><td><code class="glyph">'2'</code></td><td><code class="key-code">'2'</code></td><td><code class="key-code">'Digit2'</code></td><td></td></tr>
- <tr><td>UK</td><td><code class="glyph">'"'</code></td><td><code class="key-code">'"'</code></td><td><code class="key-code">'Digit2'</code></td><td><code class="constant-name">shiftKey</code></td></tr>
- <tr><td>French</td><td><code class="glyph">'é'</code></td><td><code class="key-code">'é'</code></td><td><code class="key-code">'Digit2'</code></td><td></td></tr>
- <tr><td>French</td><td><code class="glyph">'2'</code></td><td><code class="key-code">'2'</code></td><td><code class="key-code">'Digit2'</code></td><td><code class="constant-name">shiftKey</code></td></tr>
- </tbody>
- </table>
- <p>Regardless of the current locale or the modifier key state, pressing the key labelled <code class="keycap">2</code>
- on a US keyboard always results in <code class="key-code">'Digit2'</code> in the <code>code</code> attribute.
- </p>
- </div><!-- Handling the 2 Key -->
-<!--
- <div class="example" id="example-key-shift-2">
- <p class="example-title">Sequence of Keyboard Events : Shift and '2'
- </p>
- <p>Compare the attribute values in the following two key event sequences. They both produce the
- <code class="glyph">'@'</code> character on a US keyboard, but differ in the order in which the
- keys are released. In the first sequence, the order is Shift (down), 2 (down), 2 (up), Shift (up).
- </p>
- <table class="data-table">
- <thead><tr><th>Keyboard Layout</th><th>Event</th><th><code>char</code></th><th><code>key</code></th><th><code>code</code></th><th>Notes</th></tr></thead>
- <tbody>
- <tr><td>US</td><td>keydown</td><td><code class="glyph">''</code></td><td><code class="key-code">'Shift'</code></td><td><code class="key-code">'ShiftLeft'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></td></tr>
- <tr><td>US</td><td>keydown</td><td><code class="glyph">'@'</code></td><td><code class="key-code">'@'</code></td><td><code class="key-code">'Digit2'</code></td><td><code class="constant-name">shiftKey</code></td></tr>
- <tr><td>US</td><td>keypress</td><td><code class="glyph">'@'</code></td><td><code class="key-code">'@'</code></td><td><code class="key-code">''</code></td><td></td></tr>
- <tr><td>US</td><td>keyup</td><td><code class="glyph">'@'</code></td><td><code class="key-code">'@'</code></td><td><code class="key-code">'Digit2'</code></td><td><code class="constant-name">shiftKey</code></td></tr>
- <tr><td>US</td><td>keyup</td><td><code class="glyph">''</code></td><td><code class="key-code">'Shift'</code></td><td><code class="key-code">'ShiftLeft'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></td></tr>
- </tbody>
- </table>
- <p>In the second sequence, the Shift is released before the 2, resulting in the following event order:
- Shift (down), 2 (down), Shift (up), 2 (up).
- </p>
- <table class="data-table">
- <thead><tr><th>Keyboard Layout</th><th>Event</th><th><code>char</code></th><th><code>key</code></th><th><code>code</code></th><th>Notes</th></tr></thead>
- <tbody>
- <tr><td>US</td><td>keydown</td><td><code class="glyph">''</code></td><td><code class="key-code">'Shift'</code></td><td><code class="key-code">'ShiftLeft'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></td></tr>
- <tr><td>US</td><td>keydown</td><td><code class="glyph">'@'</code></td><td><code class="key-code">'@'</code></td><td><code class="key-code">'Digit2'</code></td><td><code class="constant-name">shiftKey</code></td></tr>
- <tr><td>US</td><td>keypress</td><td><code class="glyph">'@'</code></td><td><code class="key-code">'@'</code></td><td><code class="key-code">''</code></td><td></td></tr>
- <tr><td>US</td><td>keyup</td><td><code class="glyph">''</code></td><td><code class="key-code">'Shift'</code></td><td><code class="key-code">'ShiftLeft'</code></td><td><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></td></tr>
- <tr><td>US</td><td>keyup</td><td><code class="glyph">'2'</code></td><td><code class="key-code">'2'</code></td><td><code class="key-code">'Digit2'</code></td><td></td></tr>
- </tbody>
- </table>
- <p>Note that the values contained in the <code>char</code> and <code>key</code> attributes do not match between
- the keydown and keyup events for the '2' key. The <code>code</code> attribute provides a consistent value
- that is not affected by the current modifier state.
- </p>
- </div><!-- Sequence of Keyboard Events: Shift and 2 -->
-<!--
- </section>
-
- <section id="keyboards">
- <h1>Keyboards</h1>
- <p>Alphanumeric keyboards are the most common way for users to generate keyboard events, but properly
- detecting key events can be tricky because the OS may change the behavior of certain keys based on
- the current keyboard layout selected by the user.
- </p>
- <p>This section provides an overview of standard keyboards and describes the <code>code</code>
- attribute associated with each key.
- </p>
-
- <section id="keyboard-sections">
- <h1>Keyboard Sections</h1>
- <p><em>This section is informative</em></p>
- <p>When discussing keyboard layouts, it is convenient to divide the standard keyboard into distinct sections
- and to label each row.
- </p>
- <object class="figure" data="keyboard-sections.svg" type="image/svg+xml" width="684" height="225" title="The five general sections of a standard keyboard."></object>
- <p>The Alphanumeric section is the main part of the keyboard and is where most of the keyboard variation occurs.
- When a user selects a keyboard layout, it is the keys in this sections that are most affected.
- </p>
- <p>The Control Pad and Arrow Pad sections contain the arrow keys and other editing keys.
- </p>
- <p>The Numpad (also known as the "numeric keypad" or "number pad") contains number and math keys to make it
- easier to enter numeric data.
- </p>
- <p>And finally, the Function section contains miscellaneous function keys and special keys like Escape.
- </p>
- <p>To make it easier to identify keys, the rows on the keyboard are named starting with "A"
- for the bottom row up to "E" for the top row. The row of keys in the Function section are considered
- to be in row "K".
- These row names are consistent with those given in the ISO/IEC 9995-1 specification.
- </p>
- <p>Note that many keyboards (both modern and legacy) have extra keys that do not fit neatly into the above sections.
- Some of these keys are covered in the <a href="#key-media">Media Keys</a> section.
- Keys not covered in this document should be handled in the same manner as described in the
- <a href="#other-devices">Other Devices</a> section.
- </p>
- </section><!-- keyboard-sections -->
-<!--
- <section id="keyboard-common-layouts">
- <h1>Standard Keyboard Layouts</h1>
- <p><em>This section is informative</em></p>
- <p>This section describes the physical layouts found on commonly available keyboards.
- </p>
-
- <section id="keyboard-101">
- <h1>Standard "101" Keyboard Layout</h1>
- <p>The standard "101" keyboard (commonly referred to as the "US layout") is the only layout that uses the <code class="key-code">'Backslash'</code> code.
- All the other layouts omit this key and expand the <code class="key-code">'Enter'</code> key to occupy
- two-rows.
- </p>
- <object class="figure" data="keyboard-101-us.svg" type="image/svg+xml" width="684" height="225" title="Standard '101' keyboard layout showing unmodified US key values."></object>
- <p>Modern standard "101"-layout keyboards actually contain 104 keys: 61 keys in the alphanumeric section
- and 43 keys in the numpad, control pad, arrow pad and function sections.
- The "101" name for this keyboard layout dates to the time when this standard keyboard did in fact contain
- 101 keys. The two <code class="glyph">'OS'</code> keys,
- and the <code class="glyph">'Menu'</code> key were
- added later to bring the total to 104 keys.
- </p>
- </section>
-
- <section id="keyboard-101alt">
- <h1>Alternate "101" Keyboard Layout</h1>
- <p>The alternate "101" keyboard removes the <code class="key-code">'Backslash'</code> key to create a
- large <code class="key-code">'Enter'</code> key and shrinks the <code class="key-code">'Backspace'</code>
- key to make room for the <code class="key-code">'IntlYen'</code> key (The <code class="key-code">'IntlYen'</code> name comes from the
- Japanese layout — in the Russian layout shown above this key maps to a <code class="glyph">'\'</code>.
- </p>
- <object class="figure" data="keyboard-101-russian.svg" type="image/svg+xml" width="684" height="225" title="Alternate '101' keyboard layout showing unmodified Russian key values."></object>
- <p>Modern alternate "101"-layout keyboards contain 104 keys: 61 keys in the alphanumeric section and 43 keys in the numpad,
- control pad, arrow pad and function sections.
- </p>
- </section>
-
- <section id="keyboard-102">
- <h1>Standard "102" Keyboard Layout</h1>
- <p>The standard "102" keyboard is common throughout Europe and adds two keys that don't exist on the
- "101" layouts:
- The <code class="key-code">'IntlBackslash'</code> key next to the left shift key,
- and the <code class="key-code">'IntlHash'</code> key which is partially tucked under the
- <code class="key-code">'Enter'</code> key.
- </p>
- <object class="figure" data="keyboard-102-uk.svg" type="image/svg+xml" width="684" height="225" title="Standard '102' keyboard layout showing unmodified French key values."></object>
- <p>Modern "102"-layout keyboards contain 105 keys: 62 keys in the alphanumeric section and 43 keys in the numpad,
- control pad, arrow pad and function sections.
- </p>
- </section>
-
- <section id="keyboard-103">
- <h1>Korean "103" Keyboard Layout</h1>
- <p>The Korean "103" keyboard is based on the alternate 101 layout and adds two additional keys
- (one on each side of the spacebar) to handle Korean-specific input modes.
- These keys are
- <code class="key-code">'Hanja'</code> (labelled <code class="keycap">한자</code> <span class="phonetic">hanja</span>) and
- <code class="key-code">'HangulMode'</code> (labelled <code class="keycap">한/영</code> <span class="phonetic">han/yeong</span>).
- </p>
- <object class="figure" data="keyboard-103-korean.svg" type="image/svg+xml" width="684" height="225" title="Korean '103' keyboard layout showing unmodified Korean key values."></object>
- <p>Modern "103"-layout keyboards contain 106 keys: 63 keys in the alphanumeric section and 43 keys in the numpad,
- control pad, arrow pad and function sections.
- </p>
- </section>
-
- <section id="keyboard-104">
- <h1>Brazilian "104" Keyboard Layout</h1>
- <p>The "104" layout used in Brazil adds 4 new keys: the two non-US keys from the "102" layout
- (<code class="key-code">'IntlHash'</code> and <code class="key-code">'IntlBackslash'</code>)
- plus the <code class="key-code">'IntlRo'</code> key (next to the right shift
- key) and an extra key on the numeric keypad. This new keypad key is called
- <code class="key-code">'KeypadComma'</code> because it represents the thousands separator. On the
- Brazilian key layout, this key has a keycap of <code class="keycap">.</code> and the <code class="key-code">'KeypadPeriod'</code>
- key has a keycap of <code class="keycap">,</code>.
- </p>
- <object class="figure" data="keyboard-104-brazilian.svg" type="image/svg+xml" width="684" height="225" title="Standard '104' keyboard layout showing unmodified Brazilian key values."></object>
- <p>Modern "104"-layout keyboards contain 107 keys: 63 keys in the alphanumeric section and 44 keys in the numpad,
- control pad, arrow pad and function sections. Some Brazilian keyboards lack the extra keypad
- key and have only 106 keys.
- </p>
- </section>
-
- <section id="keyboard-106">
- <h1>Japanese "106" Keyboard Layout</h1>
- <p>The Japanese "106" keyboard layout adds 3 new keys:
- <code class="key-code">'IntlYen'</code>,
- <code class="key-code">'IntlHash'</code> and
- <code class="key-code">'IntlRo'</code>.
- It also shrinks the <code class="key-code">'Space'</code> key to make room for 3 input mode keys:
- <code class="key-code">'NoConvert'</code> (labelled <code class="keycap">無変換</code> <span class="phonetic">muhenkan</span>),
- <code class="key-code">'Convert'</code> (labelled <code class="keycap">変換</code> <span class="phonetic">henkan</span>),
- <code class="key-code">'KanaMode'</code> (labelled <code class="keycap">カタカナ/ひらがな/ローマ字</code> <span class="phonetic">katakana/hiragana/romaji</span>).
- </p>
- <object class="figure" data="keyboard-106-japanese.svg" type="image/svg+xml" width="684" height="225" title="Standard '106' keyboard layout showing unmodified Japanese key values."></object>
- <p>Modern "106"-layout keyboards contain 109 keys: 66 keys in the alphanumeric section and 43 keys in the numpad,
- control pad, arrow pad and function sections.
- </p>
- </section>
-
- <section id="keyboard-mac">
- <h1>Apple Keyboard Layout</h1>
- <p>In general, Apple keyboards follow the same layout as PC keyboards, but there are some differences as
- noted in the following figure.
- </p>
- <object class="figure" data="keyboard-mac.svg" type="image/svg+xml" width="684" height="225" title="Apple extended keyboard layout showing unmodified English key values."></object>
- <p>In this figure, the green keys are those
- that have been moved to a new location while the blue keys indicate keys that have been added.
- </p>
- </section>
-
- <section id="keyboard-laptops">
- <h1>Laptop Keyboard Layouts</h1>
- <p>The limited space available on laptop keyboards often means that the physical key layout needs
- to be adjusted to fit all the required keys. The writing system keys in the Alphanumeric section tend
- to remain intact, but the other keyboard sections are usually combined with other keys or
- removed altogether.
- </p>
- <object class="figure" data="keyboard-laptop-mac.svg" type="image/svg+xml" width="420" height="180" title="Apple laptop keyboard layout."></object>
- <p>In this Apple laptop keyboard, the right control key has been removed to make room for half-height
- arrow keys and a <code class="key-code">'Fn'</code> key is added on the left.
- </p>
- <object class="figure" data="keyboard-laptop.svg" type="image/svg+xml" width="460" height="180" title="Sample PC laptop keyboard layout."></object>
- <p>PC laptop keyboards vary considerably, but this sample keyboard demonstrates some commonly found aspects.
- The control pad keys are added along the right-hand side with the arrow keys tucked in along the bottom.
- The right shift key is often shrunk to make room for the up arrow key and the right OS key
- is typically removed altogether.
- </section>
-
- </section><!-- keyboard-common-layouts -->
-<!--
- <section id="keyboard-key-codes">
- <h1>Key Codes for Standard Keyboards</h1>
- <p>This section describes the various keyboard sections in more detail and defines the <code>code</code>
- values that should be used for each key.
- </p>
-
- <section id="key-alphanumeric-section">
- <h1>Alphanumeric Section</h1>
- <p>The Alphanumeric section keys fall into two general categories: "writing system" keys whose meaning changes based on
- the current keyboard layout, and "functional" keys which are (mostly) the same for all layouts.
- </p>
- <section id="key-alphanumeric-writing-system">
- <h1>Writing System Keys</h1>
- <p>The "writing system" keys are those that change meaning based on the current keyboard layout.
- </p>
- <object class="figure" data="keyboard-codes-alphanum1.svg" type="image/svg+xml" width="653" height="225" title="The writing system keys in the alphanumeric section."></object>
- <p>This figure shows a hypothetical keyboard that combines all the writing system keys (shown in
- blue and green) found on the various keyboards.
- Blue keys are present on all standard keyboards while green keys are only available on some keyboards.
- </p>
- <p>The name shown on each key is the <code>code</code> assigned to that key.
- Wherever possible, the <code>code</code> names are based on the name for the US key
- in that position (i.e., they are based on the US keyboard layout). For keys that don't
- exist on the US keyboard, names from the UK or Japanese layouts are used instead.
- </p>
- <table id="table-key-code-alphanumeric-writing-system" class="data-table full-width">
- <caption>List of code values for writing system keys in the Alphanumeric section.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-Backquote" class="key-code">'Backquote'</code></td>
- <td>0x35</td><td><code class="keycap">`</code> and <code class="keycap">~</code> on a US keyboard. This is the <code class="keycap">半角/全角/漢字</code> (<span class="phonetic">hankaku/zenkaku/kanji</span>) key on Japanese keyboards</td></tr>
- <tr><td><code id="code-Backslash" class="key-code">'Backslash'</code></td>
- <td>0x31</td><td><code class="keycap">\</code> and <code class="keycap">|</code> on a US keyboard. Found only on standard 101-key layouts.</td></tr>
- <tr><td><code id="code-Backspace" class="key-code">'Backspace'</code></td>
- <td>0x2a</td><td>Labelled <code class="keycap">Delete</code> on Macintosh keyboards.</td></tr>
- <tr><td><code id="code-BracketLeft" class="key-code">'BracketLeft'</code></td>
- <td>0x2f</td><td><code class="keycap">[</code> and <code class="keycap">{</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-BracketRight" class="key-code">'BracketRight'</code></td>
- <td>0x30</td><td><code class="keycap">]</code> and <code class="keycap">}</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Comma" class="key-code">'Comma'</code></td>
- <td>0x36</td><td><code class="keycap">,</code> and <code class="keycap"><</code> on a US keyboard.</td></tr>
-
- <tr><td><code id="code-Digit-0" class="key-code">'Digit0'</code></td>
- <td>0x27</td><td><code class="keycap">0</code> and <code class="keycap">)</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-1" class="key-code">'Digit1'</code></td>
- <td>0x1e</td><td><code class="keycap">1</code> and <code class="keycap">!</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-2" class="key-code">'Digit2'</code></td>
- <td>0x1f</td><td><code class="keycap">2</code> and <code class="keycap">@</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-3" class="key-code">'Digit3'</code></td>
- <td>0x20</td><td><code class="keycap">3</code> and <code class="keycap">#</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-4" class="key-code">'Digit4'</code></td>
- <td>0x21</td><td><code class="keycap">4</code> and <code class="keycap">$</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-5" class="key-code">'Digit5'</code></td>
- <td>0x22</td><td><code class="keycap">5</code> and <code class="keycap">%</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-6" class="key-code">'Digit6'</code></td>
- <td>0x23</td><td><code class="keycap">6</code> and <code class="keycap">^</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-7" class="key-code">'Digit7'</code></td>
- <td>0x24</td><td><code class="keycap">7</code> and <code class="keycap">&</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-8" class="key-code">'Digit8'</code></td>
- <td>0x25</td><td><code class="keycap">8</code> and <code class="keycap">*</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Digit-9" class="key-code">'Digit9'</code></td>
- <td>0x26</td><td><code class="keycap">9</code> and <code class="keycap">(</code> on a US keyboard.</td></tr>
-
- <tr><td><code id="code-Equal" class="key-code">'Equal'</code></td>
- <td>0x2e</td><td><code class="keycap">=</code> and <code class="keycap">+</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-IntlBackslash" class="key-code">'IntlBackslash'</code></td>
- <td>0x64</td><td>Located between the <code class="key-code">'ShiftLeft'</code> and <code class="key-code">'KeyZ'</code> keys. The <code class="keycap">\</code> and <code class="keycap">|</code> key on a UK keyboard.</td></tr>
- <tr><td><code id="code-IntlHash" class="key-code">'IntlHash'</code></td>
- <td>0x32</td><td>Located between the <code class="key-code">'Quote'</code> and <code class="key-code">'Enter'</code> keys on row E of the keyboard. The <code class="keycap">#</code> and <code class="keycap">~</code> key on a UK keyboard.</td></tr>
- <tr><td><code id="code-IntlRo" class="key-code">'IntlRo'</code></td>
- <td>0x87</td><td>Located between the <code class="key-code">'Slash'</code> and <code class="key-code">'ShiftRight'</code> keys. The <code class="keycap">\</code> and <code class="keycap">ろ</code> (<span class="phonetic">ro</span>) key on a Japanese keyboard.</td></tr>
- <tr><td><code id="code-IntlYen" class="key-code">'IntlYen'</code></td>
- <td>0x89</td><td>Located between the <code class="key-code">'Equal'</code> and <code class="key-code">'Backspace'</code> keys. The <code class="keycap">¥</code> (<span class="phonetic">yen</span>) key on a Japanese keyboard. The <code class="keycap">\</code> and <code class="keycap">/</code> key on a Russian keyboard.</td></tr>
-
- <tr><td><code id="code-KeyA" class="key-code">'KeyA'</code></td>
- <td>0x04</td><td><code class="keycap">a</code> on a US keyboard. Labelled <code class="keycap">q</code> on an AZERTY (e.g., French) keyboard.</td></tr>
- <tr><td><code id="code-KeyB" class="key-code">'KeyB'</code></td>
- <td>0x05</td><td><code class="keycap">b</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyC" class="key-code">'KeyC'</code></td>
- <td>0x06</td><td><code class="keycap">c</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyD" class="key-code">'KeyD'</code></td>
- <td>0x07</td><td><code class="keycap">d</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyE" class="key-code">'KeyE'</code></td>
- <td>0x08</td><td><code class="keycap">e</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyF" class="key-code">'KeyF'</code></td>
- <td>0x09</td><td><code class="keycap">f</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyG" class="key-code">'KeyG'</code></td>
- <td>0x0a</td><td><code class="keycap">g</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyH" class="key-code">'KeyH'</code></td>
- <td>0x0b</td><td><code class="keycap">h</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyI" class="key-code">'KeyI'</code></td>
- <td>0x0c</td><td><code class="keycap">i</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyJ" class="key-code">'KeyJ'</code></td>
- <td>0x0d</td><td><code class="keycap">j</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyK" class="key-code">'KeyK'</code></td>
- <td>0x0e</td><td><code class="keycap">k</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyL" class="key-code">'KeyL'</code></td>
- <td>0x0f</td><td><code class="keycap">l</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyM" class="key-code">'KeyM'</code></td>
- <td>0x10</td><td><code class="keycap">m</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyN" class="key-code">'KeyN'</code></td>
- <td>0x11</td><td><code class="keycap">n</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyO" class="key-code">'KeyO'</code></td>
- <td>0x12</td><td><code class="keycap">o</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyP" class="key-code">'KeyP'</code></td>
- <td>0x13</td><td><code class="keycap">p</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyQ" class="key-code">'KeyQ'</code></td>
- <td>0x14</td><td><code class="keycap">q</code> on a US keyboard. Labelled <code class="keycap">a</code> on an AZERTY (e.g., French) keyboard.</td></tr>
- <tr><td><code id="code-KeyR" class="key-code">'KeyR'</code></td>
- <td>0x15</td><td><code class="keycap">r</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyS" class="key-code">'KeyS'</code></td>
- <td>0x16</td><td><code class="keycap">s</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyT" class="key-code">'KeyT'</code></td>
- <td>0x17</td><td><code class="keycap">t</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyU" class="key-code">'KeyU'</code></td>
- <td>0x18</td><td><code class="keycap">u</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyV" class="key-code">'KeyV'</code></td>
- <td>0x19</td><td><code class="keycap">v</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyW" class="key-code">'KeyW'</code></td>
- <td>0x1a</td><td><code class="keycap">w</code> on a US keyboard. Labelled <code class="keycap">z</code> on an AZERTY (e.g., French) keyboard.</td></tr>
- <tr><td><code id="code-KeyX" class="key-code">'KeyX'</code></td>
- <td>0x1b</td><td><code class="keycap">x</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-KeyY" class="key-code">'KeyY'</code></td>
- <td>0x1c</td><td><code class="keycap">y</code> on a US keyboard. Labelled <code class="keycap">z</code> on a QWERTZ (e.g., German) keyboard.</td></tr>
- <tr><td><code id="code-KeyZ" class="key-code">'KeyZ'</code></td>
- <td>0x1d</td><td><code class="keycap">z</code> on a US keyboard. Labelled <code class="keycap">w</code> on an AZERTY (e.g., French) keyboard, and <code class="keycap">y</code> on a QWERTZ (e.g., German) keyboard.</td></tr>
-
- <tr><td><code id="code-Minus" class="key-code">'Minus'</code></td>
- <td>0x2d</td><td><code class="keycap">-</code> and <code class="keycap">_</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Period" class="key-code">'Period'</code></td>
- <td>0x37</td><td><code class="keycap">.</code> and <code class="keycap">></code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Quote" class="key-code">'Quote'</code></td>
- <td>0x34</td><td><code class="keycap">'</code> and <code class="keycap">"</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Semicolon" class="key-code">'Semicolon'</code></td>
- <td>0x33</td><td><code class="keycap">;</code> and <code class="keycap">:</code> on a US keyboard.</td></tr>
- <tr><td><code id="code-Slash" class="key-code">'Slash'</code></td>
- <td>0x38</td><td><code class="keycap">/</code> and <code class="keycap">?</code> on a US keyboard.</td></tr>
- </tbody>
- </table>
- </section>
-
- <section id="key-alphanumeric-functional">
- <h1>Functional Keys</h1>
- <p>The Functional keys (<em>not to be confused with the
- <a href="#key-function-section">Function keys</a> described later</em>) are those
- keys in the Alphanumeric section that provide general editing functions that are common to all locales
- (like Shift, Tab, Enter and Backspace).
- With a few exceptions, these keys do not change meaning based on the current keyboard layout.
- </p>
- <object class="figure" data="keyboard-codes-alphanum2.svg" type="image/svg+xml" width="653" height="225" title="The standard set of functional keys in the alphanumeric section."></object>
- <table id="table-key-code-alphanumeric-functional-1" class="data-table full-width">
- <caption>List of code values for functional keys in the Alphanumeric section.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-AltLeft" class="key-code">'AltLeft'</code></td>
- <td>0xe2</td><td>Labelled <code class="keycap">Alt</code> or <code class="keycap">Option</code>.</td></tr>
- <tr><td><code id="code-AltRight" class="key-code">'AltRight'</code></td>
- <td>0xe6</td><td>Labelled <code class="keycap">Alt</code> or <code class="keycap">Option</code>. This is the <code class="keycap">AltGr</code> key on many keyboard layouts.</td></tr>
- <tr><td><code id="code-CapsLock" class="key-code">'CapsLock'</code></td>
- <td>0x39</td><td></td></tr>
- <tr><td><code id="code-ContextMenu" class="key-code">'ContextMenu'</code></td>
- <td>0x65</td><td>The application context menu key, which is typically found between the right OS key and the right Control key.</td></tr>
- <tr><td><code id="code-ControlLeft" class="key-code">'ControlLeft'</code></td>
- <td>0xe0</td><td></td></tr>
- <tr><td><code id="code-ControlRight" class="key-code">'ControlRight'</code></td>
- <td>0xe4</td><td></td></tr>
- <tr><td><code id="code-Enter" class="key-code">'Enter'</code></td>
- <td>0x28</td><td>Labelled <code class="keycap">Enter</code> and <code class="keycap">Return</code> on Macintosh keyboards.</td></tr>
- <tr><td><code id="code-OSLeft" class="key-code">'OSLeft'</code></td>
- <td>0xe3</td><td>The Windows, <code class="keycap">⌘</code>, <code class="keycap">Command</code> or other OS symbol key.</td></tr>
- <tr><td><code id="code-OSRight" class="key-code">'OSRight'</code></td>
- <td>0xe7</td><td>The Windows, <code class="keycap">⌘</code>, <code class="keycap">Command</code> or other OS symbol key.</td></tr>
- <tr><td><code id="code-ShiftLeft" class="key-code">'ShiftLeft'</code></td>
- <td>0xe1</td><td></td></tr>
- <tr><td><code id="code-ShiftRight" class="key-code">'ShiftRight'</code></td>
- <td>0xe5</td><td></td></tr>
- <tr><td><code id="code-Space" class="key-code">'Space'</code></td>
- <td>0x2c</td><td>The <code class="keycap"> </code> key.</td></tr>
- <tr><td><code id="code-Tab" class="key-code">'Tab'</code></td>
- <td>0x2b</td><td></td></tr>
- </tbody>
- </table>
- <p>On some keyboards (notably Japanese and Korean) the spacebar is reduced in size to make room
- for extra keys on the bottom row. These keys typically allow the users to change the current input
- mode. Note that even though some of these Japanese and Korean keys occupy the same physical location on the
- keyboard, they use different <code>code</code> values.
- </p>
- <object class="figure" data="functional-row-a.svg" type="image/svg+xml" width="700" height="160" title="Comparison of the lower row of functional keys on different keyboards."></object>
- <table id="table-key-code-alphanumeric-functional-2" class="data-table full-width">
- <caption>List of code values for functional keys found on Japanese and Korean keyboards.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-Convert" class="key-code">'Convert'</code></td>
- <td>0x8a</td><td>Japanese: <code class="keycap">変換</code> (<span class="phonetic">henkan</span>)</td></tr>
- <tr><td><code id="code-HangulMode" class="key-code">'HangulMode'</code></td>
- <td>0x90</td><td>Korean: <code class="keycap">한/영</code> (<span class="phonetic">han/yeong</span>)</td></tr>
- <tr><td><code id="code-Hanja" class="key-code">'Hanja'</code></td>
- <td>0x91</td><td>Korean: <code class="keycap">한자</code> (<span class="phonetic">hanja</span>)</td></tr>
- <tr><td><code id="code-KanaMode" class="key-code">'KanaMode'</code></td>
- <td>0x88</td><td>Japanese: <code class="keycap">カタカナ/ひらがな/ローマ字</code> (<span class="phonetic">katakana/hiragana/romaji</span>)</td></tr>
- <tr><td><code id="code-NoConvert" class="key-code">'NoConvert'</code></td>
- <td>0x8b</td><td>Japanese: <code class="keycap">無変換</code> (<span class="phonetic">muhenkan</span>)</td></tr>
- </tbody>
- </table>
- <p>On Apple keyboards, some keys on the bottom row are omitted and others are arranged in
- a different order.
- </p>
- </section>
- </section>
-
- <section id="key-controlpad-section">
- <h1>Control Pad Section</h1>
- <p>The Control Pad contains keys for navigating and editing documents.
- </p>
- <object class="figure" data="control-pad.svg" type="image/svg+xml" width="495" height="135" title="Standard Control Pad layouts"></object>
- <table id="table-key-code-controlpad" class="data-table full-width">
- <caption>List of code values for keys in the ControlPad section.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-Delete" class="key-code">'Delete'</code></td>
- <td>0x4c</td><td></td></tr>
- <tr><td><code id="code-End" class="key-code">'End'</code></td>
- <td>0x4d</td><td></td></tr>
- <tr><td><code id="code-Help" class="key-code">'Help'</code></td>
- <td>0x75</td><td>Not present on standard PC keyboards.</td></tr>
- <tr><td><code id="code-Home" class="key-code">'Home'</code></td>
- <td>0x4a</td><td></td></tr>
- <tr><td><code id="code-Insert" class="key-code">'Insert'</code></td>
- <td>0x49</td><td>Not present on Apple keyboards.</td></tr>
- <tr><td><code id="code-PageUp" class="key-code">'PageDown'</code></td>
- <td>0x4e</td><td></td></tr>
- <tr><td><code id="code-PageDown" class="key-code">'PageUp'</code></td>
- <td>0x4b</td><td></td></tr>
- </tbody>
- </table>
- <p>Note: The <code>code</code> for the <code class="key-code">'Fn'</code> key (found on
- some Apple keyboards) is defined below in the Function Section.
- </p>
- </section>
-
- <section id="key-arrowpad-section">
- <h1>Arrow Pad Section</h1>
- <p>The Arrow Pad section contains the 4 arrow keys.
- </p>
- <object class="figure" data="arrow-pad.svg" type="image/svg+xml" width="160" height="115" title="Standard Arrow Pad layout"></object>
- <table id="table-key-code-arrowpad" class="data-table full-width">
- <caption>List of code values for keys in the ArrowPad section.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-ArrowDown" class="key-code">'ArrowDown'</code></td>
- <td>0x51</td><td></td></tr>
- <tr><td><code id="code-ArrowLeft" class="key-code">'ArrowLeft'</code></td>
- <td>0x50</td><td></td></tr>
- <tr><td><code id="code-ArrowRight" class="key-code">'ArrowRight'</code></td>
- <td>0x4f</td><td></td></tr>
- <tr><td><code id="code-ArrowUp" class="key-code">'ArrowUp'</code></td>
- <td>0x52</td><td></td></tr>
- </tbody>
- </table>
- </section>
-
- <section id="key-numpad-section">
- <h1>Numpad Section</h1>
- <p>The Numpad Section contains numeric and mathematical operator keys arranged in a calculator-grid
- to facilitate numeric data entry.
- </p>
- <object class="figure" data="numpad.svg" type="image/svg+xml" width="606" height="247" title="Standard Numpad layouts"></object>
- <p>The standard Numpad is sometimes extended with additional keys for parentheses, operators,
- hexadecimal symbols, or calculator functions (like backspace). Some of the commonly added keys are
- listed in the table below.
- </p>
- <table id="table-key-code-numpad" class="data-table full-width">
- <caption>List of code values for keys in the Numpad section.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-NumLock" class="key-code">'NumLock'</code></td>
- <td>0x53</td><td></td></tr>
- <tr><td><code id="code-Numpad0" class="key-code">'Numpad0'</code></td>
- <td>0x62</td><td><code class="keycap">0</code> and <code class="keycap">Insert</code></td></tr>
- <tr><td><code id="code-Numpad1" class="key-code">'Numpad1'</code></td>
- <td>0x59</td><td><code class="keycap">1</code> and <code class="keycap">End</code></td></tr>
- <tr><td><code id="code-Numpad2" class="key-code">'Numpad2'</code></td>
- <td>0x5a</td><td><code class="keycap">2</code> and <code class="keycap">ArrowDown</code></td></tr>
- <tr><td><code id="code-Numpad3" class="key-code">'Numpad3'</code></td>
- <td>0x5b</td><td><code class="keycap">3</code> and <code class="keycap">PageDown</code></td></tr>
- <tr><td><code id="code-Numpad4" class="key-code">'Numpad4'</code></td>
- <td>0x5c</td><td><code class="keycap">4</code> and <code class="keycap">ArrowLeft</code></td></tr>
- <tr><td><code id="code-Numpad5" class="key-code">'Numpad5'</code></td>
- <td>0x5d</td><td><code class="keycap">5</code></td></tr>
- <tr><td><code id="code-Numpad6" class="key-code">'Numpad6'</code></td>
- <td>0x5e</td><td><code class="keycap">6</code> and <code class="keycap">ArrowRight</code></td></tr>
- <tr><td><code id="code-Numpad7" class="key-code">'Numpad7'</code></td>
- <td>0x5f</td><td><code class="keycap">7</code> and <code class="keycap">Home</code></td></tr>
- <tr><td><code id="code-Numpad8" class="key-code">'Numpad8'</code></td>
- <td>0x60</td><td><code class="keycap">8</code> and <code class="keycap">ArrowUp</code></td></tr>
- <tr><td><code id="code-Numpad9" class="key-code">'Numpad9'</code></td>
- <td>0x61</td><td><code class="keycap">9</code> and <code class="keycap">PageUp</code></td></tr>
- <tr><td><code id="code-NumpadAdd" class="key-code">'NumpadAdd'</code></td>
- <td>0x57</td><td><code class="keycap">+</code></td></tr>
- <tr><td><code id="code-NumpadBackspace" class="key-code">'NumpadBackspace'</code></td>
- <td>0xbb</td><td>Found on the Microsoft Natural Keyboard.</td></tr>
- <tr><td><code id="code-NumpadClear" class="key-code">'NumpadClear'</code></td>
- <td>0xd8</td><td></td></tr>
- <tr><td><code id="code-NumpadClearEntry" class="key-code">'NumpadClearEntry'</code></td>
- <td>0xd9</td><td></td></tr>
- <tr><td><code id="code-NumpadComma" class="key-code">'NumpadComma'</code></td>
- <td>0x85</td><td><code class="keycap">,</code> (thousands separator). For locales where the thousands separator is a <code class="glyph">'.'</code> (e.g., Brazil), this key may generate a <code class="glyph">'.'</code>.</td></tr>
- <tr><td><code id="code-NumpadDecimal" class="key-code">'NumpadDecimal'</code></td>
- <td>0x63</td><td><code class="keycap">.</code> (decimal separator) and <code class="keycap">Delete</code>. For locales where the decimal separator is <code class="glyph">','</code> (e.g., Brazil), this key may generate a <code class="glyph">','</code>.</td></tr>
- <tr><td><code id="code-NumpadDivide" class="key-code">'NumpadDivide'</code></td>
- <td>0x54</td><td><code class="keycap">/</code></td></tr>
- <tr><td><code id="code-NumpadEnter" class="key-code">'NumpadEnter'</code></td>
- <td>0x58</td><td></td></tr>
- <tr><td><code id="code-NumpadMemoryAdd" class="key-code">'NumpadMemoryAdd'</code></td>
- <td>0xd3</td><td></td></tr>
- <tr><td><code id="code-NumpadMemoryClear" class="key-code">'NumpadMemoryClear'</code></td>
- <td>0xd2</td><td></td></tr>
- <tr><td><code id="code-NumpadMemoryRecall" class="key-code">'NumpadMemoryRecall'</code></td>
- <td>0xd1</td><td></td></tr>
- <tr><td><code id="code-NumpadMemoryStore" class="key-code">'NumpadMemoryStore'</code></td>
- <td>0xd0</td><td></td></tr>
- <tr><td><code id="code-NumpadMemorySubtract" class="key-code">'NumpadMemorySubtract'</code></td>
- <td>0xd4</td><td></td></tr>
- <tr><td><code id="code-NumpadMultiply" class="key-code">'NumpadMultiply'</code></td>
- <td>0x55</td><td><code class="keycap">*</code></td></tr>
- <tr><td><code id="code-NumpadParenLeft" class="key-code">'NumpadParenLeft'</code></td>
- <td>0xb6</td><td><code class="keycap">(</code> Found on the Microsoft Natural Keyboard.</td></tr>
- <tr><td><code id="code-NumpadParenRight" class="key-code">'NumpadParenRight'</code></td>
- <td>0xb7</td><td><code class="keycap">)</code> Found on the Microsoft Natural Keyboard.</td></tr>
- <tr><td><code id="code-NumpadSubtract" class="key-code">'NumpadSubtract'</code></td>
- <td>0x56</td><td><code class="keycap">-</code></td></tr>
- </tbody>
- </table>
- <p>For Numpads that provide keys not listed here, a <code>code</code> value string should be created by
- starting with 'Numpad' and appending an appropriate description of the key.
- </p>
- </section>
-
- <section id="key-function-section">
- <h1>Function Section</h1>
- <p>The Function section runs along the top of the keyboard and contains the function keys and
- a few additional special keys (for example, <code class="key-code">'Escape'</code> and
- <code class="key-code">'PrintScreen'</code>).
- </p>
- <p>On some keyboards (especially those found on laptops or other portable computers), the function keys
- (<code class="key-code">'F1'</code> ... <code class="key-code">'F12'</code>)
- are defined to have other primary functions (like controlling display brightness or
- audio volume) and require that a separate <code class="key-code">'Fn'</code> key
- be pressed to make them act as function keys.
- Unfortunately, the primary functions assigned to these keys varies widely from one manufacturer to the next.
- Because of this, the <code>code</code> is always set to the function key name.
- </p>
- <table id="table-key-code-function" class="data-table full-width">
- <caption>List of code values for keys in the Function section.</caption>
- <thead><tr><th>Code Value</th><th>USB Usage ID<br/>Page 0x07<br/>(Informative)</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-Escape" class="key-code">'Escape'</code></td>
- <td>0x29</td><td></td></tr>
- <tr><td><code id="code-F1" class="key-code">'F1'</code></td>
- <td>0x3a</td><td></td></tr>
- <tr><td><code id="code-F2" class="key-code">'F2'</code></td>
- <td>0x3b</td><td></td></tr>
- <tr><td><code id="code-F3" class="key-code">'F3'</code></td>
- <td>0x3c</td><td></td></tr>
- <tr><td><code id="code-F4" class="key-code">'F4'</code></td>
- <td>0x3d</td><td></td></tr>
- <tr><td><code id="code-F5" class="key-code">'F5'</code></td>
- <td>0x3e</td><td></td></tr>
- <tr><td><code id="code-F6" class="key-code">'F6'</code></td>
- <td>0x3f</td><td></td></tr>
- <tr><td><code id="code-F7" class="key-code">'F7'</code></td>
- <td>0x40</td><td></td></tr>
- <tr><td><code id="code-F8" class="key-code">'F8'</code></td>
- <td>0x41</td><td></td></tr>
- <tr><td><code id="code-F9" class="key-code">'F9'</code></td>
- <td>0x42</td><td></td></tr>
- <tr><td><code id="code-F10" class="key-code">'F10'</code></td>
- <td>0x43</td><td></td></tr>
- <tr><td><code id="code-F11" class="key-code">'F11'</code></td>
- <td>0x44</td><td></td></tr>
- <tr><td><code id="code-F12" class="key-code">'F12'</code></td>
- <td>0x45</td><td></td></tr>
- <tr><td><code id="code-Fn" class="key-code">'Fn'</code></td>
- <td></td><td>This is typically a hardware key that does not generate a separate code. Most keyboards do not place this key in the Function section, but it is included here to keep with related keys.</td></tr>
- <tr><td><code id="code-FLock" class="key-code">'FLock'</code></td>
- <td></td><td>Found on the Microsoft Natural Keyboard.</td></tr>
- <tr><td><code id="code-PrintScreen" class="key-code">'PrintScreen'</code></td>
- <td>0x46</td><td><code class="keycap">PrintScreen</code> and <code class="keycap">SysReq</code></td></tr>
- <tr><td><code id="code-ScrollLock" class="key-code">'ScrollLock'</code></td>
- <td>0x47</td><td></td></tr>
- <tr><td><code id="code-Pause" class="key-code">'Pause'</code></td>
- <td>0x48</td><td><code class="keycap">Pause</code> and <code class="keycap">Break</code></td></tr>
- </tbody>
- </table>
- <p>For keyboards that provide more than 12 function keys, the <code>code</code> value follows the pattern
- shown above with 'F' followed by the function key number - <code class="key-code">'F13'</code>, <code class="key-code">'F14'</code>,
- <code class="key-code">'F15'</code>, and so on.
- </p>
- <p>Note: Apple keyboards may have <code class="key-code">'Eject'</code> or <code class="key-code">'Power'</code>
- keys in the Function section. The <code>code</code> values
- for these keys are defined in the Media Keys section.
- </p>
- </section>
-
- <section id="key-media">
- <h1>Media Keys</h1>
- <p>Keys that fall outside the sections listed above are referred to as "media keys" since
- they commonly provide "media" functions like play, pause or volume control.
- </p>
- <p>These are extra keys that many keyboard manufacturers add, but do not have a consistent location.
- These keys are often distinct from normal typing keys in appearance and may be recessed in the
- keyboard.
- </p>
- <p>On laptop keyboards, these keys are often merged with the Function keys, with the "media" interpretation
- being the primary function of the key and the "function key" interpretation requiring the
- <code class="key-code">'Fn'</code> key to be pressed at the same time. In this configuration the
- <code>code</code> should be set to match the function key (<code class="key-code">'F1'</code> ...
- <code class="key-code">'F12'</code>). When the keys are merged in this fashion, the <code>code</code>
- values are taken from the function key value since the "media" value is not consistent across
- keyboards.
- </p>
- <table id="table-key-code-media" class="data-table full-width">
- <caption>List of code values for media keys.</caption>
- <thead><tr><th>Code Value</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-BrowserBack" class="key-code">'BrowserBack'</code></td>
- <td>Some laptops place this key to the left of the <code class="key-code">'ArrowUp'</code> key.</td></tr>
- <tr><td><code id="code-BrowserFavorites" class="key-code">'BrowserFavorites'</code></td>
- <td></td></tr>
- <tr><td><code id="code-BrowserForward" class="key-code">'BrowserForward'</code></td>
- <td>Some laptops place this key to the right of the <code class="key-code">'ArrowUp'</code> key.</td></tr>
- <tr><td><code id="code-BrowserHome" class="key-code">'BrowserHome'</code></td>
- <td></td></tr>
- <tr><td><code id="code-BrowserRefresh" class="key-code">'BrowserRefresh'</code></td>
- <td></td></tr>
- <tr><td><code id="code-BrowserSearch" class="key-code">'BrowserSearch'</code></td>
- <td></td></tr>
- <tr><td><code id="code-BrowserStop" class="key-code">'BrowserStop'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Eject" class="key-code">'Eject'</code></td>
- <td>This key is placed in the Function section on some Apple keyboards.</td></tr>
- <tr><td><code id="code-LaunchApp1" class="key-code">'LaunchApp1'</code></td>
- <td>Sometimes labelled <code class="keycap">My Computer</code> on the keyboard</td></tr>
- <tr><td><code id="code-LaunchApp2" class="key-code">'LaunchApp2'</code></td>
- <td>Sometimes labelled <code class="keycap">Calculator</code> on the keyboard</td></tr>
- <tr><td><code id="code-LaunchMail" class="key-code">'LaunchMail'</code></td>
- <td></td></tr>
- <tr><td><code id="code-MediaNextTrack" class="key-code">'MediaNextTrack'</code></td>
- <td></td></tr>
- <tr><td><code id="code-MediaPlayPause" class="key-code">'MediaPlayPause'</code></td>
- <td></td></tr>
- <tr><td><code id="code-MediaPreviousTrack" class="key-code">'MediaPreviousTrack'</code></td>
- <td></td></tr>
- <tr><td><code id="code-MediaSelect" class="key-code">'MediaSelect'</code></td>
- <td></td></tr>
- <tr><td><code id="code-MediaStop" class="key-code">'MediaStop'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Power" class="key-code">'Power'</code></td>
- <td>This key is placed in the Function section on some Apple keyboards, replacing the <code class="key-code">'Eject'</code> key.</td></tr>
- <tr><td><code id="code-Sleep" class="key-code">'Sleep'</code></td>
- <td></td></tr>
- <tr><td><code id="code-VolumeDown" class="key-code">'VolumeDown'</code></td>
- <td></td></tr>
- <tr><td><code id="code-VolumeMute" class="key-code">'VolumeMute'</code></td>
- <td></td></tr>
- <tr><td><code id="code-VolumeUp" class="key-code">'VolumeUp'</code></td>
- <td></td></tr>
- <tr><td><code id="code-WakeUp" class="key-code">'WakeUp'</code></td>
- <td></td></tr>
- </tbody>
- </table>
- </section>
-
- <section id="key-legacy">
- <h1>Legacy Keys</h1>
- <p>These keys are not found on modern keyboards.
- They are listed here are for reference purposes.
- </p>
- <table id="table-key-code-legacy" class="data-table full-width">
- <caption>List of code values for legacy keys.</caption>
- <thead><tr><th>Code Value</th><th>Notes (Informative)</th></tr></thead>
- <tbody>
- <tr><td><code id="code-Abort" class="key-code">'Abort'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Hyper" class="key-code">'Hyper'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Meta" class="key-code">'Meta'</code></td>
- <td>Do not use <code class="key-code">'Meta'</code> as a key <code>code</code>. The key labelled <code class="keycap">Meta</code> should be encoded as <code class="key-code">'OSLeft'</code>.</td></tr>
- <tr><td><code id="code-Resume" class="key-code">'Resume'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Super" class="key-code">'Super'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Suspend" class="key-code">'Suspend'</code></td>
- <td></td></tr>
- <tr><td><code id="code-Turbo" class="key-code">'Turbo'</code></td>
- <td></td></tr>
- </tbody>
- </table>
- </section>
-
- </section><!-- keyboard-key-codes -->
-<!--
- </section><!-- keyboards -->
-<!--
- <section id="non-keyboards">
- <h1>Non-Standard Keyboards and Other Input Devices</h1>
- <p>This section briefly describes how key input from non-standard keyboards and other
- input devices should be handled with respect to the <code>code</code> attribute.
- </p>
- <p>In general, these devices do not suffer from the complications found on
- found on standard PC computers (modifier keys and support for multiple input layouts)
- so the <code>code</code> attribute can be duplicated from the <code>key</code>
- attribute or left empty.
- </p>
-
- <section id="remote-controls">
- <h1>Media Remote Controls</h1>
- <p>Remote controls for media devices typically consist of a set of buttons that are used to directly
- control media functions on the device. These remote control buttons typically do not
- have modifier states so each button is assigned a single function (like "Play", "Pause",
- "Up", "Menu" or "Exit").
- </p>
- <p>This simple arrangement where each button has one function means that the
- <code>code</code> attribute will usually be exactly the same as the <code>key</code>
- attribute for that button. It is only if the remote control has a mechanism
- (like the "2nd" function button on a calculator) that allows buttons to produce
- alternate <code>key</code> values that the <code>code</code> value will differ from
- the <code>key</code> value.
- In this case, the value of the <code>code</code> attribute should always be the value
- that the button would produce when in its factory-reset condition.
- </p>
- </section><!-- remote-controls -->
-<!--
- <section id="virtual-keyboards">
- <h1>Virtual Keyboards</h1>
- <p>When a virtual keyboard is mimicking the layout and functionality of a standard
- keyboard, then it should also set the <code>code</code> attribute as appropriate.
- Otherwise, it can leave this field blank.
- </p>
- </section><!-- virtual-keyboards -->
-<!--
- <section id="chording-keyboards">
- <h1>Chording Keyboards</h1>
- <p>A chording keyboard is a keyboard with a small number of physical keys that requires
- the user to hold a number of keys simultaneously
- (or press them in sequence) to produce a single key input event. The advantage of chording
- keyboards is that they require a small number of distinct keys and can usually be
- operated with a single hand.
- </p>
- <p>If implemented properly, the system should be unaware that the user is entering text
- using a chording keyboard, so the code that translates the chord combinations to
- regular key events should fabricate appropriate <code>code</code> values.
- </p>
- </section><!-- chording-keyboards -->
-<!--
- <section id="other-devices">
- <h1>Other Devices</h1>
- <p>Other devices that generate key events should be supported in the manner described above
- in the <a href="#remote-controls">Media Remote Controls</a> section:
- </p>
- <ul>
- <li>If the button or key always produces the same <code>key</code> value, then the
- <code>code</code> should simply be duplicated from the <code>key</code>.
- </li>
- <li>If the button of key can produce different <code>key</code> values based on some
- modifier state, then the <code>code</code> value should be the <code>key</code> value
- generated when the button is pressed while the device is in its factory-reset state.
- </li>
- </ul>
- <p>When there isn't an appropriate <code>code</code> value already defined and a new
- value needs to be chosen, the string value should be constructed so that descriptive
- (avoid names that are ambiguous or too short) and wherever possible, related buttons
- should share a common prefix (like the Numpad keys).
- </p>
- </section><!-- other-devices -->
-<!--
- </section><!-- keyboards -->
</section><!-- keyboard-events -->