summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Max Zhang <zhangmax@google.com> 2022-12-15 18:15:39 +0000
committer Max Zhang <zhangmax@google.com> 2023-03-16 17:36:52 +0000
commit57680eb7c8a21ed28f359f9504eb000709a74d84 (patch)
tree9834a219141443e3259f4cf3d62a76100ec6a8dd
parentb82218d25e0c22a9f80ddefaa458d51bda2d3b53 (diff)
[1/4] Add user customizable MACRO_x keys in frameworks
Define keycode in frameworks/native as input labels Project details can be found at go/dipper-custom-button Bug: 269742724 Test: local build Change-Id: I9af8e14892f65e14319f34421063ef330a02078e (cherry picked from commit fcf20b80e15ad23e31bb33e422495eaed2fc7448)
-rw-r--r--include/android/keycodes.h8
-rw-r--r--libs/input/InputEventLabels.cpp6
2 files changed, 13 insertions, 1 deletions
diff --git a/include/android/keycodes.h b/include/android/keycodes.h
index d4ba321057..f8fb256fae 100644
--- a/include/android/keycodes.h
+++ b/include/android/keycodes.h
@@ -831,6 +831,14 @@ enum {
AKEYCODE_STYLUS_BUTTON_TAIL = 311,
/** Key to open recent apps (a.k.a. Overview) */
AKEYCODE_RECENT_APPS = 312,
+ /** User customizable key #1. */
+ AKEYCODE_MACRO_1 = 313,
+ /** User customizable key #2. */
+ AKEYCODE_MACRO_2 = 314,
+ /** User customizable key #3. */
+ AKEYCODE_MACRO_3 = 315,
+ /** User customizable key #4. */
+ AKEYCODE_MACRO_4 = 316,
// 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.
diff --git a/libs/input/InputEventLabels.cpp b/libs/input/InputEventLabels.cpp
index 4a19227694..f99a7d640e 100644
--- a/libs/input/InputEventLabels.cpp
+++ b/libs/input/InputEventLabels.cpp
@@ -343,7 +343,11 @@ namespace android {
DEFINE_KEYCODE(STYLUS_BUTTON_SECONDARY), \
DEFINE_KEYCODE(STYLUS_BUTTON_TERTIARY), \
DEFINE_KEYCODE(STYLUS_BUTTON_TAIL), \
- DEFINE_KEYCODE(RECENT_APPS)
+ DEFINE_KEYCODE(RECENT_APPS), \
+ DEFINE_KEYCODE(MACRO_1), \
+ DEFINE_KEYCODE(MACRO_2), \
+ DEFINE_KEYCODE(MACRO_3), \
+ DEFINE_KEYCODE(MACRO_4)
// NOTE: If you add a new axis here you must also add it to several other files.
// Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list.