diff options
author | Yang Chuang <Yang_Chuang@asus.com> | 2012-02-10 15:18:26 +0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-04-02 15:19:45 -0700 |
commit | 7511f9cd2ff39075ff56c2558c785caffc8b4383 (patch) | |
tree | 25f1eeba677060cfdc52fb75ea58107c0591a8b2 | |
parent | d56feb91b4b1ac9cd0e9b37dfa20d137825fbbfd (diff) | |
download | frameworks_base-7511f9cd2ff39075ff56c2558c785caffc8b4383.zip frameworks_base-7511f9cd2ff39075ff56c2558c785caffc8b4383.tar.gz frameworks_base-7511f9cd2ff39075ff56c2558c785caffc8b4383.tar.bz2 |
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
-rwxr-xr-x | core/java/android/view/KeyEvent.java | 28 | ||||
-rwxr-xr-x | core/res/res/values/attrs.xml | 8 | ||||
-rw-r--r-- | data/keyboards/Generic.kl | 16 | ||||
-rwxr-xr-x | include/androidfw/KeycodeLabels.h | 8 |
4 files changed, 50 insertions, 10 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index 104ed6a..e4a4a75 100755 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -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. diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 428790f..438c141 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -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> <!-- ***************************************************************** --> diff --git a/data/keyboards/Generic.kl b/data/keyboards/Generic.kl index fdd9040..768ee5e 100644 --- a/data/keyboards/Generic.kl +++ b/data/keyboards/Generic.kl @@ -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 diff --git a/include/androidfw/KeycodeLabels.h b/include/androidfw/KeycodeLabels.h index 9e4dfcb..1828062 100755 --- a/include/androidfw/KeycodeLabels.h +++ b/include/androidfw/KeycodeLabels.h @@ -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. |