W3C home > Mailing lists > Public > public-webapi@w3.org > May 2008

Re: specification of "legacy" key events

From: Hallvord R. M. Steen <hallvord@opera.com>
Date: Thu, 08 May 2008 11:14:05 +0200
To: olli@pettay.fi
Cc: public-webapi@w3.org
Message-ID: <op.uatvxrn9a3v5gv@hr-opera.oslo.opera.com>

On Thu, 08 May 2008 03:22:08 +0200, Olli Pettay <Olli.Pettay@helsinki.fi>  
wrote:

>>> Why not? IME could emulate normal keydown/keypress/keyup.
>>
>> For legacy content compatibility. IMEs that process key input do not
>> currently cause keypress events to fire, and I believe changing this
>> would break legacy content for IME users. (I'm fairly sure this point
>> has been raised by implementors and I could try to find the relevant
>> E-mails if you need them.)

> Mozilla does dispatch a keypress with IME (at least when testing MS IME
> Standard 2002 ver 8.1 / Hiragana) . So if you know some relevant
> emails, would be great have the links.

Hi,
one E-mail I had in mind was from Oliver Hunt on August 1st 2007 [1],  
where he says:

> * KeyPress and TextInput events are *not* fired if an Input Method has  
> handled the event

but when re-reading the E-mail what Oliver actually said is a bit more  
complex than I managed to capture in the proposed spec.

The most important point is that the keyCode of any keydown and keypress  
event must be 229 if an IME is processing the input. Apart from that there  
is some inconsistency -

Firefox fires keydown and keypress for the *first* character - the one  
that initiates IME processing. Then it fires no keydown/press/up events  
until character conversion is confirmed in the IME (for Japanese IME this  
is done by pressing enter and Firefox fires a keyUp for the enter key).

On the other hand, MSIE fires keydown and keyup events - keydown has code  
229 and keyup has the virtual key code normally associated with the given  
key.

Safari behaves like IE.

Opera seems to fire an initial keydown and no more events - nearly what  
Firefox does but without the keypress.

IMHO, there is no strong use case for firing events while IME is  
processing - AFAIK there is nothing the web app can do about the input  
except confuse itself. Unless someone brings up use cases or content that  
depends on what Safari&IE do I'd suggest we specify something along the  
lines of what Firefox&Opera do. To be specific, a keydown and a keypress  
with codes 229 initally and no events while IME is handling input.  
Inserting the text might cause a keyup for enter (if that IME uses enter  
to confirm input) and must cause a textInput event.

[1] http://lists.w3.org/Archives/Public/public-webapi/2007Aug/0007.html

-- 
Hallvord R. M. Steen
Core QA JavaScript tester, Opera Software
http://www.opera.com/
Opera - simply the best Internet experience
Received on Thursday, 8 May 2008 09:14:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 8 May 2008 09:14:49 GMT