W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

ACTION-11: got to love keypress

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 20 Mar 2006 18:52:00 +0100
To: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <op.s6p3wyy064w2qv@id-c0020.oslo.opera.com>

It's probably relevant to read the thread on www-dom  
started by David Baron. The easiest way to define keypress would be  
something along the lines of:

   The keypress event MUST be dispatched as default action of
   the keydown event and when the key is hold down it MUST be
   subsequently dispatched according to platform conventions.

   If the keypress event leads to text input the textInput
   event MUST be dispatched accordingly.

This means that even when using an IME keypress is dispatched which  
application authors should be aware of. (That is to say, use it for games,  
not to catch text input.) Other related issues seem to be what actually  
happens when you hold down a key and two 'a' characters are inserted.  
Possible insane scenario's include (leaving keypress aside for the moment):

  keydown, textInput, keyup, keydown, textInput, keyup

... as per http://www.w3.org/mid/1106593442.11640.51.camel@localhost which  
does not seem to be supported by the current specification according to  
Björn. Others:

  keydown, textInput, textInput, keyup
  keydown, textInput, keydown, textInput, keyup
  keydown, textInput, keydown, textInput, keyup, keyup

... where the latter two can probably be excluded.

I guess there is need for follow-up issues, testcases and actions...  
Mostly testcases I guess, if there's one thing the world needs.

Anne van Kesteren
Received on Monday, 20 March 2006 17:52:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:20 UTC