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

Re: Question about key identifiers

From: Doug Schepers <schepers@w3.org>
Date: Mon, 21 Sep 2009 23:36:09 -0400
Message-ID: <4AB84629.1080506@w3.org>
To: "www-dom@w3.org list" <www-dom@w3.org>
Hi, Maciej-

Maciej Stachowiak wrote (on 9/21/09 11:11 AM):
> When the key identifier list has multiple equivalent key identifiers for
> a certain key, which should implementations provide in KeyboardEvents?
> Here is an example:
> 'Q'
> 'U+0051'
> The Latin Capital Letter Q key (Q).
> When the user presses Q, will the keyIdentifier attribute of the
> keydown, keyup and keypress events contain the string "Q", "U+0051", or
> either one at the implementation's discretion?
> My preference would be that implementations MUST use the first
> (human-readable) name, as that is the most natural.

That is the intent, and it's spelled out in the key identifier selection 
algorithm, and explicitly stated in prose in the section describing Key 
Identifiers [1].

It's a key point to get across, though, so I've restated it in the key 
identifiers section.

Note that this is a change from the W3C Note, and from versions of the 
spec before I became editor, and it doesn't match the behavior of WebKit 
(which is the only desktop Web engine I know of to support 
.keyIdentifier).  However, a early-adopter implementer (BitFlash, a 
mobile SVG UA) got a lot of negative feedback from authors regarding the 
"U+xxxx" strings rather than the character string, so they actually 
changed their own behavior.  I strongly agree that this is a major pain 
in the ass for authors, so I introduced the character-string aspect, and 
the cascade of which values to present.

> I think it would be a serious problem if implementations were allowed to
> provide any of the keyIdentifiers, as then scripts would have to check
> for each possibility, and likely authors wouldn't get this right.

Agreed.  They can always convert to Unicode code point or key name using 
the convertKeyIdentifier method, so they have all the options available 
if they need them.

> Currently all the examples seem to use the "U+0051" style, but nothing
> seems to make that a normative requirement.

That's a throwback to earlier drafts, and I missed that forest for the 
trees.  Thanks for pointing it out.

> Please clarify this in the spec, and if the human-readable style is made
> a requirement, please update the examples to use it instead of the
> U+00xx style.



-Doug Schepers
W3C Team Contact, SVG and WebApps WGs
Received on Tuesday, 22 September 2009 03:36:18 UTC

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