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

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

From: Steve Schafer <steve@fenestra.com>
Date: Wed, 22 Jun 2011 15:57:38 -0400
To: www-dom@w3.org
Message-ID: <6fh407tubkjetcbro1fvafa5b78rlivsf7@4ax.com>
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

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

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

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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:17 UTC