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

Re: Changes to DOM3 Events Key Identifiers

From: Alex Danilo <alex@abbra.com>
Date: Fri, 30 Oct 2009 23:14:12 +1100
Message-Id: <OZTBSK.7B2Q793Q3074@abbra.com>
To: Laurens Holst <laurens.nospam@grauw.nl>
Cc: Maciej Stachowiak <mjs@apple.com>, Doug Schepers <schepers@w3.org>, www-dom@w3.org

Hi Laurens,

--Original Message--:
>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.

Yes, thanks it did, much appreciated.

Alex

>~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 12:15:06 GMT

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