Commit 6ff61ddc authored by Zentaro Kavanagh's avatar Zentaro Kavanagh Committed by Commit Bot

[keyboard] Add DOM code mappings for keyboard brightness.

- Add new DOM |code| entries corresponding to the USB HID
  codes for keyboard brightness. See USB HID spec update [1]
- Updating the US English keyboard layout data to map
  codes to existing keyboard-brightness accelerator VKEYS.

[1] - https://www.usb.org/sites/default/files/hutrr73_-_fn_key_and_keyboard_backlight_brightness_0.pdf

Bug=1076241
TEST=manual

Change-Id: I79573145afbc8bdafbc6da6782cd99099c73bc13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202667Reviewed-by: default avatarGary Kacmarcik <garykac@chromium.org>
Commit-Queue: Zentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770685}
parent aedb6bef
......@@ -463,6 +463,9 @@ DOM_CODE_DECLARATION {
// KEY_BRIGHTNESS* added in Linux 3.16
// http://www.usb.org/developers/hidpage/HUTRR41.pdf
//
// Keyboard backlight/illumination spec update.
// https://www.usb.org/sites/default/files/hutrr73_-_fn_key_and_keyboard_backlight_brightness_0.pdf
// USB evdev XKB Win Mac Code
DOM_CODE(0x0c0060, 0x0166, 0x016e, 0x0000, 0xffff, NULL, INFO),
DOM_CODE(0x0c0061, 0x0172, 0x017a, 0x0000, 0xffff, NULL, CLOSED_CAPTION_TOGGLE),
......@@ -473,6 +476,8 @@ DOM_CODE_DECLARATION {
DOM_CODE(0x0c0073, 0x0250, 0x0258, 0x0000, 0xffff, NULL, BRIGHTNESS_MINIMIUM),
DOM_CODE(0x0c0074, 0x0251, 0x0259, 0x0000, 0xffff, NULL, BRIGHTNESS_MAXIMUM),
DOM_CODE(0x0c0075, 0x00f4, 0x00fc, 0x0000, 0xffff, NULL, BRIGHTNESS_AUTO),
DOM_CODE(0x0c0079, 0x00e6, 0x00ee, 0x0000, 0xffff, NULL, KBD_ILLUM_UP),
DOM_CODE(0x0c007a, 0x00e5, 0x00ed, 0x0000, 0xffff, NULL, KBD_ILLUM_DOWN),
DOM_CODE(0x0c0083, 0x0195, 0x019d, 0x0000, 0xffff, NULL, MEDIA_LAST),
DOM_CODE(0x0c008c, 0x00a9, 0x00b1, 0x0000, 0xffff, NULL, LAUNCH_PHONE),
DOM_CODE(0x0c008d, 0x016a, 0x0172, 0x0000, 0xffff, NULL, PROGRAM_GUIDE),
......
......@@ -24,10 +24,10 @@ namespace {
// These are in the same order as the columns in dom_code_data.inc
// as reflected in the DOM_CODE() macro below.
const size_t expected_mapped_key_count[] = {
214, // evdev
214, // xkb
157, // windows
119, // mac
216, // evdev
216, // xkb
157, // windows
119, // mac
};
const size_t kNativeColumns = base::size(expected_mapped_key_count);
......
......@@ -580,7 +580,10 @@ const struct DomCodeToKeyboardCodeEntry {
#if defined(OS_POSIX)
{DomCode::BRIGHTNESS_UP, VKEY_BRIGHTNESS_UP}, // 0x0C006F BrightnessUp
{DomCode::BRIGHTNESS_DOWN,
VKEY_BRIGHTNESS_DOWN}, // 0x0C0070 BrightnessDown
VKEY_BRIGHTNESS_DOWN}, // 0x0C0070 BrightnessDown
{DomCode::KBD_ILLUM_UP, VKEY_KBD_BRIGHTNESS_UP}, // 0x0C0079 KbdIllumUp
{DomCode::KBD_ILLUM_DOWN,
VKEY_KBD_BRIGHTNESS_DOWN}, // 0x0C007a KbdIllumDown
#endif
{DomCode::MEDIA_TRACK_NEXT,
VKEY_MEDIA_NEXT_TRACK}, // 0x0C00B5 MediaTrackNext
......@@ -642,8 +645,6 @@ const DomCodeToKeyboardCodeEntry kFallbackKeyboardCodeToDomCodeMap[] = {
// VKEY_OEM_104 // 0x0C00B3 MediaFastForward
//
// VKEYs with no corresponding DomCode, but a Linux evdev usage code:
// VKEY_KBD_BRIGHTNESS_DOWN // evdev KEY_KBDILLUMDOWN
// VKEY_KBD_BRIGHTNESS_UP // evdev KEY_KBDILLUMUP
// VKEY_WLAN // evdev KEY_WLAN
//
// VKEYs with no corresponding DomCode and no obvious USB usage code:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment