W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2009

Re: Changes to DOM3 Events Key Identifiers

From: Laurens Holst <laurens.nospam@grauw.nl>
Date: Fri, 30 Oct 2009 12:21:25 +0100
Message-ID: <4AEACC35.90808@grauw.nl>
To: Alex Danilo <alex@abbra.com>
CC: Maciej Stachowiak <mjs@apple.com>, Doug Schepers <schepers@w3.org>, www-dom@w3.org
Op 30-10-2009 11:36, Alex Danilo schreef:
>> "\uxxxx" is not a syntax, it is a Unicode string of the actual
>> character. \u introduces the escape sequence for a unicode code point.
>> So you can compare it directly to a character.
>>      
> Thanks for the clarification.
>    

Well, regardless of whether what Maciej says is actually the case,

> So, how does this provide any advantage over 'keyCode'?
>    

keyCode returns an integer, which in JavaScript is not directly 
comparable to a character (well, it is, but not like in C; 101 == 
"101"). JavaScript does not have a character type, only a string type. 
Actually I think C does not have a character type either, it is an alias 
for byte, no? Either way, in JavaScript 169 != "©".

> It seemed to me that keyCode is used for the code point, as in maps
> to the Unicode point and the whole reason there was keyIdentifier
> was to provide descriptive strings.
>    

keyCode does not map to Unicode code points, e.g. F1-F24 map to values 
112-135 which are not Unicode.

> If I want the Unicode point explicitly I can use
> keyCode or am I missing something?
>    

Hope this cleared that up.

~Laurens

-- 
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Backbase employee; www.backbase.com




Received on Friday, 30 October 2009 11:22:07 GMT

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