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

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 UTC