Re: [DOM3 Events] key repeating

On Sat, 2005-01-22 at 12:05 -0800, L. David Baron wrote:
> The DOM3 events specification [1] does not seem to account for key
> repeating.

Unix/Windows/MacOS are handling those differently and defining a cross
platform behavior is difficult, however DOM3 Events took the approach of
not handling the repeat of a key differently from a user typing several
times on a key.

> It seems reasonably obvious that holding down the "a" key should
> generate a keydown event, a series of textInput events, and a keyup
> event.  However, there should probably be an example in Appendix A and
> perhaps a normative statement somewhere to indicate this.

In the case of a key repeat, you should generate multiple
keydown/textInput/keyup, and not just the textInput. That's exactly what
the repeat functionality is about. It does have the drawback of not
having the ability to differentiate between fast key input from a user
on a keyboard and the key repeat functionality.

> The bigger problem, however, is that it is impossible to detect key
> repeating for characters whose purpose is something other than
> generating text, since textInput events do not fire.  For example, there
> is no way to detect that the down arrow key or the backspace key is
> repeating.

Not if you generate the proper keydowns/keyups as well.

>  DOM API users should not have to synthesize key repeats
> since (1) it's a good bit of work that they shouldn't have to do, and

in the case of cross platform compatibility, implementations have no
choices but to generate or remove keyboard events already.

> (2) it would ignore the environment's preferences for key repeating,
> which includes initial delays and rates to which the user is accustomed
> and perhaps accessibility preferences (such as suppressing key
> repetition) as well.

Shouldn't this be handled by the accessibility preferences of the
operating system?

Philippe

Received on Monday, 24 January 2005 19:04:04 UTC