summaryrefslogtreecommitdiff
path: root/include/keyboard_8042_sharedlib.h
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2018-09-07 16:39:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-13 18:58:53 -0700
commit04c593b8175b7b73204b6ce800573d769d83cd7a (patch)
tree51137b1669038c4e4e2f4ee7147f382e420d827b /include/keyboard_8042_sharedlib.h
parent10b223dd62ca5178290a201a353e21bcd040b24d (diff)
downloadchrome-ec-04c593b8175b7b73204b6ce800573d769d83cd7a.tar.gz
keyboard: display keycap label in key status debug messages
The current debug message in keyboard_8042.c displays a tuple of row, column, and press status. Additionally, this CL displays a keycap label for better readability. For keycap label mapping table can be adjustable under "CONFIG_KEYBOARD_SCANCODE_MUTABLE" condition as scancode_set2[] is. For coral board, Enabling CONFIG_KEYBOARD_DEBUG (w/o this CL) occupies 652 bytes in flash, and this CL occupies another 312 bytes. BUG=b:111060830 TEST=manually tested by pressing keyboards and check the EC console screen. BRANCH=kblog Signed-off-by: Namyoon Woo <namyoon@chromium.org> Changes to be committed: modified: board/eve/board.c modified: common/keyboard_8042.c modified: common/keyboard_8042_sharedlib.c modified: include/keyboard_8042_sharedlib.h Change-Id: Idd71a5475b1ee313f99e087be9143dcfb6f81550 Reviewed-on: https://chromium-review.googlesource.com/1214543 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'include/keyboard_8042_sharedlib.h')
-rw-r--r--include/keyboard_8042_sharedlib.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/keyboard_8042_sharedlib.h b/include/keyboard_8042_sharedlib.h
index adf2932231..e944e74af2 100644
--- a/include/keyboard_8042_sharedlib.h
+++ b/include/keyboard_8042_sharedlib.h
@@ -28,6 +28,54 @@ extern const uint16_t scancode_set2[KEYBOARD_ROWS][KEYBOARD_COLS];
extern const uint8_t scancode_translate_table[];
extern uint8_t scancode_translate_set2_to_1(uint8_t code);
+#ifdef CONFIG_KEYBOARD_DEBUG
+#define KEYCAP_LONG_LABEL_BIT (0x80)
+#define KEYCAP_LONG_LABEL_INDEX_BITMASK (~KEYCAP_LONG_LABEL_BIT)
+
+enum keycap_long_label_idx {
+ KLLI_UNKNO = 0x80, /* UNKNOWN */
+ KLLI_F1 = 0x81, /* F1 or PREVIOUS */
+ KLLI_F2 = 0x82, /* F2 or NEXT */
+ KLLI_F3 = 0x83, /* F3 or REFRESH */
+ KLLI_F4 = 0x84, /* F4 or FULL_SCREEN */
+ KLLI_F5 = 0x85, /* F5 or OVERVIEW */
+ KLLI_F6 = 0x86, /* F6 or DIM */
+ KLLI_F7 = 0x87, /* F7 or BRIGHT */
+ KLLI_F8 = 0x88, /* F8 or MUTE */
+ KLLI_F9 = 0x89, /* F9 or VOLUME DOWN */
+ KLLI_F10 = 0x8A, /* F10 or VOLUME UP */
+ KLLI_F11 = 0x8B, /* F11 or POWER */
+ KLLI_F12 = 0x8C, /* F12 or DEV TOOLS */
+ KLLI_F13 = 0x8D, /* F13 or GOOGLE ASSISTANT */
+ KLLI_RSVD4 = 0x8E,
+ KLLI_RSVD5 = 0x8F,
+ KLLI_L_ALT = 0x90, /* LEFT ALT */
+ KLLI_R_ALT = 0x91, /* RIGHT ALT */
+ KLLI_L_CTR = 0x92, /* LEFT CONTROL */
+ KLLI_R_CTR = 0x93, /* RIGHT CONTROL */
+ KLLI_L_SHT = 0x94, /* LEFT SHIFT */
+ KLLI_R_SHT = 0x95, /* RIGHT SHIFT */
+ KLLI_ENTER = 0x96, /* ENTER */
+ KLLI_SPACE = 0x97, /* SPACE */
+ KLLI_B_SPC = 0x98, /* BACk SPACE*/
+ KLLI_TAB = 0x99, /* TAB */
+ KLLI_SEARC = 0x9A, /* SEARCH */
+ KLLI_LEFT = 0x9B, /* LEFT ARROW */
+ KLLI_RIGHT = 0x9C, /* RIGHT ARROW */
+ KLLI_DOWN = 0x9D, /* DOWN ARROW */
+ KLLI_UP = 0x9E, /* UP ARROW */
+ KLLI_ESC = 0x9F, /* ESCAPE */
+ KLLI_MAX
+};
+
+extern const char * const keycap_long_label[];
+#ifdef CONFIG_KEYBOARD_SCANCODE_MUTABLE
+extern char keycap_label[KEYBOARD_ROWS][KEYBOARD_COLS];
+#else
+extern const char keycap_label[KEYBOARD_ROWS][KEYBOARD_COLS];
+#endif
+#endif
+
/* Button scancodes (Power, Volume Down, Volume Up, etc.) */
extern const struct button_8042_t buttons_8042[KEYBOARD_BUTTON_COUNT];