git: 11ad849f1c50 - main - evdev: map ChromeOS "Vivaldi" top-row action keys

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Sun, 13 Sep 2026 09:38:33 UTC
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=11ad849f1c50b2469ff13ee74e2ab0f5bcfa6cc9

commit 11ad849f1c50b2469ff13ee74e2ab0f5bcfa6cc9
Author:     Kang Kang <kk1987@gmail.com>
AuthorDate: 2026-09-13 09:37:39 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2026-09-13 09:37:39 +0000

    evdev: map ChromeOS "Vivaldi" top-row action keys
    
    Chromebook keyboards driven by the ChromeOS EC emit the top-row action
    keys as scancode set 1 codes 0xE0 0x11 - 0xE0 0x1E (see the codeset 1
    comments on the SCANCODE_* enum in chrome-ec
    include/keyboard_8042_sharedlib.h).  The e0 half of the
    evdev_scancode2key() translation table leaves eleven of those at NONE,
    so on FreeBSD those keys emit no evdev event at all and userspace
    remappers such as keyd have nothing to bind to:
    
      e0 11  fullscreen             KEY_ZOOM
      e0 12  overview               KEY_SCALE
      e0 13  screenshot             KEY_SYSRQ
      e0 14  brightness down        KEY_BRIGHTNESSDOWN
      e0 15  brightness up          KEY_BRIGHTNESSUP
      e0 16  privacy screen toggle  KEY_PRIVACY_SCREEN_TOGGLE
      e0 17  kbd backlight down     KEY_KBDILLUMDOWN
      e0 18  kbd backlight up       KEY_KBDILLUMUP
      e0 1a  play/pause             KEY_PLAYPAUSE
      e0 1b  mic mute               KEY_MICMUTE
      e0 1e  kbd backlight toggle   KEY_KBDILLUMTOGGLE
    
    Fill those in.  Only entries that were previously NONE are touched: the
    EC's remaining top-row codes already have mappings here (e0 10 prev
    track, e0 19 next track, e0 20 mute, e0 2e / e0 30 volume, e0 67 refresh,
    e0 69 forward, e0 6a back), as do e0 1c keypad enter and e0 1d right
    control, and none of them change.
    
    Signed-off-by:  Kang Kang <kk1987@gmail.com>
    Tested on:      Lenovo ThinkPad C14 Chromebook (Google primus, ChromeOS EC)
    Reviewed by:    wulf
    MFC after:      2 weeks
---
 sys/dev/evdev/evdev_utils.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/sys/dev/evdev/evdev_utils.c b/sys/dev/evdev/evdev_utils.c
index d7b7b790dc2c..bd3039c3b825 100644
--- a/sys/dev/evdev/evdev_utils.c
+++ b/sys/dev/evdev/evdev_utils.c
@@ -159,10 +159,15 @@ static uint16_t evdev_at_set1_scancodes[] = {
 	NONE,		NONE,		NONE,		NONE,
 	NONE,		NONE,		NONE,		NONE,
 	NONE,		NONE,		NONE,		NONE,
-	KEY_PREVIOUSSONG,	NONE,	NONE,		NONE,
-	NONE,		NONE,		NONE,		NONE,
-	NONE,		KEY_NEXTSONG,	NONE,		NONE,
-	KEY_KPENTER,	KEY_RIGHTCTRL,	NONE,		NONE,
+	/*
+	 * 0xE0 0x11 - 0xE0 0x1E: ChromeOS EC "Vivaldi" top-row action keys
+	 * (see chrome-ec include/keyboard_8042_sharedlib.h).
+	 */
+	KEY_PREVIOUSSONG, KEY_ZOOM,	KEY_SCALE,	KEY_SYSRQ,
+	KEY_BRIGHTNESSDOWN, KEY_BRIGHTNESSUP,		/* 0x14 - 0x15 */
+	KEY_PRIVACY_SCREEN_TOGGLE, KEY_KBDILLUMDOWN,	/* 0x16 - 0x17 */
+	KEY_KBDILLUMUP,	KEY_NEXTSONG,	KEY_PLAYPAUSE,	KEY_MICMUTE,
+	KEY_KPENTER,	KEY_RIGHTCTRL,	KEY_KBDILLUMTOGGLE, NONE,
 	/* 0x20 - 0x3f. 0xE0 prefixed */
 	KEY_MUTE,	KEY_CALC,	KEY_PLAYPAUSE,	NONE,
 	KEY_STOPCD,	NONE,		NONE,		NONE,