Re: proposal: add input/keyboard locale to text and keyboard events

Here is an updated form of the proposal, with the changes discussed at last
week's WG teleconference.

-----

Proposal: An additional property in the TextEvent and KeyboardEvent DOM3
interfaces to indicate the locale of the keyboard or other input device
using which the input was generated. When this is unknown (e.g. when the
input method is paste, or when the implementation can not obtain this
information from the underlying platform), the property should be either
null (or undefined, whichever conforms to DOM3 conventions better).

Here is a draft for the documentation of the new event attributes, striving
to conform in style to
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-textevents

In TextEvent:

inputLocale of type DOMString, readonly
    A BCP-47 tag indicating the locale for which the origin of the event
(whether keyboard, IME, handwriting recognition software, or other input
mode) is configured, e.g. "en-US". May be null [undefined?] when
inapplicable, e.g. for pasted text, or unknown, e.g. when this information
is not exposed by the underlying platform.

    Note: inputLocale does not necessarily indicate the locale of the data
or the context in which it is being entered. For example, a French user
often may not switch to an English keyboard when typing English, in which
case the inputLocale will still indicate French, even though the data is
actually English.

In KeyboardEvent:

inputLocale of type DOMString, readonly
    A BCP-47 tag indicating the locale for which the keyboard used to
generate the event is configured, e.g. en-US. May be null [undefined?] when
unknown, e.g. when this information is not exposed by the underlying
platform.

    Note: inputLocale does not necessarily indicate the locale of the text
that the user may be keying in. For example, a French user often may not
switch to an English keyboard when typing English, in which case the
inputLocale will still indicate French. Nor can it be used to definitively
calculate the "physical" or "virtual" key associated with the event, or the
character printed on that key.

Received on Wednesday, 4 August 2010 07:39:53 UTC