ISSUE-137: Clarified that keypress events do not fire during an IME sequence. Also, fixed incorrect statement that keydown events fire prior to processing of an IME sequence. The new defined behavior matches all major implementations. An existing note remains that says keyboard events may be surpressed when using an IME--this is by design as some IME's will not give individual key events during composition.
--- a/html/DOM3-Events.html Wed Aug 17 03:54:32 2011 +0900
+++ b/html/DOM3-Events.html Wed Aug 17 08:02:12 2011 +0900
@@ -25,7 +25,7 @@
</p>
<h1 id="Overview-title">Document Object Model (DOM) Level 3 Events Specification</h1>
<!-- @-->
- <h2 id="Overview-W3C-doctype">W3C Editor's Draft <span class="2011-05-24">9 August 2011</span></h2>
+ <h2 id="Overview-W3C-doctype">W3C Editor's Draft <span class="2011-05-24">16 August 2011</span></h2>
<dl>
<dt>This version:</dt>
<dd><a href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html?rev=1.200">http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html?rev=1.200</a></dd>
@@ -3994,7 +3994,7 @@
</td>
</tr>
</table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> must dispatch this event when a key is pressed down. The <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type must be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a> but before the processing of an <a class="def" href="#glossary-ime">input method editor</a>, normally associated with the dispatching of a <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a>, <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a>, or <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event. This event type must be dispatched before the <a class="eventtype" href="#event-type-compositionstart"><code>keypress</code></a> and <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> events event associated with the same key.</p>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> must dispatch this event when a key is pressed down. The <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type must be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>. This event type must be dispatched before the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> and <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> events event associated with the same key.</p>
<p>The default action of the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event depends upon the key:</p>
<ul>
<li>if the key is associated with a character, the default action must be to dispatch a <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event; in the case where the key which is associated with multiple characters (such as with a macro or certain sequences of dead keys), the default action must be to dispatch one <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event for each character
@@ -4047,7 +4047,7 @@
</td>
</tr>
</table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> must dispatch this event when a key is pressed down, if and only if that key normally produces a <a class="def" href="#glossary-character-value">character value</a>. The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type must be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a> but before the processing of an <a class="def" href="#glossary-ime">input method editor</a>, normally associated with the dispatching of a <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a>, <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a>, or <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event. This event type must be dispatched after the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event and before the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event associated with the same key.</p>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> must dispatch this event when a key is pressed down, if and only if that key normally produces a <a class="def" href="#glossary-character-value">character value</a>. The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type must be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>. It must not be fired when using an <a class="def" href="#glossary-ime">input method editor</a>. This event type must be dispatched after the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event and before the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event associated with the same key.</p>
<p>The default action of the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event must be to dispatch a <a class="eventtype" href="#event-type-textinput"><code>textinput</code></a> event with the <a href="#events-TextEvent-data"><code class="attribute-name">data</code></a> attribute set to the value of the <a href="#events-KeyboardEvent-char"><code class="attribute-name">char</code></a> attribute of the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event.</p>
<p class="note" id="_31"><strong>Note:</strong> the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is traditionally associated with detecting a <a class="def" href="#glossary-character-value">character value</a> rather than a physical key, and may not be available on all keys in some configurations.</p>
<p class="warning" id="_32"><strong>Warning!</strong> the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type in favor of the <a class="eventtype" href="#event-type-textinput"><code>textinput</code></a> event type.</p>