W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

[DOML3Events] keydown repeatedness

From: Sergey Ilinsky <castonet@yahoo.co.uk>
Date: Wed, 27 May 2009 09:22:52 +0000 (GMT)
Message-ID: <819624.67333.qm@web24402.mail.ird.yahoo.com>
To: "public-webapps@w3.org" <public-webapps@w3.org>
If I did not miss something, the DOM-Events (Level 3) specification does not tell whether keydown event should be repeatedly fired when a key is pressed and not released for longer time.

Browsers (although they do not implement KeyboardEvent interface from DOM-Events-Level-3 specification) differ in their behaviour. Opera doesn't fire event repeatedly while the other do.

It is obvious that there are scenarious where page authors would need keydown event fired repeatedly as well as where they would want to be notified on keydown once. (Indeed script author can already solve that by implementing a flag set in keydown event and reset in keyup event, but this is clearly not efficient)

So I thought, maybe, since KeyboardEvent is a new interface defined in a specification that is a working draft, there is an option to lay these details down? The proposal is:
1) define keydown event to be dispatched repeatedly
2) extend KeyboardEvent interface with "detail" property (currently not in use, inherited from UIEvent interface) that would contain contextual information on how many times the input device repeated event

This would also align the behaviour of keyboard events with mouse events where detail property keeps count of clicks happened in a row.

Sergey Ilinsky/
Received on Wednesday, 27 May 2009 09:23:37 GMT

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