Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7511f9cd authored by Yang Chuang's avatar Yang Chuang Committed by Jeff Brown
Browse files

Add Japanese specific key codes.

These keys are specific to Japanese hardware keyboard which can be
used by input method.

Patch ported from AOSP, with the addition of EISU and KANA mappings.

Change-Id: I647473cdd257458e3b9d134b0fc623eae946c3e0
parent d56feb91
Loading
Loading
Loading
Loading
+26 −2
Original line number Diff line number Diff line
@@ -591,8 +591,24 @@ public class KeyEvent extends InputEvent implements Parcelable {
    /** Key code constant: Calculator special function key.
     * Used to launch a calculator application. */
    public static final int KEYCODE_CALCULATOR      = 210;

    private static final int LAST_KEYCODE           = KEYCODE_CALCULATOR;
    /** Key code constant: Japanese full-width / half-width key. */
    public static final int KEYCODE_ZENKAKU_HANKAKU = 211;
    /** Key code constant: Japanese alphanumeric key. */
    public static final int KEYCODE_EISU            = 212;
    /** Key code constant: Japanese non-conversion key. */
    public static final int KEYCODE_MUHENKAN        = 213;
    /** Key code constant: Japanese conversion key. */
    public static final int KEYCODE_HENKAN          = 214;
    /** Key code constant: Japanese katakana / hiragana key. */
    public static final int KEYCODE_KATAKANA_HIRAGANA = 215;
    /** Key code constant: Japanese Yen key. */
    public static final int KEYCODE_YEN             = 216;
    /** Key code constant: Japanese Ro key. */
    public static final int KEYCODE_RO              = 217;
    /** Key code constant: Japanese kana key. */
    public static final int KEYCODE_KANA            = 218;

    private static final int LAST_KEYCODE           = KEYCODE_KANA;

    // NOTE: If you add a new keycode here you must also add it to:
    //  isSystem()
@@ -825,6 +841,14 @@ public class KeyEvent extends InputEvent implements Parcelable {
        names.append(KEYCODE_CALENDAR, "KEYCODE_CALENDAR");
        names.append(KEYCODE_MUSIC, "KEYCODE_MUSIC");
        names.append(KEYCODE_CALCULATOR, "KEYCODE_CALCULATOR");
        names.append(KEYCODE_ZENKAKU_HANKAKU, "KEYCODE_ZENKAKU_HANKAKU");
        names.append(KEYCODE_EISU, "KEYCODE_EISU");
        names.append(KEYCODE_MUHENKAN, "KEYCODE_MUHENKAN");
        names.append(KEYCODE_HENKAN, "KEYCODE_HENKAN");
        names.append(KEYCODE_KATAKANA_HIRAGANA, "KEYCODE_KATAKANA_HIRAGANA");
        names.append(KEYCODE_YEN, "KEYCODE_YEN");
        names.append(KEYCODE_RO, "KEYCODE_RO");
        names.append(KEYCODE_KANA, "KEYCODE_KANA");
    };

    // Symbolic names of all metakeys in bit order from least significant to most significant.
+8 −0
Original line number Diff line number Diff line
@@ -1506,6 +1506,14 @@
        <enum name="KEYCODE_CALENDAR" value="208" />
        <enum name="KEYCODE_MUSIC" value="209" />
        <enum name="KEYCODE_CALCULATOR" value="210" />
        <enum name="KEYCODE_ZENKAKU_HANKAKU" value="211" />
        <enum name="KEYCODE_EISU" value="212" />
        <enum name="KEYCODE_MUHENKAN" value="213" />
        <enum name="KEYCODE_HENKAN" value="214" />
        <enum name="KEYCODE_KATAKANA_HIRAGANA" value="215" />
        <enum name="KEYCODE_YEN" value="216" />
        <enum name="KEYCODE_RO" value="217" />
        <enum name="KEYCODE_KANA" value="218" />
    </attr>

    <!-- ***************************************************************** -->
+8 −8
Original line number Diff line number Diff line
@@ -104,16 +104,16 @@ key 81 NUMPAD_3
key 82    NUMPAD_0
key 83    NUMPAD_DOT
# key 84 (undefined)
# key 85 "KEY_ZENKAKUHANKAKU"
key 85    ZENKAKU_HANKAKU
key 86    BACKSLASH
key 87    F11
key 88    F12
# key 89 "KEY_RO"
key 89    RO
# key 90 "KEY_KATAKANA"
# key 91 "KEY_HIRAGANA"
# key 92 "KEY_HENKAN"
# key 93 "KEY_KATAKANAHIRAGANA"
# key 94 "KEY_MUHENKAN"
key 92    HENKAN
key 93    KATAKANA_HIRAGANA
key 94    MUHENKAN
key 95    NUMPAD_COMMA
key 96    NUMPAD_ENTER
key 97    CTRL_RIGHT
@@ -141,9 +141,9 @@ key 117 NUMPAD_EQUALS
key 119   BREAK
# key 120 (undefined)
key 121   NUMPAD_COMMA
# key 122 "KEY_HANGEUL"
# key 123 "KEY_HANJA"
# key 124 "KEY_YEN"
key 122   KANA
key 123   EISU
key 124   YEN
key 125   META_LEFT
key 126   META_RIGHT
key 127   MENU              WAKE_DROPPED
+8 −0
Original line number Diff line number Diff line
@@ -235,6 +235,14 @@ static const KeycodeLabel KEYCODES[] = {
    { "CALENDAR", 208 },
    { "MUSIC", 209 },
    { "CALCULATOR", 210 },
    { "ZENKAKU_HANKAKU", 211 },
    { "EISU", 212 },
    { "MUHENKAN", 213 },
    { "HENKAN", 214 },
    { "KATAKANA_HIRAGANA", 215 },
    { "YEN", 216 },
    { "RO", 217 },
    { "KANA", 218 },

    // 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.