Bug 1274503 part.3 Remap AKEYCODE_BACK, AKEYCODE_DPAD_CENTER and AKEYCODE_CAPTIONS to same KeyboardEvent.key value as Chromium r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 21 Nov 2016 22:15:07 +0900
changeset 370060 0d4d808dee276288f0f8bae5d62599a83e70d8c3
parent 370059 9b70d74e63f8b5c7f7d3b5aa7a4c3212fc5cd0ff
child 370061 6c0fb6a93e904b4db0e0821ad5471320586551b1
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1274503
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1274503 part.3 Remap AKEYCODE_BACK, AKEYCODE_DPAD_CENTER and AKEYCODE_CAPTIONS to same KeyboardEvent.key value as Chromium r=smaug AKEYCODE_BACK should be remapped from "BrowserBack" to "GoBack". AKEYCODE_DPAD_CENTER should be remapped from "Accept" to "Enter". AKEYCODE_CAPTIONS should be remapped from "Subtitle" to "ClosedCaptionToggle". The new values are same as Chromium and they are also declared in the spec. FYI: Gaia doesn't use above key values, so, it's safe to use KEY_MAP_ANDROID for them. MozReview-Commit-ID: AJwhB59cKzq
widget/NativeKeyToDOMKeyName.h
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -188,16 +188,17 @@ KEY_MAP_ANDROID (Symbol, AKEYCODE_SYM)
 KEY_MAP_WIN     (Enter, VK_RETURN)
 KEY_MAP_COCOA   (Enter, kVK_Return)
 KEY_MAP_COCOA   (Enter, kVK_ANSI_KeypadEnter)
 KEY_MAP_COCOA   (Enter, kVK_Powerbook_KeypadEnter)
 KEY_MAP_GTK     (Enter, GDK_Return)
 KEY_MAP_GTK     (Enter, GDK_KP_Enter)
 KEY_MAP_GTK     (Enter, GDK_ISO_Enter)
 KEY_MAP_GTK     (Enter, GDK_3270_Enter)
+KEY_MAP_ANDROID (Enter, AKEYCODE_DPAD_CENTER)
 KEY_MAP_ANDROID (Enter, AKEYCODE_ENTER)
 KEY_MAP_ANDROID (Enter, AKEYCODE_NUMPAD_ENTER)
 
 // Tab
 KEY_MAP_WIN     (Tab, VK_TAB)
 KEY_MAP_COCOA   (Tab, kVK_Tab)
 KEY_MAP_GTK     (Tab, GDK_Tab)
 KEY_MAP_GTK     (Tab, GDK_KP_Tab)
@@ -326,17 +327,16 @@ KEY_MAP_GTK     (Redo, GDK_Redo)
 KEY_MAP_WIN_CMD (Undo, APPCOMMAND_UNDO)
 KEY_MAP_GTK     (Undo, GDK_Undo)
 
 /******************************************************************************
  * UI Keys
  ******************************************************************************/
 // Accept
 KEY_MAP_WIN     (Accept, VK_ACCEPT)
-KEY_MAP_ANDROID (Accept, AKEYCODE_DPAD_CENTER)
 
 // Attn
 KEY_MAP_WIN_OTH (Attn, VK_ATTN) // not valid with Japanese keyboard layout
 KEY_MAP_GTK     (Attn, GDK_3270_Attn) // legacy IBM keyboard layout
 
 // Cancel
 KEY_MAP_WIN     (Cancel, VK_CANCEL)
 KEY_MAP_GTK     (Cancel, GDK_Cancel)
@@ -1006,17 +1006,16 @@ KEY_MAP_GTK     (LaunchApplication16, GD
 
 /******************************************************************************
  * Browser Keys
  ******************************************************************************/
 // BrowserBack
 KEY_MAP_WIN     (BrowserBack, VK_BROWSER_BACK)
 KEY_MAP_WIN_CMD (BrowserBack, APPCOMMAND_BROWSER_BACKWARD)
 KEY_MAP_GTK     (BrowserBack, GDK_Back)
-KEY_MAP_ANDROID (BrowserBack, AKEYCODE_BACK)
 
 // BrowserFavorites
 KEY_MAP_WIN     (BrowserFavorites, VK_BROWSER_FAVORITES)
 KEY_MAP_WIN_CMD (BrowserFavorites, APPCOMMAND_BROWSER_FAVORITES)
 KEY_MAP_ANDROID (BrowserFavorites, AKEYCODE_BOOKMARK)
 
 // BrowserForward
 KEY_MAP_WIN     (BrowserForward, VK_BROWSER_FORWARD)
@@ -1059,16 +1058,19 @@ KEY_MAP_ANDROID (Call, AKEYCODE_CALL)
 KEY_MAP_ANDROID (Camera, AKEYCODE_CAMERA)
 
 // CameraFocus
 KEY_MAP_ANDROID_EXCEPT_B2G(CameraFocus,       AKEYCODE_FOCUS)
 
 // EndCall
 KEY_MAP_ANDROID (EndCall, AKEYCODE_ENDCALL)
 
+// GoBack
+KEY_MAP_ANDROID (GoBack, AKEYCODE_BACK)
+
 // GoHome
 KEY_MAP_ANDROID_EXCEPT_B2G(GoHome,     AKEYCODE_HOME)
 KEY_MAP_B2G               (HomeScreen, AKEYCODE_HOME)
 
 // HeadsetHook
 KEY_MAP_ANDROID (HeadsetHook, AKEYCODE_HEADSETHOOK)
 
 // Notification
@@ -1187,16 +1189,19 @@ KEY_MAP_ANDROID (ColorF1Green, AKEYCODE_
 // ColorF2Yellow
 KEY_MAP_GTK     (ColorF2Yellow, GDK_Yellow)
 KEY_MAP_ANDROID (ColorF2Yellow, AKEYCODE_PROG_YELLOW)
 
 // ColorF3Blue
 KEY_MAP_GTK     (ColorF3Blue, GDK_Blue)
 KEY_MAP_ANDROID (ColorF3Blue, AKEYCODE_PROG_BLUE)
 
+// ClosedCaptionToggle
+KEY_MAP_ANDROID (ClosedCaptionToggle, AKEYCODE_CAPTIONS)
+
 // Dimmer
 KEY_MAP_GTK     (Dimmer, GDK_BrightnessAdjust)
 
 // DVR
 KEY_MAP_ANDROID (DVR, AKEYCODE_DVR)
 
 // Guide
 KEY_MAP_ANDROID (Guide, AKEYCODE_GUIDE)
@@ -1252,17 +1257,16 @@ KEY_MAP_ANDROID (Settings, AKEYCODE_SETT
 // STBInput
 KEY_MAP_ANDROID (STBInput, AKEYCODE_STB_INPUT)
 
 // STBPower
 KEY_MAP_ANDROID (STBPower, AKEYCODE_STB_POWER)
 
 // Subtitle
 KEY_MAP_GTK     (Subtitle, GDK_Subtitle)
-KEY_MAP_ANDROID (Subtitle, AKEYCODE_CAPTIONS)
 
 // Teletext
 KEY_MAP_ANDROID (Teletext, AKEYCODE_TV_TELETEXT)
 
 // VideoModeNext
 KEY_MAP_GTK     (VideoModeNext, GDK_Next_VMode)
 
 // ZoomToggle