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

Re: DOM Keyboard Event Level 3 questions about proposal

From: Florian Bösch <pyalot@gmail.com>
Date: Sun, 10 Mar 2013 21:59:44 +0100
Message-ID: <CAOK8ODjBJQ4MfAtyrs2rrExWpNRSv7TcvufoX-Ujs8wEVwqm=w@mail.gmail.com>
To: Егор Николаев <termi1uc1@gmail.com>
Cc: Brad Pettit <Brad.Pettit@microsoft.com>, Masayuki Nakano <masayuki@d-toybox.com>, "www-dom@w3.org" <www-dom@w3.org>, Wez <wez@chromium.org>
On Sun, Mar 10, 2013 at 8:48 PM, Егор Николаев <termi1uc1@gmail.com> wrote:

> But why the "code" values is so complicated?
> For example: event.code='ShiftLeft'. If I need to detect the exactly
> 'Shift' key, I can read 'location' property.
The location property designates things such as numpad, function row,
center keys, I don't think shift left and right would have a different
location (I could be wrong though).

> In the most common scenarios I need to detect just 'Shift' key without
> exactly location.
Yeah, but you wouldn't want to throw away the possibility of identifying
left or right. Therefore it's not the same.

> Another example is event.code="Digit2". While I can understand "ShiftLeft"
> value - it brings additional information, I can't understand the
> "Digit"/"Key" prefix. There is no other "2" value in the spec, no need to
> do the "code" values so complicated. Why can't it be just "2" as well as
> "KeyA" be just "A"?
Because they're not "2" or "A", they might be  "ش" or "١" or "た". The name
is choosen to designate that you're not dealing with alphanumerics here,
but with key identifiers.

But this is just my first impressions. I think I need to create another
> thread to discuss this or could anyone tell me the link/name of "code"
> property discussing thread if it exists?
The Event Level 4 specification on keyboard events contains a variety of
key layout tables for different keyboard layouts.
Received on Sunday, 10 March 2013 21:00:11 UTC

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