OSDN Git Service

Introduce stem keycodes for Wear
authorAnthony Hugh <ahugh@google.com>
Tue, 23 Jun 2015 17:49:05 +0000 (10:49 -0700)
committerAnthony Hugh <ahugh@google.com>
Wed, 24 Jun 2015 20:26:55 +0000 (13:26 -0700)
This change adds four new stem keycodes for Android Wear. These
keycodes are intended to represent the various hardware buttons
around the watch.  There is one primary stem key that will be used
for power/settings and three generic stem keys that will be
customizable.

BUG: 21903503
Change-Id: I60f87f027fa4d4b19933d96b4110019805b30895

include/android/keycodes.h
include/input/InputEventLabels.h

index 15bb786..f671116 100644 (file)
@@ -722,7 +722,16 @@ enum {
     AKEYCODE_NAVIGATE_PREVIOUS = 260,
     AKEYCODE_NAVIGATE_NEXT   = 261,
     AKEYCODE_NAVIGATE_IN     = 262,
-    AKEYCODE_NAVIGATE_OUT    = 263
+    AKEYCODE_NAVIGATE_OUT    = 263,
+    /** Primary stem key for Wear
+     * Main power/reset button on watch. */
+    AKEYCODE_STEM_PRIMARY = 264,
+    /** Generic stem key 1 for Wear */
+    AKEYCODE_STEM_1 = 265,
+    /** Generic stem key 2 for Wear */
+    AKEYCODE_STEM_2 = 266,
+    /** Generic stem key 3 for Wear */
+    AKEYCODE_STEM_3 = 267
 
     // 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.
index 3962001..a38de00 100644 (file)
@@ -303,6 +303,10 @@ static const InputEventLabel KEYCODES[] = {
     DEFINE_KEYCODE(NAVIGATE_NEXT),
     DEFINE_KEYCODE(NAVIGATE_IN),
     DEFINE_KEYCODE(NAVIGATE_OUT),
+    DEFINE_KEYCODE(STEM_PRIMARY),
+    DEFINE_KEYCODE(STEM_1),
+    DEFINE_KEYCODE(STEM_2),
+    DEFINE_KEYCODE(STEM_3),
 
     { NULL, 0 }
 };