New issue
Advanced search Search tips

Issue 774952 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

Spec and implement locale and keyboard layout info of the inputting language of OS

Reported by citrixnj...@gmail.com, Oct 16 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce the problem:
1. Implement a text input field with Javascript.
2. Try to get the locale and keyboard layout info of the inputting language in Javascript.
3. Try to detect the keyboard layout change of OS in Javascript.

What is the expected behavior?
1. Able to get the locale and keyboard layout info of the inputting language.
2. Able to get the notification when the user changes the inputting keyboard layout of OS.

What went wrong?
1. Unable to get the locale and keyboard layout info of the inputting language.
2. Unable to get the notification when the user changes the inputting keyboard layout of OS.

Did this work before? No 

Does this work in other browsers? No

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Sorry that I'd just like to report this request of type "feature" but hadn't find anyway to set it.
I'd like to ask the Chrome team to provide two input related APIs:
1. API to get the locale and keyboard layout info of the inputting language of OS.
2. API to get the notification when the user changes the inputting keyboard layout of OS.
Moreover, could you please help to add these APIs for multiple OS platforms(Windows, Linux, MacOS, Android, iOS, etc).
Thanks a lot!
Labels: -Type-Bug Type-Feature

Comment 4 by ajha@chromium.org, Oct 17 2017

Labels: Needs-Triage-M61
Components: Blink>JavaScript
Status: Untriaged (was: Unconfirmed)
Untriaged it so that feature request gets addressed.

Thanks.!
Components: -Blink>JavaScript
Not V8 related.
Cc: dtapu...@chromium.org
Owner: garykac@chromium.org
Status: Assigned (was: Untriaged)
Summary: Spec and implement locale and keyboard layout info of the inputting language of OS (was: Please help to provide the APIs of getting the locale and keyboard layout info of the inputting language of OS)
Can you provide us with the use case that you need this for?

I know there was a desire to spec this: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm a while ago. But I don't believe it ever got an implementation.

Gary might be able to provide some context why.


Hi,

Thanks a lot for your attention on this feature request.

The reason of requesting this feature is that Citrix RfHtml5 that runs on Chrome needs to get the keyboard layout of the local machine, and then send it to remote server side. But now there isn't any API of javascript to get the keyboard layout, so that we'd like the Chrome team to help to provide these APIs.

Thanks and best regards!
Hi,

I'd like to clarify that the requirement is for Chrome Browser in general rather than Chrome OS.

Thanks!
See https://discourse.wicg.io/t/keyboardevent-getcharacterbykey-key-modifierlist/1857 for a related proposal.

Getting locale and layout is complicated by the lack of an easy-to-use cross-platform list. BCP-47 does a lot of the heavy lifting, but things like Dvorak and custom key overrides make it non-trivial.

The above proposal is to return the current key map pings without reference to the locale/layout, although the layout could be inferred from that information.

Sign in to add a comment