OSDN Git Service

add support for ctrl and cap keys
authorYi Sun <beyounn@gmail.com>
Wed, 11 Nov 2009 09:01:59 +0000 (01:01 -0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 29 Oct 2010 07:45:13 +0000 (15:45 +0800)
api/current.xml
core/java/android/view/KeyEvent.java
core/res/res/values/attrs.xml
include/ui/KeycodeLabels.h

index 73c10d6..14f99f8 100644 (file)
  visibility="public"
 >
 </field>
+<field name="KEYCODE_CAPS_LOCK"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="99"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="KEYCODE_CLEAR"
  type="int"
  transient="false"
  visibility="public"
 >
 </field>
+<field name="KEYCODE_CTRL_LEFT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="98"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="KEYCODE_CTRL_RIGHT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="97"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="KEYCODE_D"
  type="int"
  transient="false"
index 632277d..a8c878b 100644 (file)
@@ -125,6 +125,9 @@ public class KeyEvent implements Parcelable {
     public static final int KEYCODE_VOLUME_MUTE     = 94;
     public static final int KEYCODE_SLEEP           = 95;
     public static final int KEYCODE_WIFI            = 96;
+    public static final int KEYCODE_CTRL_RIGHT      = 97;
+    public static final int KEYCODE_CTRL_LEFT       = 98;
+    public static final int KEYCODE_CAPS_LOCK       = 99;
 
     // NOTE: If you add a new keycode here you must also add it to:
     //  isSystem()
@@ -140,7 +143,7 @@ public class KeyEvent implements Parcelable {
     //  those new codes.  This is intended to maintain a consistent
     //  set of key code definitions across all Android devices.
    
-    private static final int LAST_KEYCODE           = KEYCODE_WIFI;
+    private static final int LAST_KEYCODE           = KEYCODE_CAPS_LOCK;
     
     /**
      * @deprecated There are now more than MAX_KEYCODE keycodes.
index b2d5983..308541e 100644 (file)
         <enum name="KEYCODE_VOLUME_MUTE" value="94" />
         <enum name="KEYCODE_SLEEP" value="95" />
         <enum name="KEYCODE_WIFI" value="96" />
+        <enum name="KEYCODE_CTRL_RIGHT" value="97" />
+        <enum name="KEYCODE_CTRL_LEFT" value="98" />
+        <enum name="KEYCODE_CAPS_LOCK" value="99" />
     </attr>
 
     <!-- ***************************************************************** -->
index 3f899a0..b06cbf8 100644 (file)
@@ -119,6 +119,9 @@ static const KeycodeLabel KEYCODES[] = {
     { "VOLUME_MUTE", 94},
     { "SLEEP", 95},
     { "WIFI", 96},
+    { "CTRL_RIGHT", 97},
+    { "CTRL_LEFT", 98},
+    { "CAPS_LOCK", 99},
 
     // NOTE: If you add a new keycode here you must also add it to:
     //   (enum KeyCode, in this file)
@@ -229,6 +232,9 @@ typedef enum KeyCode {
     kKeyCodeVolumeMute = 94,
     kKeyCodeSleep = 95,
     kKeyCodeWifi = 96,
+    kKeyCodeCtrlRight = 97,
+    kKeyCodeCtrlLeft = 98,
+    kKeyCodeCapsLock = 99,
 } KeyCode;
 
 static const KeycodeLabel FLAGS[] = {