Skip to content

Commit 56bad16

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Add Japanese specific key codes."
2 parents b6a8007 + 7511f9c commit 56bad16

File tree

4 files changed

+50
-10
lines changed

4 files changed

+50
-10
lines changed

core/java/android/view/KeyEvent.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,24 @@ public class KeyEvent extends InputEvent implements Parcelable {
591591
/** Key code constant: Calculator special function key.
592592
* Used to launch a calculator application. */
593593
public static final int KEYCODE_CALCULATOR = 210;
594-
595-
private static final int LAST_KEYCODE = KEYCODE_CALCULATOR;
594+
/** Key code constant: Japanese full-width / half-width key. */
595+
public static final int KEYCODE_ZENKAKU_HANKAKU = 211;
596+
/** Key code constant: Japanese alphanumeric key. */
597+
public static final int KEYCODE_EISU = 212;
598+
/** Key code constant: Japanese non-conversion key. */
599+
public static final int KEYCODE_MUHENKAN = 213;
600+
/** Key code constant: Japanese conversion key. */
601+
public static final int KEYCODE_HENKAN = 214;
602+
/** Key code constant: Japanese katakana / hiragana key. */
603+
public static final int KEYCODE_KATAKANA_HIRAGANA = 215;
604+
/** Key code constant: Japanese Yen key. */
605+
public static final int KEYCODE_YEN = 216;
606+
/** Key code constant: Japanese Ro key. */
607+
public static final int KEYCODE_RO = 217;
608+
/** Key code constant: Japanese kana key. */
609+
public static final int KEYCODE_KANA = 218;
610+
611+
private static final int LAST_KEYCODE = KEYCODE_KANA;
596612

597613
// NOTE: If you add a new keycode here you must also add it to:
598614
// isSystem()
@@ -825,6 +841,14 @@ private static void populateKeycodeSymbolicNames() {
825841
names.append(KEYCODE_CALENDAR, "KEYCODE_CALENDAR");
826842
names.append(KEYCODE_MUSIC, "KEYCODE_MUSIC");
827843
names.append(KEYCODE_CALCULATOR, "KEYCODE_CALCULATOR");
844+
names.append(KEYCODE_ZENKAKU_HANKAKU, "KEYCODE_ZENKAKU_HANKAKU");
845+
names.append(KEYCODE_EISU, "KEYCODE_EISU");
846+
names.append(KEYCODE_MUHENKAN, "KEYCODE_MUHENKAN");
847+
names.append(KEYCODE_HENKAN, "KEYCODE_HENKAN");
848+
names.append(KEYCODE_KATAKANA_HIRAGANA, "KEYCODE_KATAKANA_HIRAGANA");
849+
names.append(KEYCODE_YEN, "KEYCODE_YEN");
850+
names.append(KEYCODE_RO, "KEYCODE_RO");
851+
names.append(KEYCODE_KANA, "KEYCODE_KANA");
828852
};
829853

830854
// Symbolic names of all metakeys in bit order from least significant to most significant.

core/res/res/values/attrs.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,14 @@
15061506
<enum name="KEYCODE_CALENDAR" value="208" />
15071507
<enum name="KEYCODE_MUSIC" value="209" />
15081508
<enum name="KEYCODE_CALCULATOR" value="210" />
1509+
<enum name="KEYCODE_ZENKAKU_HANKAKU" value="211" />
1510+
<enum name="KEYCODE_EISU" value="212" />
1511+
<enum name="KEYCODE_MUHENKAN" value="213" />
1512+
<enum name="KEYCODE_HENKAN" value="214" />
1513+
<enum name="KEYCODE_KATAKANA_HIRAGANA" value="215" />
1514+
<enum name="KEYCODE_YEN" value="216" />
1515+
<enum name="KEYCODE_RO" value="217" />
1516+
<enum name="KEYCODE_KANA" value="218" />
15091517
</attr>
15101518

15111519
<!-- ***************************************************************** -->

data/keyboards/Generic.kl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ key 81 NUMPAD_3
104104
key 82 NUMPAD_0
105105
key 83 NUMPAD_DOT
106106
# key 84 (undefined)
107-
# key 85 "KEY_ZENKAKUHANKAKU"
107+
key 85 ZENKAKU_HANKAKU
108108
key 86 BACKSLASH
109109
key 87 F11
110110
key 88 F12
111-
# key 89 "KEY_RO"
111+
key 89 RO
112112
# key 90 "KEY_KATAKANA"
113113
# key 91 "KEY_HIRAGANA"
114-
# key 92 "KEY_HENKAN"
115-
# key 93 "KEY_KATAKANAHIRAGANA"
116-
# key 94 "KEY_MUHENKAN"
114+
key 92 HENKAN
115+
key 93 KATAKANA_HIRAGANA
116+
key 94 MUHENKAN
117117
key 95 NUMPAD_COMMA
118118
key 96 NUMPAD_ENTER
119119
key 97 CTRL_RIGHT
@@ -141,9 +141,9 @@ key 117 NUMPAD_EQUALS
141141
key 119 BREAK
142142
# key 120 (undefined)
143143
key 121 NUMPAD_COMMA
144-
# key 122 "KEY_HANGEUL"
145-
# key 123 "KEY_HANJA"
146-
# key 124 "KEY_YEN"
144+
key 122 KANA
145+
key 123 EISU
146+
key 124 YEN
147147
key 125 META_LEFT
148148
key 126 META_RIGHT
149149
key 127 MENU WAKE_DROPPED

include/androidfw/KeycodeLabels.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ static const KeycodeLabel KEYCODES[] = {
235235
{ "CALENDAR", 208 },
236236
{ "MUSIC", 209 },
237237
{ "CALCULATOR", 210 },
238+
{ "ZENKAKU_HANKAKU", 211 },
239+
{ "EISU", 212 },
240+
{ "MUHENKAN", 213 },
241+
{ "HENKAN", 214 },
242+
{ "KATAKANA_HIRAGANA", 215 },
243+
{ "YEN", 216 },
244+
{ "RO", 217 },
245+
{ "KANA", 218 },
238246

239247
// NOTE: If you add a new keycode here you must also add it to several other files.
240248
// Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.

0 commit comments

Comments
 (0)