Keychron K2 Function Keys in Linux

October 20, 2021    linux keychron beginner keychron k2

Keychron function keys doesn’t work in Linux

The F1-F12 function keys aren’t registered as actual F on Linux by default. Here’s how to fix it!

Keychron K2 has 2 modes: Windows/Android and MacOS, but neither mode worked properly out of the box.

To fix this:

  • Set the keyboard to Windows mode via the side switch
  • Either set the fucntion keys as the default behaviour via system BIOS or use Fn + X + L (hold for 4 seconds) to set the function key row to “Function” mode.
  • On your Linux terminal run echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode
  • Once done, the F1-F12 keys seems to be working properly, and holding Fn key while using them seems to turn them into multimedia keys.

Pro Tip: You can use the evtest utility to check how keyboard keys are registering until you get the above combination of settings configured properly.

If you want to persist this change, add the below option to hid_apple module:

echo "options hid_apple fnmode=0" | sudo tee -a /etc/modprobe.d/hid_apple.conf

Once done, you may need to rebuild your initramfs if hid_apple is included in the default modules to be loaded.

Run the following to update your initramfs:

sudo update-initramfs -u -k all

comments powered by Disqus