Skip to content

Commit 1e936da

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "Add new keycodes for the convenience of Japanese IMEs"
2 parents 0938ef4 + b032bc0 commit 1e936da

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

api/current.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153254,6 +153254,17 @@
153254153254
visibility="public"
153255153255
>
153256153256
</field>
153257+
<field name="KEYCODE_PICTSYMBOLS"
153258+
type="int"
153259+
transient="false"
153260+
volatile="false"
153261+
value="94"
153262+
static="true"
153263+
final="true"
153264+
deprecated="not deprecated"
153265+
visibility="public"
153266+
>
153267+
</field>
153257153268
<field name="KEYCODE_PLUS"
153258153269
type="int"
153259153270
transient="false"
@@ -153430,6 +153441,17 @@
153430153441
visibility="public"
153431153442
>
153432153443
</field>
153444+
<field name="KEYCODE_SWITCH_CHARSET"
153445+
type="int"
153446+
transient="false"
153447+
volatile="false"
153448+
value="95"
153449+
static="true"
153450+
final="true"
153451+
deprecated="not deprecated"
153452+
visibility="public"
153453+
>
153454+
</field>
153433153455
<field name="KEYCODE_SYM"
153434153456
type="int"
153435153457
transient="false"

core/java/android/view/KeyEvent.java

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ public class KeyEvent implements Parcelable {
122122
public static final int KEYCODE_MUTE = 91;
123123
public static final int KEYCODE_PAGE_UP = 92;
124124
public static final int KEYCODE_PAGE_DOWN = 93;
125+
public static final int KEYCODE_PICTSYMBOLS = 94; // switch symbol-sets (Emoji,Kao-moji)
126+
public static final int KEYCODE_SWITCH_CHARSET = 95; // switch char-sets (Kanji,Katakana)
125127

126128
// NOTE: If you add a new keycode here you must also add it to:
127129
// isSystem()
@@ -137,7 +139,7 @@ public class KeyEvent implements Parcelable {
137139
// those new codes. This is intended to maintain a consistent
138140
// set of key code definitions across all Android devices.
139141

140-
private static final int LAST_KEYCODE = KEYCODE_PAGE_DOWN;
142+
private static final int LAST_KEYCODE = KEYCODE_SWITCH_CHARSET;
141143

142144
/**
143145
* @deprecated There are now more than MAX_KEYCODE keycodes.
@@ -694,6 +696,8 @@ public final boolean isSystem() {
694696
case KEYCODE_CAMERA:
695697
case KEYCODE_FOCUS:
696698
case KEYCODE_SEARCH:
699+
case KEYCODE_PICTSYMBOLS:
700+
case KEYCODE_SWITCH_CHARSET:
697701
return true;
698702
default:
699703
return false;

core/res/res/values/attrs.xml

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@
914914
<enum name="KEYCODE_MUTE" value="91" />
915915
<enum name="KEYCODE_PAGE_UP" value="92" />
916916
<enum name="KEYCODE_PAGE_DOWN" value="93" />
917+
<enum name="KEYCODE_PICTSYMBOLS" value="94" />
918+
<enum name="KEYCODE_SWITCH_CHARSET" value="95" />
917919
</attr>
918920

919921
<!-- ***************************************************************** -->

include/ui/KeycodeLabels.h

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ static const KeycodeLabel KEYCODES[] = {
116116
{ "MUTE", 91 },
117117
{ "PAGE_UP", 92 },
118118
{ "PAGE_DOWN", 93 },
119+
{ "PICTSYMBOLS", 94 },
120+
{ "SWITCH_CHARSET", 95 },
119121

120122
// NOTE: If you add a new keycode here you must also add it to:
121123
// (enum KeyCode, in this file)
@@ -222,7 +224,9 @@ typedef enum KeyCode {
222224
kKeyCodeForward = 90,
223225
kKeyCodeMute = 91,
224226
kKeyCodePageUp = 92,
225-
kKeyCodePageDown = 93
227+
kKeyCodePageDown = 93,
228+
kKeyCodePictSymbols = 94,
229+
kKeyCodeSwitchCharset = 95
226230
} KeyCode;
227231

228232
static const KeycodeLabel FLAGS[] = {

0 commit comments

Comments
 (0)