From 7452b6448209c0b16b74c8398583bf36c1e1c816 Mon Sep 17 00:00:00 2001 From: Michael Zimmermann Date: Sat, 1 Aug 2020 13:16:15 +0200 Subject: [PATCH] add support for keyboard backlight media keys I've tested this with a german Apple Magic Keyboard with Numeric Keypad (Space Gray) connected to a non-Apple Linux Laptop running Arch Linux. keycode 237 (keysym 0x1008ff06, XF86KbdBrightnessDown) keycode 238 (keysym 0x1008ff05, XF86KbdBrightnessUp) --- src/lib/barrier/key_types.h | 2 ++ src/lib/platform/XWindowsUtil.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/barrier/key_types.h b/src/lib/barrier/key_types.h index 7a8ea537..035db2d8 100644 --- a/src/lib/barrier/key_types.h +++ b/src/lib/barrier/key_types.h @@ -284,6 +284,8 @@ static const KeyID kKeyAppUser1 = 0xE0B6; static const KeyID kKeyAppUser2 = 0xE0B7; static const KeyID kKeyBrightnessDown = 0xE0B8; static const KeyID kKeyBrightnessUp = 0xE0B9; +static const KeyID kKeyKbdBrightnessDown = 0xE0BA; +static const KeyID kKeyKbdBrightnessUp = 0xE0BB; static const KeyID kKeyMissionControl = 0xE0C0; static const KeyID kKeyLaunchpad = 0xE0C1; diff --git a/src/lib/platform/XWindowsUtil.cpp b/src/lib/platform/XWindowsUtil.cpp index 3c90bd62..fb0954d2 100644 --- a/src/lib/platform/XWindowsUtil.cpp +++ b/src/lib/platform/XWindowsUtil.cpp @@ -1250,7 +1250,7 @@ XK_uhorn // map "Internet" keys to KeyIDs static const KeySym s_map1008FF[] = { - /* 0x00 */ 0, 0, kKeyBrightnessUp, kKeyBrightnessDown, 0, 0, 0, 0, + /* 0x00 */ 0, 0, kKeyBrightnessUp, kKeyBrightnessDown, 0, kKeyKbdBrightnessUp, kKeyKbdBrightnessDown, 0, /* 0x08 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, kKeyAudioDown, kKeyAudioMute, kKeyAudioUp, /* 0x14 */ kKeyAudioPlay, kKeyAudioStop, kKeyAudioPrev, kKeyAudioNext,