https://schnouki.net/post/2019/how-to-use-a-keychron-k2-usb-keyboard-on-linux/ https://archive.vn/y2WDA
The issue with function keys:
when set to Windows mode, the special keys (“volume up”, “brightness control”, etc.) send Windows-specific key combinations instead of standard keycodes that Xorg recognizes.
when in Mac mode, the Fn key seems useless, there’s no way to enable function keys (to have F12 instead of “volume up”), and the “Command” and “Option” key don’t match the usual order of the Super and Alt keys.
The solution is simple:
use the keyboard in Mac mode (so that it sends useful keycodes instead of Windows-specific shortcuts)
configure the Linux hid_apple driver to use function keys and swap “Option” and “Command” by creating /etc/modprobe.d/hid_apple.conf with the following content:
# For Keychron keyboard -- https://wiki.archlinux.org/index.php/Apple_Keyboard
options hid_apple fnmode=2 swap_opt_cmd=1
You’ll need to reboot (or unplug the keyboard, unload the module, reload it with the correct options, and plug the keyboard), and voilà, it works :)