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: Masayuki Nakano <masayuki@d-toybox.com>
Date: Mon, 22 Aug 2011 13:01:48 +0900
Message-ID: <4E51D4AC.2050904@d-toybox.com>
To: Jacob Rossi <Jacob.Rossi@microsoft.com>
CC: "www-dom@w3.org" <www-dom@w3.org>, "hallvord@opera.com" <hallvord@opera.com>
Hi, thank you for your reply.

If the spec would recommend implementations to dispatch keydown/keyup 
events, I'd change firefox's behavior in the future.

However, I still think that the keydown/keyup event handler might block 
IME user's input if web app developers didn't know IME.

And also, if web app developers assumed that these events *must* be 
dispatched during composition, some IME users of Linux (GTK) would meet 
non-functional web apps by the platform limitation.

And I think that keydown/keyup events should have isComposing attribute 
which returns the IME composing state at the implementation dispatching 
the key events. If so, web app developers can know whether the 
keydown/keyup events are dispatched during composition or not easily.


On 2011/08/17 8:19, Jacob Rossi wrote:
> Hi,
> 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.
> Cheers,
> Jacob
> =============================================================
> 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>
> Hello.
> 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.
> thanks,
> 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 Monday, 22 August 2011 04:02:02 UTC

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