Skip to content

Commit 0e464d5

Browse files
alexhenriegregkh
authored andcommitted
HID: apple: disable Fn key handling on the Omoton KB066
commit 221cea1 upstream. Remove the fixup to make the Omoton KB066's F6 key F6 when not holding Fn. That was really just a hack to allow typing F6 in fnmode>0, and it didn't fix any of the other F keys that were likewise untypable in fnmode>0. Instead, because the Omoton's Fn key is entirely internal to the keyboard, completely disable Fn key translation when an Omoton is detected, which will prevent the hid-apple driver from interfering with the keyboard's built-in Fn key handling. All of the F keys, including F6, are then typable when Fn is held. The Omoton KB066 and the Apple A1255 both have HID product code 05ac:022c. The self-reported name of every original A1255 when they left the factory was "Apple Wireless Keyboard". By default, Mac OS changes the name to "<username>'s keyboard" when pairing with the keyboard, but Mac OS allows the user to set the internal name of Apple keyboards to anything they like. The Omoton KB066's name, on the other hand, is not configurable: It is always "Bluetooth Keyboard". Because that name is so generic that a user might conceivably use the same name for a real Apple keyboard, detect Omoton keyboards based on both having that exact name and having HID product code 022c. Fixes: 819083c ("HID: apple: fix up the F6 key on the Omoton KB066 keyboard") Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Reviewed-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6fbb0e3 commit 0e464d5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/hid/hid-apple.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ static bool apple_is_non_apple_keyboard(struct hid_device *hdev)
378378
return false;
379379
}
380380

381+
static bool apple_is_omoton_kb066(struct hid_device *hdev)
382+
{
383+
return hdev->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI &&
384+
strcmp(hdev->name, "Bluetooth Keyboard") == 0;
385+
}
386+
381387
static inline void apple_setup_key_translation(struct input_dev *input,
382388
const struct apple_key_translation *table)
383389
{
@@ -546,9 +552,6 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
546552
}
547553
}
548554

549-
if (usage->hid == 0xc0301) /* Omoton KB066 quirk */
550-
code = KEY_F6;
551-
552555
if (usage->code != code) {
553556
input_event_with_scancode(input, usage->type, code, usage->hid, value);
554557

@@ -728,7 +731,7 @@ static int apple_input_configured(struct hid_device *hdev,
728731
{
729732
struct apple_sc *asc = hid_get_drvdata(hdev);
730733

731-
if ((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) {
734+
if (((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) || apple_is_omoton_kb066(hdev)) {
732735
hid_info(hdev, "Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling\n");
733736
asc->quirks &= ~APPLE_HAS_FN;
734737
}

0 commit comments

Comments
 (0)