ISSUE-142 (multiple keypress): one keydown might fire multiple keypress/textInput events [DOM3 Events]

ISSUE-142 (multiple keypress): one keydown might fire multiple keypress/textInput events [DOM3 Events]

http://www.w3.org/2008/webapps/track/issues/142

Raised by: Doug Schepers
On product: DOM3 Events

Hallvord R. M. Steen <http://lists.w3.org/Archives/Public/www-dom/2010JulSep/0181.html>:
[[
Spec text on keydown event
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-keydown

> if the key is associated with a character, the default action
> shall be to dispatch a textInput event with the character as
> the value of the TextEvent.data attribute

uses singular forms ('a textInput event') which doesn't take into account  
that a single keydown event might cause several keypress (-> textInput)  
events.

Trivial example: press a dead key twice. The default action of the second  
keydown will be to fire two keypress and two text input events.

More far-fetched: use a keyboard layout where some keys are mapped to  
input several characters. Chrome, Firefox and IE (on Windows) agree on  
firing keydown, multiple keypress (and multiple textInput if supported),  
single keyup.

Suggested text:

<li>if the key inserts one or more characters, the default action shall be  
to dispatch one <a class="eventtype"  
href="#event-type-textInput"><code>textInput</code></a> event for each  
character inserted, with that character as the value of the <a  
href="#events-TextEvent-data"><code>TextEvent.data</code></a> attribute

(Leaving aside for a moment the issue that I would also like to replace  
textInput with keypress in that text..)
]]

Received on Wednesday, 6 October 2010 06:24:04 UTC