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

ACTION-174: keyCode and keypress

From: Anne van Kesteren <annevk@opera.com>
Date: Fri, 24 Nov 2006 12:08:31 +0100
To: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <op.tjio8hnf64w2qv@id-c0020>

http://lists.w3.org/Archives/Public/www-archive/2006Nov/att-0047/keyCode-ie.htm  
contains some data I collected on keyCode for the keydown, keypress and  
keyup event in Internet Explorer.

The problem with keyCode for the keydown and keyup events is that the  
values returned are keyboard and keyboard-layout dependent. You probably  
see this back mostly for things like punctation.

Hallvord gave me an example of that:

   ?  191  63  191

Is what I had on the question mark, but with a Norwegian keyboard layout,  
? is above + so the values are:

   ?  43   63  43

For the keypress event, as you can see, they are the same.

I've no clue how this interacts with IME and how to test such a thing.


It seems that for the keypress event it might be possible to define  
keyCode given that it's quite consistent there and returns the same thing  
accross keyboards and keyboard-layouts. I'm not sure how to define it for  
keydown and keyup. We could probably state that it depends on the keyboard  
bindings or something...


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Friday, 24 November 2006 11:08:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:56 GMT