Bug 1112712 - DOM key mapping for soft1 soft2 and call keys r=schien
authorHansu Kim <hansu9866@gmail.com>
Fri, 16 Oct 2015 11:04:11 -0700
changeset 288912 df48164d86be78a967683f3468a360243a7e985a
parent 288911 4d0092c24ef60c903dc89f804270fa5cc3c49415
child 288913 6a4409d952d6bc85f1fb7c4d02ca3f81ff611499
push id5392
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:08:23 +0000
treeherdermozilla-esr52@16ce8562a975 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersschien
bugs1112712
milestone44.0a1
Bug 1112712 - DOM key mapping for soft1 soft2 and call keys r=schien
dom/events/KeyNameList.h
widget/NativeKeyToDOMKeyName.h
widget/android/nsWindow.cpp
--- a/dom/events/KeyNameList.h
+++ b/dom/events/KeyNameList.h
@@ -26,16 +26,19 @@
 DEFINE_KEYNAME_WITH_SAME_NAME(Unidentified)
 
 /******************************************************************************
  * Our Internal Key Values (must have "Moz" prefix)
  *****************************************************************************/
 DEFINE_KEYNAME_INTERNAL(PrintableKey, "MozPrintableKey")
 DEFINE_KEYNAME_INTERNAL(HomeScreen, "MozHomeScreen")
 DEFINE_KEYNAME_INTERNAL(CameraFocusAdjust, "MozCameraFocusAdjust")
+DEFINE_KEYNAME_INTERNAL(PhoneCall, "MozPhoneCall")
+DEFINE_KEYNAME_INTERNAL(SoftLeft, "MozSoftLeft")
+DEFINE_KEYNAME_INTERNAL(SoftRight, "MozSoftRight")
 
 /******************************************************************************
  * Modifier Keys
  *****************************************************************************/
 DEFINE_KEYNAME_WITH_SAME_NAME(Alt)
 DEFINE_KEYNAME_WITH_SAME_NAME(AltGraph)
 DEFINE_KEYNAME_WITH_SAME_NAME(CapsLock)
 DEFINE_KEYNAME_WITH_SAME_NAME(Control)
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -1300,16 +1300,25 @@ KEY_MAP_QT      (ZoomToggle, Qt::Key_Zoo
 
 // HomeScreen
 KEY_MAP_ANDROID (HomeScreen, AKEYCODE_HOME)
 
 // Focus
 KEY_MAP_QT      (CameraFocusAdjust, Qt::Key_CameraFocus)
 KEY_MAP_ANDROID (CameraFocusAdjust, AKEYCODE_FOCUS)
 
+// PhoneCall
+KEY_MAP_ANDROID (PhoneCall, AKEYCODE_CALL)
+
+// SoftLeft
+KEY_MAP_ANDROID (SoftLeft, AKEYCODE_SOFT_LEFT)
+
+// SoftRight
+KEY_MAP_ANDROID (SoftRight, AKEYCODE_SOFT_RIGHT)
+
 #undef KEY_MAP_WIN
 #undef KEY_MAP_WIN_JPN
 #undef KEY_MAP_WIN_KOR
 #undef KEY_MAP_WIN_OTH
 #undef KEY_MAP_WIN_CMD
 #undef KEY_MAP_COCOA
 #undef KEY_MAP_GTK
 #undef KEY_MAP_QT
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1490,19 +1490,16 @@ ConvertAndroidKeyCodeToKeyNameIndex(Andr
         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_SOFT_LEFT:
-        case AKEYCODE_SOFT_RIGHT:
-        case AKEYCODE_CALL:
         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: