diff options
author | Aman Gupta <aman@tmm1.net> | 2020-08-03 18:13:29 -0700 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2020-08-06 08:03:19 -0700 |
commit | 7395b0a2650b84516def869139b765a927a87c67 (patch) | |
tree | 8d1aa92fad850974c2692991452fc7dedb772350 /data/keyboards | |
parent | e30b82490c02fc2fcb4839ed8a0d599a5234a9e5 (diff) |
Add KEYCODE_PROG_{BLUE,RED,GREEN,YELLOW} mappings to LKC equivalents
My goal is to allow colored keys on HDMI-CEC and Bluetooth remotes to be used by an Android TV app.
The USB HID spec [1] and CEC spec [2] both define distinct codes for these keys.
The kernel converts both the HID [4] and CEC [5] codes to standard LKC codes [6]:
#define KEY_RED 0x18e
#define KEY_GREEN 0x18f
#define KEY_YELLOW 0x190
#define KEY_BLUE 0x191
Android also defines KEYCODE_PROG_ constants for these keys in KeyEvent.java [3]. This commit maps these LKC codes starting at 0x18e (i.e 398) to the existing KeyEvent equivalents.
[1] https://www.usb.org/sites/default/files/color_buttons_0.pdf
[2] https://github.com/floe/CEC/raw/master/extras/CEC_Specs.pdf
[3] https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/view/KeyEvent.java#L539-L550
[4] https://github.com/torvalds/linux/blob/master/drivers/hid/hid-input.c#L897-L900
[5] https://github.com/torvalds/linux/blob/master/drivers/media/rc/keymaps/rc-cec.c#L142-L145
[6] https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h#L470-L473
Signed-off-by: Aman Gupta <aman@tmm1.net>
Change-Id: I26c63732c8533390de91460acec312fd27ad8866
Diffstat (limited to 'data/keyboards')
-rw-r--r-- | data/keyboards/Generic.kl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/keyboards/Generic.kl b/data/keyboards/Generic.kl index eeb7269536b5..caad45b46a21 100644 --- a/data/keyboards/Generic.kl +++ b/data/keyboards/Generic.kl @@ -345,10 +345,10 @@ key 377 TV # key 395 "KEY_LIST" # key 396 "KEY_MEMO" key 397 CALENDAR -# key 398 "KEY_RED" -# key 399 "KEY_GREEN" -# key 400 "KEY_YELLOW" -# key 401 "KEY_BLUE" +key 398 PROG_RED +key 399 PROG_GREEN +key 400 PROG_YELLOW +key 401 PROG_BLUE key 402 CHANNEL_UP key 403 CHANNEL_DOWN # key 404 "KEY_FIRST" |