Re: [DOM3 Events] space key should be always "Spacebar" for KeyboardEvent.key?

"Hallvord R. M. Steen" <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <[email protected]>
Siterer Wez <[email protected]>:

> In D3E the 'key' field indicates the meaning of the key in the current
> context, so in this case it would be appropriate for it to have distinct
> values for each of the cases listed.

I disagree. This use case is fulfilled by the D3E "char" property, no?  
The point of having the "key" property is to have a more stable  
reference to whatever physical key was pressed.

IMHO..

> The D4E 'code' field is intended to
> indicate the actual key that was pressed, regardless of its meaning in the
> current context, so that would be consistent for the spacebar, regardless
> of the generated KeySym.

The question was about the interpretation of D3E though.

> In this case I'd recommend:
> * For the "space" and "KP_Space" key-syms, generate Spacebar (NORMAL) and
> Spacebar (KEYPAD) events, respectively.
> * For the others, generate events using the corresponding Unicode code
> point for the 'key' field.

And I would suggest that setting 'char' to the corresponding Unicode  
code point and 'key' to "Spacebar' is the best way to fulfil all the  
various use cases.

-Hallvord
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.