Re: [UIEvents] Keydown/keyup events during composition

Hello, sorry for the delay to reply due to national holiday of Japan.

As far as I know, Gecko doesn't dispatch keydown nor keyup event for IME 
unaware applications because JS changes something at keydown or keyup 
event handler causes forcibly committing composition that may have 
caused IME unavailable on such web pages.

For the compatibility between other browsers, I agree with changing 
Gecko's behavior.

However, there is an important thing is, which key value is proper value 
for keyboard events during composition. For example, in Kana input mode 
of Japanese IME, ASCII characters vs. Kana characters. Due to the 
platform limitations, browsers cannot retrieve what character *will* be 
inputted into the composition string.

At a meeting of UI Events (or D3E Events), we discussed this issue. 
IIRC, at that time, we didn't find any proper value but browsers should 
*not* dispatch keyboard events during composition (but allowing it for 
backward compatibility for non-Gecko browsers, therefore, currently 
defined with MAY).

I believe that web authors shouldn't handle keyboard events for text 
input. I.e., shouldn't need keyboard events during composition because 
such applications cannot support handwriting system and/or speech input 
system. At least spec should recommend web authors should handle 
"compositionupdate", "beforeinput" and/or "input". Handling 
keydown/keyup event during composition means that a keydown/keyup event 
causes double action (default action, i.e., modifying composition string 
and web app specific action).

On 2016/01/10 11:17, Olli Pettay wrote:
> On 01/10/2016 01:16 AM, Ryosuke Niwa wrote:
>> Hi all,
>>
>> This is another feedback from multiple browser vendors (Apple, Google,
>> Microsoft) that got together in Redmond last Thursday to discuss
>> editing API and related events.
>>
>>
>> We've been informed that Gecko/Firefox does not fire keydown/keyup
>> events during input method composition for each key stroke.  Could
>> someone from Mozilla clarify why this is desirable behavior?
>>
>> We think it's better to fire keydown/keyup events for consistency
>> across browsers.  If anything authors can detect that a given
>> keydown/keyup event is associated with input methods by listening to
>> composition events as well.
>>
>> - R. Niwa
>>
>>
>
>
> Masayuki should clarify this, but as far as I know, this case depends on
> the IME software one is using, and nothing guarantees browser
> gets any sane key events.
>
>
> -Olli


-- 
Masayuki Nakano <masayuki@d-toybox.com>
Manager, Internationalization, Mozilla Japan.

Received on Tuesday, 12 January 2016 04:27:15 UTC