W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2013

Re: DOM Keyboard Event Level 3 questions about proposal

From: Кошмарчик <garykac@chromium.org>
Date: Thu, 7 Mar 2013 12:48:04 -0800
Message-ID: <CAGnkXoF3pyKsiXBE_iRW=L0T_-nbxE_HS6wrb5vgTfkew13_aQ@mail.gmail.com>
To: Егор Николаев <termi1uc1@gmail.com>
Cc: Masayuki Nakano <masayuki@d-toybox.com>, "www-dom@w3.org" <www-dom@w3.org>, Brad Pettit <Brad.Pettit@microsoft.com>
On Thu, Mar 7, 2013 at 12:24 PM, Егор Николаев <termi1uc1@gmail.com> wrote:

>
> As for "code" property. It is the same problem as "key". Why this property
> exists in the first place? What should "code" property bring to developer,
> that keyCode can't? What should make me to abandon keyCode  in favor of
> "code"?
>

Conceptually, 'code' is the same as 'keyCode'. The crucial difference
between the two is that 'code' has has a spec that defines the values that
should be returned for each key so that it will be consistently implemented
across browsers. The DOM2 spec never specified the 'keyCode' attribute so
each browser implemented the field differently.

A new 'code' field is being introduced (rather than re-defining the old
'keyCode' value) so that existing code does not break.

-Gary
Received on Thursday, 7 March 2013 20:48:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 7 March 2013 20:48:34 GMT