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

Re: convertKeyIdentifier

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 23 Sep 2009 13:48:07 -0700
Cc: Anne van Kesteren <annevk@opera.com>, Doug Schepers <schepers@w3.org>, "www-dom@w3.org" <www-dom@w3.org>
Message-id: <BD531AF9-C5AC-4583-8AF1-CEB19050A9EA@apple.com>
To: Olli@pettay.fi

On Sep 23, 2009, at 9:50 AM, Olli Pettay wrote:

> On 9/23/09 4:53 AM, Maciej Stachowiak wrote:
>>
>> On Sep 22, 2009, at 9:27 AM, Anne van Kesteren wrote:
>>
>>>
>>>
>>>> this is a directly related to DOM3 Events key identifiers, and it
>>>> needs to be implemented in that context. Mozilla and Microsoft have
>>>> already agreed that we need this, BTW.
>>>
>>> Well, I disagree. I do not see the point in having this method as  
>>> I do
>>> not see the need for having multiple representations for  
>>> everything in
>>> the first place in the context of DOM Level 3 Events.
>>>
>>> Furthermore I think putting createEvent on Document was a mistake in
>>> to begin with. Especially with the design we have now where DOM  
>>> events
>>> are often used outside the context of documents. (Think of e.g. Web
>>> Workers.)
>>
>> I agree with Anne. I think we should remove the U+XXXX format  
>> entirely.
>> If you have a string like Q, you can convert it to a unicode numeric
>> value for range checking like this:
>>
>> var codePoint = evt.keyIdentifier.charCodeAt(0);
>
> If I haven't mistaken,
> charCodeAt(0) isn't quite enough. It returns values between
> 0-65536. One needs to check also charCodeAt(1).
> A helper method to get the codepoint easily in all cases could be  
> useful.

There are no key identifiers currently defined that correspond to  
characters that would be represented as surrogate pairs. Are there any  
keyboards that allow entering such characters directly?

Regards,
Maciej
Received on Wednesday, 23 September 2009 20:48:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:03 GMT