Skip to content

Commit

Permalink
Make media mode the default in touchbar
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaGarg8 committed Aug 10, 2024
1 parent d91dd5b commit b1f5c1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ index 1d825a474..d903c9a26 100644
obj-$(CONFIG_HID_AUREAL) += hid-aureal.o
diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c
new file mode 100644
index 000000000..e07d57573
index 000000000..ecac68fc7
--- /dev/null
+++ b/drivers/hid/hid-appletb-kbd.c
@@ -0,0 +1,304 @@
Expand Down Expand Up @@ -113,12 +113,12 @@ index 000000000..e07d57573
+
+#define HID_USAGE_MODE 0x00ff0004
+
+static int appletb_tb_def_mode = APPLETB_KBD_MODE_FN;
+static int appletb_tb_def_mode = APPLETB_KBD_MODE_SPCL;
+module_param_named(mode, appletb_tb_def_mode, int, 0444);
+MODULE_PARM_DESC(mode, "Default touchbar mode:\n"
+ " 0 - escape key only\n"
+ " [1] - function-keys only\n"
+ " 2 - special keys only");
+ " 1 - function-keys\n"
+ " [2] - special keys");
+
+struct appletb_kbd {
+ struct hid_field *mode_field;
Expand Down
14 changes: 5 additions & 9 deletions 1017-HID-hid-appletb-kbd-add-support-for-fn-toggle-betwee.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
From 006a51516285ebaa8333d19fb76efbc81e5cdb3e Mon Sep 17 00:00:00 2001
From: Aditya Garg <[email protected]>
Date: Fri, 9 Aug 2024 19:40:53 +0530
Subject: [PATCH] HID: hid-appletb-kbd: add support for fn toggle between media
and function mode

HID: hid-appletb-kbd: add support for fn toggle between media and function mode
This patch adds support for the switching between the Media and Function
keys on the touchbar by pressing the Fn key on Apple Internal Keyboard.

Expand All @@ -13,7 +9,7 @@ Signed-off-by: Aditya Garg <[email protected]>
1 file changed, 128 insertions(+)

diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c
index e07d57573..ec8051dcf 100644
index ecac68fc7..442c4d884 100644
--- a/drivers/hid/hid-appletb-kbd.c
+++ b/drivers/hid/hid-appletb-kbd.c
@@ -26,6 +26,8 @@
Expand All @@ -24,10 +20,10 @@ index e07d57573..ec8051dcf 100644
+
#define HID_USAGE_MODE 0x00ff0004

static int appletb_tb_def_mode = APPLETB_KBD_MODE_FN;
static int appletb_tb_def_mode = APPLETB_KBD_MODE_SPCL;
@@ -35,11 +37,18 @@ MODULE_PARM_DESC(mode, "Default touchbar mode:\n"
" [1] - function-keys only\n"
" 2 - special keys only");
" 1 - function-keys\n"
" [2] - special keys");

+static bool appletb_tb_fn_toggle = true;
+module_param_named(fntoggle, appletb_tb_fn_toggle, bool, 0644);
Expand Down

0 comments on commit b1f5c1f

Please sign in to comment.