[DOML3Events] keydown repeatedness

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 UTC