Some KeyboardEvent.key mapping are different from Firefox
Reported by
dtoybo...@gmail.com,
Nov 4 2016
|
|||||
Issue descriptionSteps to reproduce the problem: When I investigate KeyboardEvent.key mapping on Android from the source code, some values whose mapping are not suggested by the spec are different from Firefox. What is the expected behavior? What went wrong? virtual keycode Gecko Chromium AKEYCODE_SWITCH_CHARSET (95) "ModeChange" "Unidentified" "ModeChange" is declared as "The Mode Change key, to toggle between or cycle through input modes of IMEs.", and KEYCODE_SWITCH_CHARSET is explained as "Key code constant: Switch Charset modifier key. Used to switch character sets (Kanji, Katakana)". I understood the explanation as "changing keyboard layout", but if the keycode doesn't mean it, Firefox should change it to "Unidentified". AKEYCODE_FORWARD (125) "BrowserForward" "MediaSkip" KEYCODE_FORWARD is explained as "Key code constant: Forward key". Although, this is very unclear. However, when I connect keyboard to Nexus 7 (2013), BrowserForward key generates this keycode. So, I think that Chromium should use "BrowserForward" same as Firefox. AKEYCODE_NUMPAD_ENTER (160) "Enter" "Unidentified" Although, I cannot reproduce this odd mapping actually with Google Chrome. Perhaps, DomKey::FromCharacter() or something called in DomKey GetDomKeyFromAndroidEvent() solves this, but looks like that it should be mapped in GetDomKeyFromAndroidKeycode() explicitly. AKEYCODE_BOOKMARK (174) "BrowserFavorites" "Unidentified" Although, I cannot test this because I don't find keyboard which can generate this keycode actually yet. However, the explanation of this keycode is, "Key code constant: Bookmark key. On some TV remotes, bookmarks content or web pages.". So, this should be mapped to "BrowserFavorites". AKEYCODE_LANGUAGE_SWITCH (204) "GroupNext" "Unidentified" The explanation is, "Key code constant: Language Switch key. Toggles the current input language such as switching between English and Japanese on a QWERTY keyboard. On some devices, the same function may be performed by pressing Shift+Spacebar." So, I think that this should be mapped to "GroupNext" because ISO_Next_Group keysym on Linux works as so. AKEYCODE_MUHENKAN (213) "NonConvert" "Unidentified" AKEYCODE_HENKAN (214) "Convert" "Unidentified" These keys are "無変換" and "変換" keys of JIS keyboard and they actually cause these keycodes. So, Chromium should use them. Did this work before? No Does this work in other browsers? N/A Chrome version: Channel: n/a OS Version: Flash Version:
,
Nov 4 2016
This seems simple enough can we get this fixed before M56 branches?
,
Nov 4 2016
garykac@ do you agree we should change AKEYCODE_FORWARD (125) to be BrowserForward? The rest seem fine to me.
,
Nov 4 2016
fine to me = fine to change to match Gecko that is.
,
Nov 9 2016
,
Nov 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c7c76532cc8698c31c622c3340fd0b33ec0d36e3 commit c7c76532cc8698c31c622c3340fd0b33ec0d36e3 Author: chongz <chongz@chromium.org> Date: Thu Nov 10 20:22:32 2016 [Android DomKey] Fix 7 key mappings to match FF This CL maps the following keys: AKEYCODE_SWITCH_CHARSET (95) => "ModeChange" AKEYCODE_FORWARD (125) => "BrowserForward" AKEYCODE_NUMPAD_ENTER (160) => "Enter" AKEYCODE_BOOKMARK (174) => "BrowserFavorites" AKEYCODE_LANGUAGE_SWITCH (204) => "GroupNext" AKEYCODE_MUHENKAN (213) => "NonConvert" AKEYCODE_HENKAN (214) => "Convert" See bug for more detailed explanations. 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 95", etc 4. Verify produced "key" Alternatively we can add tests in "web_input_event_builders_android_unittest.cc", but I'm not sure how useful it would be since it's just a static map. BUG= 662372 Review-Url: https://codereview.chromium.org/2481033007 Cr-Commit-Position: refs/heads/master@{#431337} [modify] https://crrev.com/c7c76532cc8698c31c622c3340fd0b33ec0d36e3/ui/events/keycodes/keyboard_code_conversion_android.cc
,
Nov 10 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtoybo...@gmail.com
, Nov 4 2016