New issue
Advanced search Search tips

Issue 910649 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 30
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Keyboard map API not returning key sym for Japanese keyboard

Project Member Reported by garykac@chromium.org, Nov 30

Issue description

Chrome Version: (copy from chrome://version) Canary 72.0.3626.0
OS: (e.g. Win10, MacOS 10.12, etc...) Windows

What steps will reproduce the problem?
(1) Change Windows Keyboard layout to Japanese (attach Japanese keyboard if desired)
(2) Run the script:
 navigator.keyboard.getLayoutMap().then(function(map) { console.log(map.size); for(k of map.entries()) { console.log(k); }; })

What is the expected result?

The values for IntlRo and IntlYen should return different values.
IntlYen should return '¥', since that's what's printed on the keyboard.

What happens instead?

Both IntlRo and IntlYen return '\'


 
Labels: -Pri-3 Pri-2
Status: Started (was: Untriaged)
Window appears to return the wrong value here and we use that to populate the IntlYen value.

The fix is to detect this layout and overwrite with the correct value.
Similar problem with Korean layout.  IntlYen should return '₩'.
Hmm.. Actually, on Windows Korean returns '\' for both Backslash and IntlBackslash and doesn't have a value for IntlYen.

I'm changing IntlBackslash to return '₩', but I would like someone to verify this with various Korean keyboards.
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 30

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/82ec099771f979cd73e8a28794813bb915a584fb

commit 82ec099771f979cd73e8a28794813bb915a584fb
Author: Gary Kacmarcik <garykac@chromium.org>
Date: Fri Nov 30 21:24:04 2018

[KeyboardMap] Fix handling of yen and won keys

With Windows Japanese and Korean layouts, the OS returns
duplicate values so it appears that multiple keys return
the '\' char.

It should return the currency symbol (yen or won) instead
of the '\', but J and K codepage history means that
Windows will conveniently (or not) map these characters
to the backslash.

See:
https://web.archive.org/web/20131023080358/http://blogs.msdn.com:80/b/michkap/archive/2005/09/17/469941.aspx
for some history/background.

Bug:  910649 
Change-Id: If27e4e46959fccd3da292365c521d7f3c4bb2a9b
Reviewed-on: https://chromium-review.googlesource.com/c/1356875
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612789}
[modify] https://crrev.com/82ec099771f979cd73e8a28794813bb915a584fb/ui/events/keycodes/dom/dom_keyboard_layout_map_win.cc

Labels: -Pri-2 Merge-Request-72 OS-Windows Pri-1
Status: Fixed (was: Started)
Labels: -Pri-1 Pri-2
Project Member

Comment 8 by sheriffbot@chromium.org, Dec 1

Labels: -Merge-Request-72 Hotlist-Merge-Approved Merge-Approved-72
Your change meets the bar and is auto-approved for M72. Please go ahead and merge the CL to branch 3626 manually. Please contact milestone owner if you have questions.
Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 9 by sheriffbot@chromium.org, Dec 5

This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 10 by bugdroid1@chromium.org, Dec 5

Labels: -merge-approved-72 merge-merged-3626
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5881248d364ceea9e28b3dbd494bc19a1156a6ef

commit 5881248d364ceea9e28b3dbd494bc19a1156a6ef
Author: Gary Kacmarcik <garykac@chromium.org>
Date: Wed Dec 05 17:29:46 2018

[KeyboardMap] Fix handling of yen and won keys

With Windows Japanese and Korean layouts, the OS returns
duplicate values so it appears that multiple keys return
the '\' char.

It should return the currency symbol (yen or won) instead
of the '\', but J and K codepage history means that
Windows will conveniently (or not) map these characters
to the backslash.

See:
https://web.archive.org/web/20131023080358/http://blogs.msdn.com:80/b/michkap/archive/2005/09/17/469941.aspx
for some history/background.

Bug:  910649 
Change-Id: If27e4e46959fccd3da292365c521d7f3c4bb2a9b
Reviewed-on: https://chromium-review.googlesource.com/c/1356875
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#612789}(cherry picked from commit 82ec099771f979cd73e8a28794813bb915a584fb)
Reviewed-on: https://chromium-review.googlesource.com/c/1361658
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/branch-heads/3626@{#82}
Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437}
[modify] https://crrev.com/5881248d364ceea9e28b3dbd494bc19a1156a6ef/ui/events/keycodes/dom/dom_keyboard_layout_map_win.cc

Labels: -Hotlist-Merge-Approved
Labels: Merge-Merged-72-3626
The following revision refers to this bug: 
https://chromium.googlesource.com/chromium/src.git/+/5881248d364ceea9e28b3dbd494bc19a1156a6ef

Commit: 5881248d364ceea9e28b3dbd494bc19a1156a6ef
Author: garykac@chromium.org
Commiter: garykac@chromium.org
Date: 2018-12-05 17:29:46 +0000 UTC

[KeyboardMap] Fix handling of yen and won keys

With Windows Japanese and Korean layouts, the OS returns
duplicate values so it appears that multiple keys return
the '\' char.

It should return the currency symbol (yen or won) instead
of the '\', but J and K codepage history means that
Windows will conveniently (or not) map these characters
to the backslash.

See:
https://web.archive.org/web/20131023080358/http://blogs.msdn.com:80/b/michkap/archive/2005/09/17/469941.aspx
for some history/background.

Bug:  910649 
Change-Id: If27e4e46959fccd3da292365c521d7f3c4bb2a9b
Reviewed-on: https://chromium-review.googlesource.com/c/1356875
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#612789}(cherry picked from commit 82ec099771f979cd73e8a28794813bb915a584fb)
Reviewed-on: https://chromium-review.googlesource.com/c/1361658
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/branch-heads/3626@{#82}
Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437}

Sign in to add a comment