W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

Re: ISSUE-137 (IME-keypress): Should keypress events fire when using an IME? [DOM3 Events]

From: Jacob Rossi <Jacob.Rossi@microsoft.com>
Date: Tue, 16 Aug 2011 23:19:48 +0000
To: "www-dom@w3.org" <www-dom@w3.org>, Masayuki Nakano <masayuki@d-toybox.com>
CC: "hallvord@opera.com" <hallvord@opera.com>
Message-ID: <D0BC8E77E79D9846B61A2432D1BA4EAE0341A85D@TK5EX14MBXC287.redmond.corp.microsoft.com>

Thanks for your feedback. Upon further review, no implementation fires keypress events during the processing of IME composition--and indeed it would be problematic if they did! However, some fire keydown/keyup during the sequence.  

I have updated the spec to clarify that:
	a) keypress never fires during an IME sequence
	b) keydown/keyup  *may* fire during the processing of an IME sequence

Whenever possible, implementations should provide keydown/keyup (but not keypress) while using an IME--this enables advanced scenarios where a web app preprocess input based on keystrokes. However, it's possible that some IMEs may "eat" the keyboard messages and therefore prevent an implementation from firing keydown/keyup. Therefore, the existing note remains:

"Note: In some implementations or system configurations, some key events, or their values, might be suppressed by the IME in use."

Therefore, Firefox's behavior is compliant with current spec text. However, I would encourage you to consider supporting keydown/keyup when possible so as to be interoperable with other implementations.

This change should not affect implementations. It's merely a clarification of what implementations already do and the technical limitations of the environment.  Please let us know if you have issues with the change. Additionally, this is on the agenda for tomorrow's telecon to summarize the few minor spec changes that have happened since Last Call.



From: Masayuki Nakano <masayuki@d-toybox.com>
Date: Tue, 09 Aug 2011 17:57:22 +0900
Message-ID: <4E40F672.6050105@d-toybox.com>
To: Web Applications Working Group WG <public-webapps@w3.org>

Currently, Firefox doesn't fire any key events (keydown, keyup and 
keypress) during IME composition.  There are some reasons:

1. Most firefox code handles key events without IME composition state 
check. (This is our internal reason, though) Therefore, if we would fire 
key events during composition, we would need to fix very many code.

2. Web application developers cannot check IME composition state 
directly.  If they needed to check it, they needed to listen 
compositionstart and compositionend events and make a bool variable. 
Therefore, if web developers handled key events without IME state check, 
IME users couldn't use some web applications.

3. Some web developers may not know well about IME behavior. Their web 
applications might break IME behavior by handling key events.

I'd like to *suggest* that key events shouldn't be fired during IME 
composition, especially for #3.  If web developers want to know the 
timing of updating composition string, they can use compositionupdate or 
textinput. I think that these events are better for the purpose since 
IME composition string can be updated by clicking on candidate window, 
i.e., it doesn't cause key events.


On 2010/10/06 15:16, Web Applications Working Group Issue Tracker wrote:
> ISSUE-137 (IME-keypress): Should keypress events fire when using an IME? [DOM3 Events]
> http://www.w3.org/2008/webapps/track/issues/137
> Raised by: Doug Schepers
> On product: DOM3 Events
> Hallvord R. M. Steen<http://lists.w3.org/Archives/Public/www-dom/2010JulSep/0176.html>:
> [[
> current spec text says about the keypress event:
>> This event type shall be generated after the keyboard mapping
>> but before the processing of an input method editor, normally
>> associated with the dispatching of a compositionstart, compositionupdate,
>> or compositionend event.
> I think this is wrong, if an IME is actively processing the input no
> keypress event should fire.
> ]]

Masayuki Nakano <masayuki@d-toybox.com>
Manager, Internationalization, Mozilla Japan.
Received on Tuesday, 16 August 2011 23:20:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:18 UTC