]> git.baikalelectronics.ru Git - kernel.git/commit
HID: apple: Properly handle function keys on Keychron keyboards
authorBryan Cain <bryancain3@gmail.com>
Thu, 5 May 2022 19:12:21 +0000 (13:12 -0600)
committerJiri Kosina <jkosina@suse.cz>
Wed, 11 May 2022 12:21:56 +0000 (14:21 +0200)
commitbfb30e0b824d49eaaf10a6e460710307b64d2a75
tree2121bd106cb7b33713ae262b69b0fce4b253a97e
parent1ec09fd5763916c56cbfb0351eb9e6a8e9670eb8
HID: apple: Properly handle function keys on Keychron keyboards

Keychron's C-series and K-series of keyboards copy the vendor and
product IDs of an Apple keyboard, but only behave like that device when
set to "Mac" mode. In "Windows" mode, the Fn key doesn't generate a
scancode, so it's impossible to use the F1-F12 keys when fnmode is set
to its default value of 1.

To fix this, make fnmode default to the new value of 3, which behaves
like fnmode=2 for Keychron keyboards and like fnmode=1 for actual Apple
keyboards. This way, Keychron devices are fully usable in both "Windows"
and "Mac" modes, while behavior is unchanged for everything else.

Signed-off-by: Bryan Cain <bryancain3@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-apple.c