New issue
Advanced search Search tips

Issue 821841 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
M67
KSH



Sign in to add a comment

Keyboard shortcut viewer should use "Esc" instead of "Escape"

Project Member Reported by jamescook@chromium.org, Mar 14 2018

Issue description

Tip-of-trunk chrome
* Ctrl-Alt-/ to open KSV
* Click on "System & Display Settings"
* The item "Bring up task manager" reads "Search + Escape".

However, the key label on my keyboard says "esc" not "Escape". That key label is mandated for all OEMs. We use "Ctrl" instead of "Control". Shouldn't escape match what's printed? Either "Esc" or "esc"?

To Olga for an opinion.

 

Comment 1 by wutao@chromium.org, Mar 14 2018

Cc: kpschoedel@chromium.org
+kpschoedel@

Hi James,

All the labels for keys are got automatically from ui::KeycodeConverter::DomKeyToKeyString(dom_key). The string for DomKey::ESCAPE in US keyboard layout is "Escape" [2].

The reason why "Control" is "Ctrl", because it is customized i18n string. [3] We can special handle "Escape" to make it displayed as "Esc", similar to what we handle "Whitespace" here [4].


[1] https://cs.chromium.org/chromium/src/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc?sq=package:chromium&l=129
[2] https://cs.chromium.org/chromium/src/ui/events/keycodes/dom/dom_key_data.inc?l=36&rcl=df32ea966edd79e4cf72728c5d65ca23554b70e6
[3] https://cs.chromium.org/chromium/src/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc?l=53&rcl=df32ea966edd79e4cf72728c5d65ca23554b70e6
[4] https://cs.chromium.org/chromium/src/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc?l=66&rcl=df32ea966edd79e4cf72728c5d65ca23554b70e6

James - thanks for your suggestion - think it makes total sense to be consistent. Tao is working on this string as an exception now. 


Comment 3 by wutao@chromium.org, Mar 15 2018

James, it could be very hard (if possible) to know it is "esc" or "Esc" printed on the keyboard. I will use "Esc" for now.

Comment 4 by wutao@chromium.org, Mar 15 2018

Cc: afakhry@chromium.org w...@chromium.org
+wez@, kpschoedel@, afakhry@ for opinions.

I wonder if I can do this hard coded string "Esc" for VKEY_ESCAPE or DomKey::ESCAPE.
If we hard coded "Esc" for VKEY_ESCAPE, then it cannot be localized.

Two concerns:
1. Is it possible other physical key can generate DomKey::ESCAPE in other keyboard layout?
2. From pictures in other keyboard layout, some keyboard does have "Escape" or "Echap" printed.



I'm inclined to say that all labelled keycaps should have internationalization.

Comment 6 by w...@chromium.org, Mar 15 2018

Cc: garykac@chromium.org
In general it is not possible to match key-caps - e.g. one vendor might write "Caps Lock" on their device while another writes "CAPS", e.g. PC keyboards typically have the alphabet keys in capitals, ChromeOS devices have the keycaps lowercase, etc.

I'd expect that in some locales the "fixed" keys like Escape, Shift, etc might be localized on the key-caps (in which case we should support localization for those keys in KSV), but I can't find any evidence online to support that.
+garykac, who has a collection of different language/layout keyboard so may have a better idea.

Re a hard-coded mapping from VKEY or DomKey: VKEY and DomKey are both derived from the physical key, based on the keyboard layout, so if the user has a custom layout that e.g. adds a second Escape key using some other physical key, we should get KSV displaying the "Esc" for that as well if we hard-wire DomKey::ESCAPE -> "Esc".  The same would not be true for DomCode::ESCAPE, though.

Comment 7 by w...@chromium.org, Mar 15 2018

Labels: -Pri-2 Pri-3
Adjusting to P-3, since there is no associated target milestone.
Labels: KSH
Is this bug to change it for ChromeOS only, or would any change apply to all platforms?

Responding to #4:

(1) I'm not aware of any layout where another key produces escape. But note that people can create custom overrides (as wez@ mentions in #6).

(2) The majority of keyboards appear to use "Esc" for this key label. "esc" is the 2nd most common label. Some keyboards use "⎋" for the Escape key.

French keyboards can use "Echap", but I'm not aware of other locales that translate the escape key.
https://fr.wikipedia.org/wiki/Touche_d%27%C3%A9chappement

Russian, German, Spanish, Italian, Japanese, ... all use "Esc".

Also note that recent Mac laptops have this as a soft key (on the touchbar) labeled "esc".

Comment 10 by wutao@chromium.org, Mar 15 2018

Thanks everyone!

If I understand correct, looks like it is ok to hard-wire VKEY::ESCAPE -> "Esc", which can cover most of the user cases, except the one "⎋".

I will make change soon.
Labels: -Pri-3 M67 Pri-2
Project Member

Comment 12 by bugdroid1@chromium.org, Mar 16 2018

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

commit f4404931c8ee17c43490cf3a46e1c8e804583028
Author: wutao <wutao@chromium.org>
Date: Fri Mar 16 23:03:31 2018

cros: Display VKEY Escape with string of Esc in KSV

Majority of the keyboard layouts use "Esc" or "esc" to present
"Escape". This cl adds special handling to display VKEY_ESCAPE
in Keyboard Shortcut Helper (KSV).

Bug:  821841 
Test: manually tested.
Change-Id: I3b514325b5cc371c33c64973d0b0e3f9ee9548c6
Reviewed-on: https://chromium-review.googlesource.com/966872
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543857}
[modify] https://crrev.com/f4404931c8ee17c43490cf3a46e1c8e804583028/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc
[modify] https://crrev.com/f4404931c8ee17c43490cf3a46e1c8e804583028/ash/components/shortcut_viewer_strings.grdp

Comment 13 by wutao@chromium.org, Mar 19 2018

Status: Fixed (was: Assigned)

Sign in to add a comment