New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 747358 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

event.key doesn't report correct keys with dvorak-qwerty

Reported by keitha...@github.com, Jul 21 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
-- Setup
1. Open System Preferences
2. Navigate to "Keyboard settings"
3. Navigate to "Input Sources"
4. Click the "+" Button
5. Search for "Dvorak"
6. Add "Dvorak - QWERTY ⌘"
7. Open Chrome
8 (Optional: visit https://keithcirkel.co.uk/keycodes which will help verifying this)

-- Reproduce
1. Switch layout to "Dvroak - QWERTY ⌘"
2. Press `v` (`.` key on a QWERTY keyboard) - note that the event.keyCode is `86` and event.key is `'v'` (correct).
3. Press `k` (`v` key on a QWERTY keyboard) - note that the event.keyCode is `75` and event.key is `'k'` (correct).
3. Press `cmd+v` (`v` key on  QWERTY keyboard) - note that `event.keyCode` is `86`, but `event.key` is `k` (incorrect). The expected `event.key` is `v`.

What is the expected behavior?
When `cmd+v` is pressed on a "Dvorak - QWERTY ⌘",  then the `event.key` value should be `v`. 

What went wrong?
When `cmd+v` is pressed on a "Dvorak - QWERTY ⌘",  then the `event.key` is `k`. 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 59.0.3071.115  Channel: stable
OS Version: OS X 10.12.5
Flash Version:
 
Please see attached gifs of Safari & Firefox which both do the desired behaviour, and Chrome - which does the undesired behaviour.
safari-dvorak-working.mov.gif
3.5 MB View Download
firefox-dvorak-working.mov.gif
3.1 MB View Download
chrome-dvorak-bug.mov.gif
4.4 MB View Download

Comment 2 by hayato@chromium.org, Jul 25 2017

Components: -Blink>DOM Blink>Input
Cc: pnangunoori@chromium.org
Labels: M-62
Status: Untriaged (was: Unconfirmed)
Tested on Chrome Stable #59.0.3071.115 & Canary #62.0.3166.0 on Mac 10.12.5 and able to reproduce the issue. 

This is a non-regression issue and able to reproduce from M-51 #51.0.2695.0. Marking it as untriaged so that issue gets addressed.

Note: For the builds before 51.0.2695.0, key value is displayed as “undefined”.

Thanks.

Labels: Hotlist-Input-Dev
Owner: chongz@chromium.org
Status: Assigned (was: Untriaged)

Comment 5 by chongz@chromium.org, Jul 25 2017

Status: Started (was: Assigned)
The spec was changed from filtering "non-printable" to "non-control" characters, working on the fix.

https://w3c.github.io/uievents-key/#selecting-key-attribute-values
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 2 2017

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

commit a49a9d8cbea209c136796e594e98c797aadeced6
Author: Chong Zhang <chongz@chromium.org>
Date: Wed Aug 02 20:53:47 2017

[Mac] Change DomKey filter from 'non-printable' to 'non-control' characters

According to the latest spec we should filter non-glyph modifiers if the
produced characters are part of Unicode 'Other, Control' General Category.
e.g. http://www.fileformat.info/info/unicode/category/Cc/list.htm

This patch changes implementation to match spec and fixes issues on
'Dvorak - QWERTY Command' layout.

Spec: https://w3c.github.io/uievents-key/#selecting-key-attribute-values

Bug:  747358 
Change-Id: I792b472132ea6deb4213206593136343a2050ccd
Reviewed-on: https://chromium-review.googlesource.com/585638
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Chong Zhang <chongz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491490}
[modify] https://crrev.com/a49a9d8cbea209c136796e594e98c797aadeced6/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm
[modify] https://crrev.com/a49a9d8cbea209c136796e594e98c797aadeced6/ui/events/keycodes/keyboard_code_conversion_mac.mm

Status: Fixed (was: Started)

Comment 8 by sdy@chromium.org, Sep 26 2017

Cc: keerthan...@techmahindra.com sdy@chromium.org
 Issue 766800  has been merged into this issue.

Sign in to add a comment