summarylogtreecommitdiffstats
path: root/0004-HID-asus-add-keycodes-for-0x6a-0x4b-and-0xc7.patch
diff options
context:
space:
mode:
Diffstat (limited to '0004-HID-asus-add-keycodes-for-0x6a-0x4b-and-0xc7.patch')
-rw-r--r--0004-HID-asus-add-keycodes-for-0x6a-0x4b-and-0xc7.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/0004-HID-asus-add-keycodes-for-0x6a-0x4b-and-0xc7.patch b/0004-HID-asus-add-keycodes-for-0x6a-0x4b-and-0xc7.patch
new file mode 100644
index 000000000000..93696ec28393
--- /dev/null
+++ b/0004-HID-asus-add-keycodes-for-0x6a-0x4b-and-0xc7.patch
@@ -0,0 +1,48 @@
+From ca51c1ad22ab812ee2611f5a22c93688ffd9b5f3 Mon Sep 17 00:00:00 2001
+From: "Luke D. Jones" <luke@ljones.dev>
+Date: Mon, 24 Apr 2023 16:26:33 +1200
+Subject: [PATCH 04/11] HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7
+
+These two keys are found on some models with dual display.
+- 0x6a is intended for controlling the secondary screen brightness.
+- 0x4b is intended for toggling the arrow keys between arrows and
+ page up / page down.
+This key is found on a slightly modified keyboard layout.
+- 0xc7 is intended to cycle through keybvoard brightnesses (upwards) but
+ there is not suitable existing code for this behaviour. Using
+ `KEY_KBDILLUMTOGGLE` is different behaviour to Windows but at least
+ is picked up by many desktops already.
+
+Signed-off-by: Luke D. Jones <luke@ljones.dev>
+---
+ drivers/hid/hid-asus.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
+index 46ecc7dfb2b0..ddfd37e67c3c 100644
+--- a/drivers/hid/hid-asus.c
++++ b/drivers/hid/hid-asus.c
+@@ -884,6 +884,7 @@ static int asus_input_mapping(struct hid_device *hdev,
+ case 0xb5: asus_map_key_clear(KEY_CALC); break;
+ case 0xc4: asus_map_key_clear(KEY_KBDILLUMUP); break;
+ case 0xc5: asus_map_key_clear(KEY_KBDILLUMDOWN); break;
++ case 0xc7: asus_map_key_clear(KEY_KBDILLUMTOGGLE); break;
+
+ /* ASUS touchpad toggle */
+ case 0x6b: asus_map_key_clear(KEY_F21); break;
+@@ -912,6 +913,12 @@ static int asus_input_mapping(struct hid_device *hdev,
+ /* Fn+Right Aura mode next on N-Key keyboard */
+ case 0xb3: asus_map_key_clear(KEY_PROG3); break;
+
++ /* Screenpad toggle on N-Key keyboard */
++ case 0x6a: asus_map_key_clear(KEY_F13); break;
++
++ /* Arrows/Page-up/Down toggle on N-Key keyboard */
++ case 0x4b: asus_map_key_clear(KEY_F14); break;
++
+ default:
+ /* ASUS lazily declares 256 usages, ignore the rest,
+ * as some make the keyboard appear as a pointer device. */
+--
+2.40.1
+