W3C home > Mailing lists > Public > public-i18n-core@w3.org > July to September 2010

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

From: Aharon (Vladimir) Lanin <aharon@google.com>
Date: Wed, 4 Aug 2010 10:39:00 +0300
Message-ID: <AANLkTinCH_6fhuK8QGCN6pA_hRZ-a+=oVVLkwaz-b15K@mail.gmail.com>
To: "public-i18n-core@w3.org" <public-i18n-core@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 4 August 2010 07:39:55 GMT