W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: [DOM3Events] keydown/keyup asymmetry for held keys (key repeating)

From: Doug Schepers <schepers@w3.org>
Date: Wed, 22 Jun 2011 16:00:37 -0400
Message-ID: <4E0249E5.8030703@w3.org>
To: "L. David Baron" <dbaron@dbaron.org>
CC: Olli@pettay.fi, Ojan Vafai <ojan@chromium.org>, www-dom@w3.org
Hi, David-

L. David Baron wrote (on 6/22/11 3:08 PM):
> On Wednesday 2011-06-22 21:56 +0300, Olli Pettay wrote:
>>  On 06/22/2011 09:33 PM, Ojan Vafai wrote:
>>  >While I agree that having keydown/keyup be symmetric would be a better
>>  >API, every browser currently implements it repeating keydown events.
>>
>>  Yeah, the current implementations are the reason why repeating
>>  keydown/up has been spec'ed the way they are.
>
> Really?  I thought the last time I raised this issue I was told it
> was specced this way because the mechanism was needed to detect
> repetition of keys that don't lead to text.  But that was during the
> period when the "keypress" event wasn't in the spec at all.
>
> The threads I could find discussing this are:
> http://lists.w3.org/Archives/Public/www-dom/2005JanMar/thread.html#msg2
> http://lists.w3.org/Archives/Public/public-webapi/2007Aug/0008.html
> but I think there was a more recent one where I debated it with Doug
> Schepers.

I don't recall discussing it with you, and I couldn't find any reference 
in www-dom, public-webapi, or public-webapps where you mention the words 
"repeat", "repeating", or "repetition", other than the instances you 
already link to.  It's possible we had some sort of discussion at a 
TPAC, or something.

In any case, at this point, I don't have a strong opinion on the topic. 
  I think your keydown-keyup symmetric argument is reasonable; note, 
though, that it will never be *completely* symmetric, because the OS or 
UA may swallow either a keydown or keyup event under various 
circumstances.

Adding keypress events to non-character-producing keys (in order to 
capture those repetitions) may be more likely to cause disruptions to 
existing web content, which may not expect keypress for those, but I 
have no evidence to support that conjecture.

I simply want the spec to match implementations, and I will defer to the 
consensus of the group as to which is the better behavior.

Regards-
-Doug Schepers
W3C Staff Contact, SVG, WebApps, Web Events, and Audio WGs
Received on Wednesday, 22 June 2011 20:00:44 GMT

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