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

Issue 662011 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 669647
issue 669650



Sign in to add a comment

Some KeyboardEvent.key mapping on Android are not matching with UI Events KeyboardEvent key Values spec

Reported by dtoybo...@gmail.com, Nov 3 2016

Issue description

Steps to reproduce the problem:
I investigated the mapping of KeyboardEvent.key and AKEYCODE_* on Android from the source code:
https://cs.chromium.org/chromium/src/ui/events/keycodes/keyboard_code_conversion_android.cc?dr=C&sq=package:chromium&l=63

Then, I found some different (or missing) mapping form the spec which suggests Android keycode values for some key values.

For Firefox (Gecko), I'm working on similar issue in:
https://bugzilla.mozilla.org/show_bug.cgi?id=1274503

What is the expected behavior?

What went wrong?
virtual keycode	Chromium	Spec
AKEYCODE_HOME (3)	"Home"	"GoHome"
AKEYCODE_BACK (4)	"BrowserBack"	"GoBack"
AKEYCODE_CALL (5)	"Unidentified"	"Call"
AKEYCODE_ENDCALL (6)	"Unidentified"	"EndCall"

AKEYCODE_DPAD_CENTER (23)	"Unidentified"	"Enter"

AKEYCODE_HEADSETHOOK (79)	"Unidentified"	"HeadsetHook"
AKEYCODE_FOCUS (80)	"Unidentified"	"CameraFocus"

AKEYCODE_NOTIFICATION (83)	"Unidentified"	"Notification"

AKEYCODE_MUTE (91)	"AudioVolumeMute"	"MicrophoneVolumeMute"

AKEYCODE_APP_SWITCH (187)	"Unidentified"	"AppSwitch"

AKEYCODE_MANNER_MODE (205)	"Unidentified"	"MannerMode"
AKEYCODE_3D_MODE (206)	"Unidentified"	"TV3DMode"
AKEYCODE_CONTACTS (207)	"Unidentified"	"LaunchContacts"

AKEYCODE_KANA (218)	"Unidentified"	"KanaMode"

AKEYCODE_BRIGHTNESS_DOWN (220)	"Unidentified"	"BrightnessDown"
AKEYCODE_BRIGHTNESS_UP (221)	"Unidentified"	"BrightnessUp"
AKEYCODE_MEDIA_AUDIO_TRACK (222)	"Unidentified"	"MediaAudioTrack"
AKEYCODE_SLEEP (223)	"Unidentified"	"Standby"
AKEYCODE_WAKEUP (224)	"Unidentified"	"WakeUp"
AKEYCODE_PAIRING (225)	"Unidentified"	"Pairing"
AKEYCODE_MEDIA_TOP_MENU (226)	"Unidentified"	"MediaTopMenu"

AKEYCODE_LAST_CHANNEL (229)	"Unidentified"	"MediaLast"
AKEYCODE_TV_DATA_SERVICE (230)	"Unidentified"	"TVDataService"

AKEYCODE_TV_RADIO_SERVICE (232)	"Unidentified"	"TVRadioService"
AKEYCODE_TVTELETEXT (233)	"Unidentified"	"Teletext"
AKEYCODE_NUMBER_ENTRY (234)	"Unidentified"	"TVNumberEntry"
AKEYCODE_TV_TERRESTRIAL_ANALOG (235)	"Unidentified"	"TVTerrestrialAnalog"
AKEYCODE_TV_TERRESTRIAL_DIGITAL (236)	"Unidentified"	"TVTerrestrialDigital"
AKEYCODE_TV_SATELLITE (237)	"Unidentified"	"TVSatellite"
AKEYCODE_TV_SATELLITE_BS (238)	"Unidentified"	"TVSatelliteBS"
AKEYCODE_TV_SATELLITE_CS (239)	"Unidentified"	"TVSatelliteCS"
AKEYCODE_TV_SATELLITE_SERVICE (240)	"Unidentified"	"TVSatelliteToggle"
AKEYCODE_TV_NETWORK (241)	"Unidentified"	"TVNetwork"
AKEYCODE_TV_ANTENNA_CABLE (242)	"Unidentified"	"TVAntennaCable"
AKEYCODE_TV_INPUT_HDMI_1 (243)	"Unidentified"	"TVInputHDMI1"
AKEYCODE_TV_INPUT_HDMI_2 (244)	"Unidentified"	"TVInputHDMI2"
AKEYCODE_TV_INPUT_HDMI_3 (245)	"Unidentified"	"TVInputHDMI3"
AKEYCODE_TV_INPUT_HDMI_4 (246)	"Unidentified"	"TVInputHDMI4"
AKEYCODE_TV_INPUT_COMPOSITE_1 (247)	"Unidentified"	"TVInputComponent1"
AKEYCODE_TV_INPUT_COMPOSITE_2 (248)	"Unidentified"	"TVInputComponent2"
AKEYCODE_TV_INPUT_COMPONENT_1 (249)	"Unidentified"	"TVInputComposite1"
AKEYCODE_TV_INPUT_COMPONENT_2 (250)	"Unidentified"	"TVInputComposite2"
AKEYCODE_TV_INPUT_VGA_1 (251)	"Unidentified"	"TVInputVGA1"
AKEYCODE_TV_AUDIO_DESCRIPTION (252)	"Unidentified"	"TVAudioDescription"
AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP (253)	"Unidentified"	"TVAudioDescriptionMixUp"
AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN (254)	"Unidentified"	"TVAudioDescriptionMixDown"
AKEYCODE_TV_ZOOM_MODE (255)	"Unidentified"	"ZoomToggle"
AKEYCODE_TV_CONTENTS_MENU (256)	"Unidentified"	"TVContentsMenu"

AKEYCODE_TV_TIMER_PROGRAMMING (258)	"Unidentified"	"TVTimer"

AKEYCODE_NAVIGATE_PREVIOUS (260)	"Unidentified"	"NavigatePrevious"
AKEYCODE_NAVIGATE_NEXT (261)	"Unidentified"	"NavigateNext"
AKEYCODE_NAVIGATE_IN (262)	"Unidentified"	"NavigateIn"
AKEYCODE_NAVIGATE_OUT (263)	"Unidentified"	"NavigateOut"

AKEYCODE_MEDIA_SKIP_FORWARD (272)	"Unidentified"	"MediaSkipForward"
AKEYCODE_MEDIA_SKIP_BACKWARD (273)	"Unidentified"	"MediaSkipBackward"
AKEYCODE_MEDIA_STEP_FORWARD (274)	"Unidentified"	"MediaStepForward"
AKEYCODE_MEDIA_STEP_BACKWARD (275)	"Unidentified"	"MediaStepBackward"

# The above is Tab separated list, so, you could paste it to your spread sheet for easier to read if the Tabs are not replaced by whitespaces at posting this issue.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version:   Channel: n/a
OS Version: 
Flash Version: Shockwave Flash 23.0 r0

I don't have any objections for the suggested mapping of the spec. If you guys have some objections, let me know, then, I put off to use the mapping.
 
Cc: dtapu...@chromium.org
Labels: Hotlist-Input-Dev
Owner: chongz@chromium.org
Status: Assigned (was: Unconfirmed)
chongz@ do you mind investigating? I think the spec probably has added some clarifying text since we wrote the impl.
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 17 2016

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

commit 69074537e7bd722e27bc2734d00d178bfea27f46
Author: chongz <chongz@chromium.org>
Date: Thu Nov 17 07:15:12 2016

[Android DomKey] Add TV, Navigate, Media and others missing mappings

This CL added/fixed 51 missing mappings according to UI Events spec,
most of which are new / not supported before.

Please refer to bug description for the full list of mappings.

spec:
https://w3c.github.io/uievents-key/

TEST=Manual
1. On Android go to https://cdn.rawgit.com/w3c/uievents/gh-pages/tools/key-event-viewer.html
2. Focus input field
3. Run command "adb shell input keyevent 275", etc
4. Verify produced "key"

BUG= 662011 

Review-Url: https://codereview.chromium.org/2501083002
Cr-Commit-Position: refs/heads/master@{#432797}

[modify] https://crrev.com/69074537e7bd722e27bc2734d00d178bfea27f46/ui/events/keycodes/dom/dom_key_data.inc
[modify] https://crrev.com/69074537e7bd722e27bc2734d00d178bfea27f46/ui/events/keycodes/keyboard_code_conversion_android.cc

Comment 4 by chongz@chromium.org, Nov 17 2016

Cc: chongz@chromium.org
Labels: M-56
Status: Fixed (was: Assigned)

Comment 5 by dtoybo...@gmail.com, Nov 21 2016

Thank you for the fix! Firefox will follow same mapping as Chromium (perhaps, Firefox 53).

Although, I found odd mapping, "AKEYCODE_KANA (218)	"Unidentified"	"KanaMode"" might be wrong. I filed a spec issue.
https://github.com/w3c/uievents-key/issues/30

Sorry for missed to catch this at reporting this issue.


Finally, I found forgetting to report a mapping. AKEYCODE_DVR is mapped to "DVR" in the spec, but I didn't include it at the initial report. Should I file new issue for it?
So, for the compatibility, partially backing out the fix might help your users. (Although, almost all web apps must not handle this key.)

Comment 6 by chongz@chromium.org, Nov 29 2016

Blocking: 669647

Comment 7 by chongz@chromium.org, Nov 29 2016

Blocking: 669650

Comment 8 by chongz@chromium.org, Nov 29 2016

Thanks for reporting the issue! I've filed  issue 669650  and  issue 669647  to address your additional comments and will work on them later.
Sorry, I found another mistake at reporting this issue. "Composite" and "Component" were swapped at the original report and your fix took the mistake. I filed  issue 670587 .

Sign in to add a comment