RE: Event: virtual key codes

>From: Philippe Le Hegaret [mailto:plh@w3.org] 
> > The specification is unclear however on which character
> > should be generated, i.e. with or without the modifier:
> > - A generates a 'a' on keydown/up, shift+A generates 'A'.
> > - 3 generates a '3' on keydown/up, shift+3 generates '3' (and not
'#').
> > Yet another inconsistency in the keyboard character system...

So use of keyDown/keyUp should be discouraged for every key except VK_
keys, which should have no unicode equivalent.

One might justifiably use keyDown/keyUp of the 'A' key in a game, for
example, just as one might use the left arrow key -- as an on/off switch
rather than as a means of text input. In that case, there should be some
definition of what code will be in the keyCode ('a' or 'A'). Platforms
generally have conventions for that. DOM should recognize that if it is
going to specify virtual key codes and key events.

--Brad Pettit

Received on Sunday, 6 October 2002 20:19:05 UTC