Skip to content

Instantly share code, notes, and snippets.

@eduardoarakaki
Last active August 17, 2022 00:56
Show Gist options
  • Select an option

  • Save eduardoarakaki/3a4faca6160551bad2a1bff5a6dcf70c to your computer and use it in GitHub Desktop.

Select an option

Save eduardoarakaki/3a4faca6160551bad2a1bff5a6dcf70c to your computer and use it in GitHub Desktop.
On Linux, the Keychron K2 doesn't register any of the F1-F12 function keys as actual F keys, instead, treating them as multimedia keys by default. Here's how to fix it!
They keyboard 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
Use Fn + X + L (hold for 4 seconds) to set the function key row to "Function" mode. (usually all that's necessary on Windows)
echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode
echo 1 | sudo tee /sys/module/hid_apple/parameters/fnmode (Default)
Once complete, my F1-F12 keys work properly, and holding Fn turns them into multimedia keys. You can use the evtest utility to check how keyboard keys are registering until you get the above combination of settings configured properly.
To persist this change, add a module option for hid_apple:
echo "options hid_apple fnmode=0" | sudo tee -a /etc/modprobe.d/hid_apple.conf
You may need to rebuild your initramfs if hid_apple is included. - ubuntu: sudo update-initramfs -u - arch: mkinitcpio -P
ref: mikeshade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment