Bug 900400 Support "HiraganaKatakana" and "ZenkakuHankaku" on GTK, Qt, Android and Gonk r=nchen+karlt+mwu+smaug+romaxa
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 30 Dec 2014 10:47:55 +0900
changeset 247444 82b3c66246637d22ef4473156435b6b49a62d02b
parent 247443 a4299c28c5cb0b8ddfb1ceb6f897dcd1a42b8ba7
child 247445 62246121651b04e1ac4cca09b275b09a1e978b7f
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchen
bugs900400
milestone37.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 900400 Support "HiraganaKatakana" and "ZenkakuHankaku" on GTK, Qt, Android and Gonk r=nchen+karlt+mwu+smaug+romaxa
dom/events/KeyNameList.h
widget/NativeKeyToDOMKeyName.h
widget/android/nsWindow.cpp
widget/qt/nsQtKeyUtils.cpp
--- a/dom/events/KeyNameList.h
+++ b/dom/events/KeyNameList.h
@@ -147,23 +147,23 @@ DEFINE_KEYNAME_WITH_SAME_NAME(HanjaMode)
 DEFINE_KEYNAME_WITH_SAME_NAME(JunjaMode)
 
 /******************************************************************************
  * Keys specific to Japanese keyboards
  *****************************************************************************/
 // DEFINE_KEYNAME_WITH_SAME_NAME(Eisu)
 DEFINE_KEYNAME_WITH_SAME_NAME(Hankaku)
 DEFINE_KEYNAME_WITH_SAME_NAME(Hiragana)
-// DEFINE_KEYNAME_WITH_SAME_NAME(HiraganaKatakana)
+DEFINE_KEYNAME_WITH_SAME_NAME(HiraganaKatakana)
 DEFINE_KEYNAME_WITH_SAME_NAME(KanaMode)
 DEFINE_KEYNAME_WITH_SAME_NAME(KanjiMode)
 DEFINE_KEYNAME_WITH_SAME_NAME(Katakana)
 DEFINE_KEYNAME_WITH_SAME_NAME(Romaji)
 DEFINE_KEYNAME_WITH_SAME_NAME(Zenkaku)
-// DEFINE_KEYNAME_WITH_SAME_NAME(ZenkakuHankaku)
+DEFINE_KEYNAME_WITH_SAME_NAME(ZenkakuHankaku)
 
 /******************************************************************************
  * General-Purpose Function Keys
  *****************************************************************************/
 DEFINE_KEYNAME_WITH_SAME_NAME(F1)
 DEFINE_KEYNAME_WITH_SAME_NAME(F2)
 DEFINE_KEYNAME_WITH_SAME_NAME(F3)
 DEFINE_KEYNAME_WITH_SAME_NAME(F4)
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -591,16 +591,21 @@ KEY_MAP_WIN_JPN (Hankaku, VK_OEM_AUTO)
 KEY_MAP_GTK     (Hankaku, GDK_Hankaku)
 KEY_MAP_QT      (Hankaku, Qt::Key_Hankaku)
 
 // Hiragana
 KEY_MAP_WIN_JPN (Hiragana, VK_OEM_COPY)
 KEY_MAP_GTK     (Hiragana, GDK_Hiragana)
 KEY_MAP_QT      (Hiragana, Qt::Key_Hiragana)
 
+// HiraganaKatakana
+KEY_MAP_GTK     (HiraganaKatakana, GDK_Hiragana_Katakana)
+KEY_MAP_QT      (HiraganaKatakana, Qt::Key_Hiragana_Katakana)
+KEY_MAP_ANDROID (HiraganaKatakana, AKEYCODE_KATAKANA_HIRAGANA)
+
 // KanaMode
 // VK_KANA is never used with modern Japanese keyboard, however, IE maps it to
 // KanaMode, therefore, we should use same map for it.
 KEY_MAP_WIN_JPN (KanaMode, VK_KANA /* same as VK_HANGUL */)
 KEY_MAP_WIN_JPN (KanaMode, VK_ATTN)
 KEY_MAP_GTK     (KanaMode, GDK_Kana_Lock)
 KEY_MAP_GTK     (KanaMode, GDK_Kana_Shift)
 KEY_MAP_QT      (KanaMode, Qt::Key_Kana_Lock)
@@ -627,16 +632,21 @@ KEY_MAP_QT      (Romaji, Qt::Key_Romaji)
 // Assuming that EISU key of Android is the Eisu key on Mac keyboard.
 KEY_MAP_ANDROID (Romaji, AKEYCODE_EISU) // XXX Should be "Eisu"
 
 // Zenkaku
 KEY_MAP_WIN_JPN (Zenkaku, VK_OEM_ENLW)
 KEY_MAP_GTK     (Zenkaku, GDK_Zenkaku)
 KEY_MAP_QT      (Zenkaku, Qt::Key_Zenkaku)
 
+// ZenkakuHankaku
+KEY_MAP_GTK     (ZenkakuHankaku, GDK_Zenkaku_Hankaku)
+KEY_MAP_QT      (ZenkakuHankaku, Qt::Key_Zenkaku_Hankaku)
+KEY_MAP_ANDROID (ZenkakuHankaku, AKEYCODE_ZENKAKU_HANKAKU)
+
 /******************************************************************************
  * General-Purpose Function Keys
  ******************************************************************************/
 // F1
 KEY_MAP_WIN     (F1, VK_F1)
 KEY_MAP_COCOA   (F1, kVK_F1)
 KEY_MAP_GTK     (F1, GDK_F1)
 KEY_MAP_GTK     (F1, GDK_KP_F1)
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1428,19 +1428,16 @@ ConvertAndroidKeyCodeToKeyNameIndex(Andr
 
         case AKEYCODE_LANGUAGE_SWITCH:
         case AKEYCODE_MANNER_MODE:
         case AKEYCODE_3D_MODE:
         case AKEYCODE_CONTACTS:
         case AKEYCODE_CALENDAR:
         case AKEYCODE_MUSIC:
         case AKEYCODE_CALCULATOR:
-
-        case AKEYCODE_ZENKAKU_HANKAKU:
-        case AKEYCODE_KATAKANA_HIRAGANA:
             return KEY_NAME_INDEX_Unidentified;
 
         case AKEYCODE_UNKNOWN:
             MOZ_ASSERT(
                 aAndroidGeckoEvent.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/qt/nsQtKeyUtils.cpp
+++ b/widget/qt/nsQtKeyUtils.cpp
@@ -364,18 +364,16 @@ QtKeyCodeToDOMKeyNameIndex(int aKeysym)
         case Qt::Key_ssharp:
         case Qt::Key_division:
         case Qt::Key_ydiaeresis:
             return KEY_NAME_INDEX_PrintableKey;
 
         case Qt::Key_Backtab:
         case Qt::Key_Direction_L:
         case Qt::Key_Direction_R:
-        case Qt::Key_Hiragana_Katakana:
-        case Qt::Key_Zenkaku_Hankaku:
         case Qt::Key_Touroku:
         case Qt::Key_Massyo:
         case Qt::Key_Hangul:
         case Qt::Key_Hangul_Start:
         case Qt::Key_Hangul_End:
         case Qt::Key_Hangul_Hanja:
         case Qt::Key_Hangul_Jamo:
         case Qt::Key_Hangul_Romaja: