Bug 1274503 part.2 Add KeyboardEvent.key value mapping on Android which are not mapped by Gecko but mapped on Chromium r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 01 Dec 2016 21:38:54 +0900
changeset 325101 9b70d74e63f8b5c7f7d3b5aa7a4c3212fc5cd0ff
parent 325100 bdc033e3624b30fb6af96a015f44ecf11bd022d9
child 325102 0d4d808dee276288f0f8bae5d62599a83e70d8c3
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssmaug
bugs1274503
milestone53.0a1
Bug 1274503 part.2 Add KeyboardEvent.key value mapping on Android which are not mapped by Gecko but mapped on Chromium r=smaug First, we should get rid of "Unidentified" keys which are mapped to specific value on Chromium and we can agree without any discussion. MozReview-Commit-ID: C4TZzndahNM
widget/NativeKeyToDOMKeyName.h
widget/android/AndroidJavaWrappers.h
widget/android/nsWindow.cpp
widget/gonk/libui/android_keycodes.h
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -276,24 +276,26 @@ KEY_MAP_WIN     (Clear, VK_CLEAR)
 KEY_MAP_WIN     (Clear, VK_OEM_CLEAR)
 KEY_MAP_COCOA   (Clear, kVK_ANSI_KeypadClear)
 KEY_MAP_GTK     (Clear, GDK_Clear)
 KEY_MAP_ANDROID (Clear, AKEYCODE_CLEAR)
 
 // Copy
 KEY_MAP_WIN_CMD (Copy, APPCOMMAND_COPY)
 KEY_MAP_GTK     (Copy, GDK_Copy)
+KEY_MAP_ANDROID (Copy, AKEYCODE_COPY)
 
 // CrSel
 KEY_MAP_WIN     (CrSel, VK_CRSEL)
 KEY_MAP_GTK     (CrSel, GDK_3270_CursorSelect) // legacy IBM keyboard layout
 
 // Cut
 KEY_MAP_WIN_CMD (Cut, APPCOMMAND_CUT)
 KEY_MAP_GTK     (Cut, GDK_Cut)
+KEY_MAP_ANDROID (Cut, AKEYCODE_CUT)
 
 // Delete
 KEY_MAP_WIN     (Delete, VK_DELETE)
 KEY_MAP_COCOA   (Delete, kVK_PC_Delete)
 KEY_MAP_GTK     (Delete, GDK_Delete)
 KEY_MAP_GTK     (Delete, GDK_KP_Delete)
 KEY_MAP_ANDROID (Delete, AKEYCODE_FORWARD_DEL)
 
@@ -309,16 +311,17 @@ KEY_MAP_GTK     (ExSel, GDK_3270_ExSelec
 KEY_MAP_WIN     (Insert, VK_INSERT)
 KEY_MAP_GTK     (Insert, GDK_Insert)
 KEY_MAP_GTK     (Insert, GDK_KP_Insert)
 KEY_MAP_ANDROID (Insert, AKEYCODE_INSERT)
 
 // Paste
 KEY_MAP_WIN_CMD (Paste, APPCOMMAND_PASTE)
 KEY_MAP_GTK     (Paste, GDK_Paste)
+KEY_MAP_ANDROID (Paste, AKEYCODE_PASTE)
 
 // Redo
 KEY_MAP_WIN_CMD (Redo, APPCOMMAND_REDO)
 KEY_MAP_GTK     (Redo, GDK_Redo)
 
 // Undo
 KEY_MAP_WIN_CMD (Undo, APPCOMMAND_UNDO)
 KEY_MAP_GTK     (Undo, GDK_Undo)
@@ -358,16 +361,17 @@ KEY_MAP_GTK     (Execute, GDK_Execute)
 KEY_MAP_WIN_CMD (Find, APPCOMMAND_FIND)
 KEY_MAP_GTK     (Find, GDK_Find)
 
 // Help
 KEY_MAP_WIN     (Help, VK_HELP)
 KEY_MAP_WIN_CMD (Help, APPCOMMAND_HELP)
 KEY_MAP_COCOA   (Help, kVK_Help)
 KEY_MAP_GTK     (Help, GDK_Help)
+KEY_MAP_ANDROID (Help, AKEYCODE_HELP)
 
 // Pause
 KEY_MAP_WIN     (Pause, VK_PAUSE)
 KEY_MAP_GTK     (Pause, GDK_Pause)
 // Break is typically mapped to Alt+Pause or Ctrl+Pause on GTK.
 KEY_MAP_GTK     (Pause, GDK_Break)
 KEY_MAP_ANDROID (Pause, AKEYCODE_BREAK)
 
@@ -387,19 +391,21 @@ KEY_MAP_ANDROID (ZoomIn, AKEYCODE_ZOOM_I
 KEY_MAP_GTK     (ZoomOut, GDK_ZoomOut)
 KEY_MAP_ANDROID (ZoomOut, AKEYCODE_ZOOM_OUT)
 
 /******************************************************************************
  * Device Keys
  ******************************************************************************/
 // BrightnessDown
 KEY_MAP_GTK     (BrightnessDown, GDK_MonBrightnessDown)
+KEY_MAP_ANDROID (BrightnessDown, AKEYCODE_BRIGHTNESS_DOWN)
 
 // BrightnessUp
 KEY_MAP_GTK     (BrightnessUp, GDK_MonBrightnessUp)
+KEY_MAP_ANDROID (BrightnessUp, AKEYCODE_BRIGHTNESS_UP)
 
 // Eject
 KEY_MAP_GTK     (Eject, GDK_Eject)
 KEY_MAP_ANDROID (Eject, AKEYCODE_MEDIA_EJECT)
 
 // LogOff
 KEY_MAP_GTK     (LogOff, GDK_LogOff)
 
@@ -420,19 +426,21 @@ KEY_MAP_ANDROID (PrintScreen, AKEYCODE_S
 // Hibernate
 KEY_MAP_GTK     (Hibernate, GDK_Hibernate)
 
 // Standby
 KEY_MAP_WIN     (Standby, VK_SLEEP)
 KEY_MAP_GTK     (Standby, GDK_Standby)
 KEY_MAP_GTK     (Standby, GDK_Suspend)
 KEY_MAP_GTK     (Standby, GDK_Sleep)
+KEY_MAP_ANDROID (Standby, AKEYCODE_SLEEP)
 
 // WakeUp
 KEY_MAP_GTK     (WakeUp, GDK_WakeUp)
+KEY_MAP_ANDROID (WakeUp, AKEYCODE_WAKEUP)
 
 /******************************************************************************
  * IME and Composition Keys
  ******************************************************************************/
 // AllCandidates
 KEY_MAP_GTK     (AllCandidates, GDK_MultipleCandidate) // OADG 109, Zen Koho
 
 // Alphanumeric
@@ -879,27 +887,33 @@ KEY_MAP_ANDROID           (AudioVolumeUp
 
 // AudioVolumeMute
 KEY_MAP_WIN               (AudioVolumeMute, VK_VOLUME_MUTE)
 KEY_MAP_WIN_CMD           (AudioVolumeMute, APPCOMMAND_VOLUME_MUTE)
 KEY_MAP_COCOA             (AudioVolumeMute, kVK_Mute)
 KEY_MAP_GTK               (AudioVolumeMute, GDK_AudioMute)
 KEY_MAP_ANDROID           (AudioVolumeMute, AKEYCODE_VOLUME_MUTE)
 
+// MicrophoneVolumeMute
+KEY_MAP_ANDROID (MicrophoneVolumeMute, AKEYCODE_MUTE)
+
 /******************************************************************************
  * Application Keys
  ******************************************************************************/
 // LaunchCalculator
 KEY_MAP_GTK     (LaunchCalculator, GDK_Calculator)
 KEY_MAP_ANDROID (LaunchCalculator, AKEYCODE_CALCULATOR)
 
 // LaunchCalendar
 KEY_MAP_GTK     (LaunchCalendar, GDK_Calendar)
 KEY_MAP_ANDROID (LaunchCalendar, AKEYCODE_CALENDAR)
 
+// LaunchContacts
+KEY_MAP_ANDROID (LaunchContacts, AKEYCODE_CONTACTS)
+
 // LaunchMail
 KEY_MAP_WIN     (LaunchMail, VK_LAUNCH_MAIL)
 KEY_MAP_WIN_CMD (LaunchMail, APPCOMMAND_LAUNCH_MAIL)
 KEY_MAP_GTK     (LaunchMail, GDK_Mail)
 KEY_MAP_ANDROID (LaunchMail, AKEYCODE_ENVELOPE)
 
 // LaunchMediaPlayer
 KEY_MAP_WIN     (LaunchMediaPlayer, VK_LAUNCH_MEDIA_SELECT)
@@ -1030,41 +1044,134 @@ KEY_MAP_ANDROID (BrowserSearch, AKEYCODE
 // BrowserStop
 KEY_MAP_WIN     (BrowserStop, VK_BROWSER_STOP)
 KEY_MAP_WIN_CMD (BrowserStop, APPCOMMAND_BROWSER_STOP)
 KEY_MAP_GTK     (BrowserStop, GDK_Stop)
 
 /******************************************************************************
  * Mobile Phone Keys
  ******************************************************************************/
+// AppSwitch
+KEY_MAP_ANDROID (AppSwitch, AKEYCODE_APP_SWITCH)
+
 // Call
 KEY_MAP_ANDROID (Call, AKEYCODE_CALL)
 
 // Camera
 KEY_MAP_ANDROID (Camera, AKEYCODE_CAMERA)
 
 // CameraFocus
 KEY_MAP_ANDROID_EXCEPT_B2G(CameraFocus,       AKEYCODE_FOCUS)
 
+// EndCall
+KEY_MAP_ANDROID (EndCall, AKEYCODE_ENDCALL)
+
 // GoHome
 KEY_MAP_ANDROID_EXCEPT_B2G(GoHome,     AKEYCODE_HOME)
 KEY_MAP_B2G               (HomeScreen, AKEYCODE_HOME)
 
+// HeadsetHook
+KEY_MAP_ANDROID (HeadsetHook, AKEYCODE_HEADSETHOOK)
+
+// Notification
+KEY_MAP_ANDROID (Notification, AKEYCODE_NOTIFICATION)
+
+// MannerMode
+KEY_MAP_ANDROID (MannerMode, AKEYCODE_MANNER_MODE)
+
 /******************************************************************************
  * TV Keys
  ******************************************************************************/
 // TV
 KEY_MAP_ANDROID (TV, AKEYCODE_TV)
 
+// TV3DMode
+KEY_MAP_ANDROID (TV3DMode, AKEYCODE_3D_MODE)
+
+// TVAntennaCable
+KEY_MAP_ANDROID (TVAntennaCable, AKEYCODE_TV_ANTENNA_CABLE)
+
+// TVAudioDescription
+KEY_MAP_ANDROID (TVAudioDescription, AKEYCODE_TV_AUDIO_DESCRIPTION)
+
+// TVAudioDescriptionMixDown
+KEY_MAP_ANDROID (TVAudioDescriptionMixDown, AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN)
+
+// TVAudioDescriptionMixUp
+KEY_MAP_ANDROID (TVAudioDescriptionMixUp, AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP)
+
+// TVContentsMenu
+KEY_MAP_ANDROID (TVContentsMenu, AKEYCODE_TV_CONTENTS_MENU)
+
+// TVDataService
+KEY_MAP_ANDROID (TVDataService, AKEYCODE_TV_DATA_SERVICE)
+
 // TVInput
 KEY_MAP_ANDROID (TVInput, AKEYCODE_TV_INPUT)
 
+// TVInputComponent1
+KEY_MAP_ANDROID (TVInputComponent1, AKEYCODE_TV_INPUT_COMPONENT_1)
+
+// TVInputComponent2
+KEY_MAP_ANDROID (TVInputComponent2, AKEYCODE_TV_INPUT_COMPONENT_2)
+
+// TVInputComposite1
+KEY_MAP_ANDROID (TVInputComposite1, AKEYCODE_TV_INPUT_COMPOSITE_1)
+
+// TVInputComposite2
+KEY_MAP_ANDROID (TVInputComposite2, AKEYCODE_TV_INPUT_COMPOSITE_2)
+
+// TVInputHDMI1
+KEY_MAP_ANDROID (TVInputHDMI1, AKEYCODE_TV_INPUT_HDMI_1)
+
+// TVInputHDMI2
+KEY_MAP_ANDROID (TVInputHDMI2, AKEYCODE_TV_INPUT_HDMI_2)
+
+// TVInputHDMI3
+KEY_MAP_ANDROID (TVInputHDMI3, AKEYCODE_TV_INPUT_HDMI_3)
+
+// TVInputHDMI4
+KEY_MAP_ANDROID (TVInputHDMI4, AKEYCODE_TV_INPUT_HDMI_4)
+
+// TVInputVGA1
+KEY_MAP_ANDROID (TVInputVGA1, AKEYCODE_TV_INPUT_VGA_1)
+
+// TVNetwork
+KEY_MAP_ANDROID (TVNetwork, AKEYCODE_TV_NETWORK)
+
+// TVNumberEntry
+KEY_MAP_ANDROID (TVNumberEntry, AKEYCODE_TV_NUMBER_ENTRY)
+
 // TVPower
 KEY_MAP_ANDROID (TVPower, AKEYCODE_TV_POWER)
 
+// TVRadioService
+KEY_MAP_ANDROID (TVRadioService, AKEYCODE_TV_RADIO_SERVICE)
+
+// TVSatellite
+KEY_MAP_ANDROID (TVSatellite, AKEYCODE_TV_SATELLITE)
+
+// TVSatelliteBS
+KEY_MAP_ANDROID (TVSatelliteBS, AKEYCODE_TV_SATELLITE_BS)
+
+// TVSatelliteCS
+KEY_MAP_ANDROID (TVSatelliteCS, AKEYCODE_TV_SATELLITE_CS)
+
+// TVSatelliteToggle
+KEY_MAP_ANDROID (TVSatelliteToggle, AKEYCODE_TV_SATELLITE_SERVICE)
+
+// TVTerrestrialAnalog
+KEY_MAP_ANDROID (TVTerrestrialAnalog, AKEYCODE_TV_TERRESTRIAL_ANALOG)
+
+// TVTerrestrialDigital
+KEY_MAP_ANDROID (TVTerrestrialDigital, AKEYCODE_TV_TERRESTRIAL_DIGITAL)
+
+// TVTimer
+KEY_MAP_ANDROID (TVTimer, AKEYCODE_TV_TIMER_PROGRAMMING)
+
 /******************************************************************************
  * Media Controller Keys
  ******************************************************************************/
 // AVRInput
 KEY_MAP_ANDROID (AVRInput, AKEYCODE_AVR_INPUT)
 
 // AVRPower
 KEY_MAP_ANDROID (AVRPower, AKEYCODE_AVR_POWER)
@@ -1083,23 +1190,60 @@ KEY_MAP_ANDROID (ColorF2Yellow, AKEYCODE
 
 // ColorF3Blue
 KEY_MAP_GTK     (ColorF3Blue, GDK_Blue)
 KEY_MAP_ANDROID (ColorF3Blue, AKEYCODE_PROG_BLUE)
 
 // Dimmer
 KEY_MAP_GTK     (Dimmer, GDK_BrightnessAdjust)
 
+// DVR
+KEY_MAP_ANDROID (DVR, AKEYCODE_DVR)
+
 // Guide
 KEY_MAP_ANDROID (Guide, AKEYCODE_GUIDE)
 
 // Info
 KEY_MAP_ANDROID (Info, AKEYCODE_INFO)
 
+// MediaAudioTrack
+KEY_MAP_ANDROID (MediaAudioTrack, AKEYCODE_MEDIA_AUDIO_TRACK)
+
 // MediaLast
+KEY_MAP_ANDROID (MediaLast, AKEYCODE_LAST_CHANNEL)
+
+// MediaTopMenu
+KEY_MAP_ANDROID (MediaTopMenu, AKEYCODE_MEDIA_TOP_MENU)
+
+// MediaSkipBackward
+KEY_MAP_ANDROID (MediaSkipBackward, AKEYCODE_MEDIA_SKIP_BACKWARD)
+
+// MediaSkipForward
+KEY_MAP_ANDROID (MediaSkipForward, AKEYCODE_MEDIA_SKIP_FORWARD)
+
+// MediaStepBackward
+KEY_MAP_ANDROID (MediaStepBackward, AKEYCODE_MEDIA_STEP_BACKWARD)
+
+// MediaStepForward
+KEY_MAP_ANDROID (MediaStepForward, AKEYCODE_MEDIA_STEP_FORWARD)
+
+// NavigateIn
+KEY_MAP_ANDROID (NavigateIn, AKEYCODE_NAVIGATE_IN)
+
+// NavigateNext
+KEY_MAP_ANDROID (NavigateNext, AKEYCODE_NAVIGATE_NEXT)
+
+// NavigateOut
+KEY_MAP_ANDROID (NavigateOut, AKEYCODE_NAVIGATE_OUT)
+
+// NavigatePrevious
+KEY_MAP_ANDROID (NavigatePrevious, AKEYCODE_NAVIGATE_PREVIOUS)
+
+// Pairing
+KEY_MAP_ANDROID (Pairing, AKEYCODE_PAIRING)
 
 // PinPToggle
 KEY_MAP_ANDROID (PinPToggle, AKEYCODE_WINDOW)
 
 // RandomToggle
 KEY_MAP_GTK     (RandomToggle, GDK_AudioRandomPlay)
 
 // Settings
@@ -1110,21 +1254,25 @@ KEY_MAP_ANDROID (STBInput, AKEYCODE_STB_
 
 // 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
 KEY_MAP_WIN     (ZoomToggle, VK_ZOOM)
+KEY_MAP_ANDROID (ZoomToggle, AKEYCODE_TV_ZOOM_MODE)
 
 /******************************************************************************
  * Keys not defined by any standards
  ******************************************************************************/
 // SoftLeft
 KEY_MAP_ANDROID (SoftLeft, AKEYCODE_SOFT_LEFT)
 
 // SoftRight
--- a/widget/android/AndroidJavaWrappers.h
+++ b/widget/android/AndroidJavaWrappers.h
@@ -143,16 +143,98 @@ enum {
     AKEYCODE_MUHENKAN           = 213,
     AKEYCODE_HENKAN             = 214,
     AKEYCODE_KATAKANA_HIRAGANA  = 215,
     AKEYCODE_YEN                = 216,
     AKEYCODE_RO                 = 217,
     AKEYCODE_KANA               = 218,
     AKEYCODE_ASSIST             = 219,
 #endif
+#if __ANDROID_API__ < 18
+    AKEYCODE_BRIGHTNESS_DOWN    = 220,
+    AKEYCODE_BRIGHTNESS_UP      = 221,
+#endif
+#if __ANDROID_API__ < 19
+    AKEYCODE_MEDIA_AUDIO_TRACK  = 222,
+#endif
+#if __ANDROID_API__ < 20
+    AKEYCODE_SLEEP              = 223,
+    AKEYCODE_WAKEUP             = 224,
+#endif
+#if __ANDROID_API__ < 21
+    AKEYCODE_PAIRING                       = 225,
+    AKEYCODE_MEDIA_TOP_MENU                = 226,
+    AKEYCODE_11                            = 227,
+    AKEYCODE_12                            = 228,
+    AKEYCODE_LAST_CHANNEL                  = 229,
+    AKEYCODE_TV_DATA_SERVICE               = 230,
+    AKEYCODE_VOICE_ASSIST                  = 231,
+    AKEYCODE_TV_RADIO_SERVICE              = 232,
+    AKEYCODE_TV_TELETEXT                   = 233,
+    AKEYCODE_TV_NUMBER_ENTRY               = 234,
+    AKEYCODE_TV_TERRESTRIAL_ANALOG         = 235,
+    AKEYCODE_TV_TERRESTRIAL_DIGITAL        = 236,
+    AKEYCODE_TV_SATELLITE                  = 237,
+    AKEYCODE_TV_SATELLITE_BS               = 238,
+    AKEYCODE_TV_SATELLITE_CS               = 239,
+    AKEYCODE_TV_SATELLITE_SERVICE          = 240,
+    AKEYCODE_TV_NETWORK                    = 241,
+    AKEYCODE_TV_ANTENNA_CABLE              = 242,
+    AKEYCODE_TV_INPUT_HDMI_1               = 243,
+    AKEYCODE_TV_INPUT_HDMI_2               = 244,
+    AKEYCODE_TV_INPUT_HDMI_3               = 245,
+    AKEYCODE_TV_INPUT_HDMI_4               = 246,
+    AKEYCODE_TV_INPUT_COMPOSITE_1          = 247,
+    AKEYCODE_TV_INPUT_COMPOSITE_2          = 248,
+    AKEYCODE_TV_INPUT_COMPONENT_1          = 249,
+    AKEYCODE_TV_INPUT_COMPONENT_2          = 250,
+    AKEYCODE_TV_INPUT_VGA_1                = 251,
+    AKEYCODE_TV_AUDIO_DESCRIPTION          = 252,
+    AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP   = 253,
+    AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254,
+    AKEYCODE_TV_ZOOM_MODE                  = 255,
+    AKEYCODE_TV_CONTENTS_MENU              = 256,
+    AKEYCODE_TV_MEDIA_CONTEXT_MENU         = 257,
+    AKEYCODE_TV_TIMER_PROGRAMMING          = 258,
+    AKEYCODE_HELP                          = 259,
+#endif
+#if __ANDROID_API__ < 23
+    AKEYCODE_NAVIGATE_PREVIOUS  = 260,
+    AKEYCODE_NAVIGATE_NEXT      = 261,
+    AKEYCODE_NAVIGATE_IN        = 262,
+    AKEYCODE_NAVIGATE_OUT       = 263,
+#endif
+#if __ANDROID_API__ < 24
+    AKEYCODE_STEM_PRIMARY       = 264,
+    AKEYCODE_STEM_1             = 265,
+    AKEYCODE_STEM_2             = 266,
+    AKEYCODE_STEM_3             = 267,
+    AKEYCODE_DPAD_UP_LEFT       = 268,
+    AKEYCODE_DPAD_DOWN_LEFT     = 269,
+    AKEYCODE_DPAD_UP_RIGHT      = 270,
+    AKEYCODE_DPAD_DOWN_RIGHT    = 271,
+#endif
+#if __ANDROID_API__ < 23
+    AKEYCODE_MEDIA_SKIP_FORWARD  = 272,
+    AKEYCODE_MEDIA_SKIP_BACKWARD = 273,
+    AKEYCODE_MEDIA_STEP_FORWARD  = 274,
+    AKEYCODE_MEDIA_STEP_BACKWARD = 275,
+#endif
+#if __ANDROID_API__ < 24
+    AKEYCODE_SOFT_SLEEP         = 276,
+    AKEYCODE_CUT                = 277,
+    AKEYCODE_COPY               = 278,
+    AKEYCODE_PASTE              = 279,
+#endif
+#if __ANDROID_API__ < 25
+    AKEYCODE_SYSTEM_NAVIGATION_UP    = 280,
+    AKEYCODE_SYSTEM_NAVIGATION_DOWN  = 281,
+    AKEYCODE_SYSTEM_NAVIGATION_LEFT  = 282,
+    AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283,
+#endif
 
     AMETA_FUNCTION_ON           = 0x00000008,
     AMETA_CTRL_ON               = 0x00001000,
     AMETA_CTRL_LEFT_ON          = 0x00002000,
     AMETA_CTRL_RIGHT_ON         = 0x00004000,
     AMETA_META_ON               = 0x00010000,
     AMETA_META_LEFT_ON          = 0x00020000,
     AMETA_META_RIGHT_ON         = 0x00040000,
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -2320,20 +2320,17 @@ ConvertAndroidKeyCodeToKeyNameIndex(int 
         case AKEYCODE_NUMPAD_EQUALS:
         case AKEYCODE_NUMPAD_LEFT_PAREN:
         case AKEYCODE_NUMPAD_RIGHT_PAREN:
 
         case AKEYCODE_YEN:                // yen sign key
         case AKEYCODE_RO:                 // Japanese Ro key
             return KEY_NAME_INDEX_USE_STRING;
 
-        case AKEYCODE_ENDCALL:
         case AKEYCODE_NUM:                // XXX Not sure
-        case AKEYCODE_HEADSETHOOK:
-        case AKEYCODE_NOTIFICATION:       // XXX Not sure
         case AKEYCODE_PICTSYMBOLS:
 
         case AKEYCODE_BUTTON_A:
         case AKEYCODE_BUTTON_B:
         case AKEYCODE_BUTTON_C:
         case AKEYCODE_BUTTON_X:
         case AKEYCODE_BUTTON_Y:
         case AKEYCODE_BUTTON_Z:
@@ -2342,41 +2339,34 @@ ConvertAndroidKeyCodeToKeyNameIndex(int 
         case AKEYCODE_BUTTON_L2:
         case AKEYCODE_BUTTON_R2:
         case AKEYCODE_BUTTON_THUMBL:
         case AKEYCODE_BUTTON_THUMBR:
         case AKEYCODE_BUTTON_START:
         case AKEYCODE_BUTTON_SELECT:
         case AKEYCODE_BUTTON_MODE:
 
-        case AKEYCODE_MUTE: // mutes the microphone
         case AKEYCODE_MEDIA_CLOSE:
 
-        case AKEYCODE_DVR:
-
         case AKEYCODE_BUTTON_1:
         case AKEYCODE_BUTTON_2:
         case AKEYCODE_BUTTON_3:
         case AKEYCODE_BUTTON_4:
         case AKEYCODE_BUTTON_5:
         case AKEYCODE_BUTTON_6:
         case AKEYCODE_BUTTON_7:
         case AKEYCODE_BUTTON_8:
         case AKEYCODE_BUTTON_9:
         case AKEYCODE_BUTTON_10:
         case AKEYCODE_BUTTON_11:
         case AKEYCODE_BUTTON_12:
         case AKEYCODE_BUTTON_13:
         case AKEYCODE_BUTTON_14:
         case AKEYCODE_BUTTON_15:
         case AKEYCODE_BUTTON_16:
-
-        case AKEYCODE_MANNER_MODE:
-        case AKEYCODE_3D_MODE:
-        case AKEYCODE_CONTACTS:
             return KEY_NAME_INDEX_Unidentified;
 
         case AKEYCODE_UNKNOWN:
             MOZ_ASSERT(
                 action != AKEY_EVENT_ACTION_MULTIPLE,
                 "Don't call this when action is AKEY_EVENT_ACTION_MULTIPLE!");
             // It's actually an unknown key if the action isn't ACTION_MULTIPLE.
             // However, it might cause text input.  So, let's check the value.
--- a/widget/gonk/libui/android_keycodes.h
+++ b/widget/gonk/libui/android_keycodes.h
@@ -298,16 +298,40 @@ enum {
     AKEYCODE_TV_AUDIO_DESCRIPTION = 252,
     AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253,
     AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254,
     AKEYCODE_TV_ZOOM_MODE    = 255,
     AKEYCODE_TV_CONTENTS_MENU = 256,
     AKEYCODE_TV_MEDIA_CONTEXT_MENU = 257,
     AKEYCODE_TV_TIMER_PROGRAMMING = 258,
     AKEYCODE_HELP            = 259,
+    AKEYCODE_NAVIGATE_PREVIOUS = 260,
+    AKEYCODE_NAVIGATE_NEXT   = 261,
+    AKEYCODE_NAVIGATE_IN     = 262,
+    AKEYCODE_NAVIGATE_OUT    = 263,
+    AKEYCODE_STEM_PRIMARY    = 264,
+    AKEYCODE_STEM_1          = 265,
+    AKEYCODE_STEM_2          = 266,
+    AKEYCODE_STEM_3          = 267,
+    AKEYCODE_DPAD_UP_LEFT    = 268,
+    AKEYCODE_DPAD_DOWN_LEFT  = 269,
+    AKEYCODE_DPAD_UP_RIGHT   = 270,
+    AKEYCODE_DPAD_DOWN_RIGHT = 271,
+    AKEYCODE_MEDIA_SKIP_FORWARD = 272,
+    AKEYCODE_MEDIA_SKIP_BACKWARD = 273,
+    AKEYCODE_MEDIA_STEP_FORWARD = 274,
+    AKEYCODE_MEDIA_STEP_BACKWARD = 275,
+    AKEYCODE_SOFT_SLEEP      = 276,
+    AKEYCODE_CUT             = 277,
+    AKEYCODE_COPY            = 278,
+    AKEYCODE_PASTE           = 279,
+    AKEYCODE_SYSTEM_NAVIGATION_UP = 280,
+    AKEYCODE_SYSTEM_NAVIGATION_DOWN = 281,
+    AKEYCODE_SYSTEM_NAVIGATION_LEFT = 282,
+    AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283,
 
     // NOTE: If you add a new keycode here you must also add it to several other files.
     //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
 };
 
 #ifdef __cplusplus
 }
 #endif