mirror of
https://github.com/t2linux/linux-t2-patches.git
synced 2026-08-16 05:18:17 -07:00
Add files via upload
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 30f1b86a050b5e272843cb403d74b00ad527534c Mon Sep 17 00:00:00 2001
|
||||
From b35bf1b21ec5ce52a9672ce9924c133d8f4817a1 Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Garg <gargaditya08@proton.me>
|
||||
Date: Mon, 18 May 2026 17:06:58 +0000
|
||||
Subject: [PATCH] HID: appletb-kbd: add option to switch default layer on
|
||||
@@ -13,11 +13,11 @@ disables this behaviour.
|
||||
|
||||
Signed-off-by: Aditya Garg <gargaditya08@proton.me>
|
||||
---
|
||||
drivers/hid/hid-appletb-kbd.c | 64 +++++++++++++++++++++++++++++++----
|
||||
1 file changed, 57 insertions(+), 7 deletions(-)
|
||||
drivers/hid/hid-appletb-kbd.c | 60 +++++++++++++++++++++++++++++++----
|
||||
1 file changed, 53 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c
|
||||
index 462010a75..0f15ea2d2 100644
|
||||
index 462010a75..4f900338b 100644
|
||||
--- a/drivers/hid/hid-appletb-kbd.c
|
||||
+++ b/drivers/hid/hid-appletb-kbd.c
|
||||
@@ -56,6 +56,12 @@ static int appletb_tb_idle_timeout = 15;
|
||||
@@ -45,7 +45,7 @@ index 462010a75..0f15ea2d2 100644
|
||||
return kbd->current_mode == APPLETB_KBD_MODE_OFF;
|
||||
}
|
||||
|
||||
+static u8 appletb_next_default_mode(u8 mode)
|
||||
+static u8 appletb_switch_mode(u8 mode)
|
||||
+{
|
||||
+ switch (mode) {
|
||||
+ case APPLETB_KBD_MODE_SPCL:
|
||||
@@ -60,7 +60,7 @@ index 462010a75..0f15ea2d2 100644
|
||||
static void appletb_kbd_inp_event(struct input_handle *handle, unsigned int type,
|
||||
unsigned int code, int value)
|
||||
{
|
||||
@@ -250,15 +269,46 @@ static void appletb_kbd_inp_event(struct input_handle *handle, unsigned int type
|
||||
@@ -250,15 +269,42 @@ static void appletb_kbd_inp_event(struct input_handle *handle, unsigned int type
|
||||
|
||||
reset_inactivity_timer(kbd);
|
||||
|
||||
@@ -82,7 +82,7 @@ index 462010a75..0f15ea2d2 100644
|
||||
+ msecs_to_jiffies(appletb_tb_double_press_switch_layers))) {
|
||||
+
|
||||
+ appletb_tb_def_mode =
|
||||
+ appletb_next_default_mode(
|
||||
+ appletb_switch_mode(
|
||||
+ appletb_tb_def_mode);
|
||||
+
|
||||
+ appletb_kbd_set_mode(kbd,
|
||||
@@ -99,12 +99,8 @@ index 462010a75..0f15ea2d2 100644
|
||||
+ if (appletb_tb_fn_toggle) {
|
||||
+ kbd->saved_mode = kbd->current_mode;
|
||||
+
|
||||
+ appletb_kbd_set_mode(
|
||||
+ kbd,
|
||||
+ kbd->current_mode ==
|
||||
+ APPLETB_KBD_MODE_SPCL
|
||||
+ ? APPLETB_KBD_MODE_FN
|
||||
+ : APPLETB_KBD_MODE_SPCL);
|
||||
+ appletb_kbd_set_mode(kbd,
|
||||
+ appletb_switch_mode(kbd->current_mode));
|
||||
+ }
|
||||
+
|
||||
} else if (value == 0) {
|
||||
|
||||
Reference in New Issue
Block a user