]> 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)
commit38d9917727c7e929dca175187c1c6b9956c0844f
tree2121bd106cb7b33713ae262b69b0fce4b253a97e
parentd10b85f87f0130ab4c526f54de96eb3cf6220c9c
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