linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: apple: fix up the F6 key on the Omoton KB066 keyboard
@ 2024-10-01  5:51 Alex Henrie
  2025-01-17  6:12 ` [PATCH resend] " Alex Henrie
  0 siblings, 1 reply; 24+ messages in thread
From: Alex Henrie @ 2024-10-01  5:51 UTC (permalink / raw)
  To: linux-input, jkosina; +Cc: Alex Henrie

The Omoton KB066 is an Apple A1255 keyboard clone (HID product code
05ac:022c). On both keyboards, the F6 key becomes Num Lock when the Fn
key is held. But unlike its Apple exemplar, when the Omoton's F6 key is
pressed without Fn, it sends the usage code 0xC0301 from the reserved
section of the consumer page instead of the standard F6 usage code
0x7003F from the keyboard page. The nonstandard code is translated to
KEY_UNKNOWN and becomes useless on Linux. The Omoton KB066 is a pretty
popular keyboard, judging from its 28,932 reviews on Amazon at time of
writing, so let's account for its quirk to make it more usable.

By the way, it would be nice if we could automatically set fnmode to 0
for Omoton keyboards because they handle the Fn key internally and the
kernel's Fn key handling creates undesirable side effects such as making
F1 and F2 always Brightness Up and Brightness Down in fnmode=1 (the
default) or always F1 and F2 in fnmode=2. Unfortunately I don't think
there's a way to identify Bluetooth keyboards more specifically than the
HID product code which is obviously inaccurate. Users of Omoton
keyboards will just have to set fnmode to 0 manually to get full Fn key
functionality.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 drivers/hid/hid-apple.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 7e1ae2a2bcc2..9767d17941d0 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -545,6 +545,9 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
 		}
 	}
 
+	if (usage->hid == 0xc0301) /* Omoton KB066 quirk */
+		code = KEY_F6;
+
 	if (usage->code != code) {
 		input_event_with_scancode(input, usage->type, code, usage->hid, value);
 
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-02-24  6:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01  5:51 [PATCH] HID: apple: fix up the F6 key on the Omoton KB066 keyboard Alex Henrie
2025-01-17  6:12 ` [PATCH resend] " Alex Henrie
2025-02-03 21:57   ` Jiri Kosina
2025-02-05  3:02     ` Alex Henrie
2025-02-07 13:07   ` Jiri Kosina
2025-02-12 17:36   ` Aditya Garg
2025-02-12 17:43     ` Aditya Garg
2025-02-16  1:08       ` Alex Henrie
2025-02-16  6:06         ` Aditya Garg
2025-02-16  6:45           ` Aditya Garg
2025-02-17  4:13             ` Alex Henrie
2025-02-17  5:18               ` Aditya Garg
2025-02-17  6:42                 ` Alex Henrie
2025-02-17 10:02                   ` Aditya Garg
2025-02-17 10:03                     ` Aditya Garg
2025-02-24  2:50                     ` Alex Henrie
2025-02-24  4:44                       ` Alex Henrie
2025-02-24  5:05                         ` Aditya Garg
2025-02-24  5:18                           ` Alex Henrie
2025-02-24  5:30                             ` Aditya Garg
2025-02-24  5:40                               ` Alex Henrie
2025-02-24  5:46                                 ` Aditya Garg
2025-02-24  6:01                                   ` Alex Henrie
2025-02-24  2:46                   ` Alex Henrie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).