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

On Wed, 22 Jun 2011 21:56:41 +0300, you wrote:

>Yeah, the current implementations are the reason why repeating 
>keydown/up has been spec'ed the way they are.

I think the cart has gotten way out in front of the horse here...

The current browsers work that way because Windows (and therefore pretty
much everything else) works that way. Windows works that way because the
original IBM PC keyboard hardware works that way.

The keydown/keyup events (WM_KEYDOWN and WM_KEYUP messages in Windows)
originate as physical signals from the keyboard; the typematic feature
(where holding a key down results in multiple keydowns without
intervening keyups) is built into the keyboard's firmware.

In Windows, the TranslateMessage() function converts WM_KEYDOWN/WM_KEYUP
messages into characters by generating WM_CHAR messages. These are
equivalent (more or less) to the keypress events currently under
discussion).

So, keyboard events have been working this way for a very, very long
time.

(The above is a gross simplification and ignores CTL, ALT, etc.)

-Steve Schafer

Received on Wednesday, 22 June 2011 19:58:06 UTC