W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2010

Re: ISSUE-133 (keyCode and charCode): Consider specifying keyCode and charCode [DOM3 Events]

From: Thomas Broyer <t.broyer@gmail.com>
Date: Thu, 16 Sep 2010 15:33:40 +0200
Message-ID: <AANLkTimZfp-avX89Hz7CFJqwUwyBDpZPJwwSkU+nbz=H@mail.gmail.com>
To: Web Applications Working Group WG <public-webapps@w3.org>
On Thu, Sep 16, 2010 at 2:39 PM, Web Applications Working Group Issue
Tracker <sysbot+tracker@w3.org> wrote:
>
> ISSUE-133 (keyCode and charCode): Consider specifying keyCode and charCode [DOM3 Events]
>
> http://www.w3.org/2008/webapps/track/issues/133
>
> Raised by: Doug Schepers
> On product: DOM3 Events
>
> Simon Pieters <http://lists.w3.org/Archives/Public/www-dom/2010JulSep/0160.html>:
> [[
> Please specify keyCode and charCode, even if marked as 'obsolete'. I'm
> pretty sure no browser is going to ship without at least one of them. (I
> notice that charCode is undefined in Opera, keyCode always returns 0 in
> Firefox, and in WebKit they both work.)
> ]]

See http://unixpapa.com/js/key.html and
http://www.slideshare.net/pp.koch/yahoo-1337458 for researches on the
subject.

Basically, and practically, use keyCode in keyDown and keyUp events,
and charCode in keyDown events (except in Opera, where keyCode can be
used as a fallback).
I can't tell how this would translate to spec text though.

-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/
Received on Thursday, 16 September 2010 13:34:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:40 GMT