You are not logged in.

#1 2022-06-08 16:48:57

jones
Member
Registered: 2013-03-14
Posts: 274

[S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

Just received my Keychron K8 a few hours ago and promptly used it with my work machine (which runs Windows). I noticed 0 oddities, bugs or whatever, all went smoothly.

On Linux, it is different. In short: Keychron apparently hardcodes their mapping to a different mode.
This seems to be an issue because there isn't a "hidden/secret" remapping like on Windows... I think Windows remaps the key presses on-the-fly.

So that is why there are posts like the following ones:

They all end up with the same advice (heavily inspired by this page):

You can use the command

echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode

.

To make the fnmode change persistent, 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 or for arch: mkinitcpio -P


=> So the moment I do not use my Keychron keyboard but any other one, I should switch the fnmode value, at least temporarily, right?

Last edited by jones (2022-06-08 21:17:14)

Offline

#2 2022-06-08 20:51:32

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 449

Re: [S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

Why do you want to rebuild initramfs for another keyboard? fnmode=0 is applied to keyboards handled by hid_apple module only, not to any other keyboards.

Offline

#3 2022-06-08 21:10:57

jones
Member
Registered: 2013-03-14
Posts: 274

Re: [S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

Oh, right.
Well I did not really catch that. Thank you!

Offline

#4 2022-06-08 21:13:30

progandy
Member
Registered: 2012-05-17
Posts: 5,298

Re: [S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

Here is a description of the fnmode parameter for apple keyboards. If you want to use the media keys then you may want to use another setting:
https://wiki.archlinux.org/title/Apple_ … le_options

Last edited by progandy (2022-06-08 21:14:24)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2022-06-08 21:17:52

jones
Member
Registered: 2013-03-14
Posts: 274

Re: [S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

Yes I do!
I should use the value 2.

=> SOLVED

Offline

#6 2022-06-09 09:06:49

andyturfer
Member
Registered: 2021-01-08
Posts: 106

Re: [S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

I have a KeyChron K2 (love it). I created a file called keychron.service in /etc/systemd/system with the following contents:

Unit]
Description=The command to make the Keychron K2 work

[Service]
Type=oneshot
ExecStart=/bin/bash -c "echo 0 > /sys/module/hid_apple/parameters/fnmode"

[Install]
WantedBy=multi-user.target

Now I can enable or disable this on boot with:

sudo systemctl enable keychron.service
sudo systemctl disable keychron.service

Or if I want to start/stop it on the fly (without rebooting):

sudo systemctl start keychron.service
sudo systemctl stop keychron.service

Offline

#7 2022-06-09 19:28:55

jones
Member
Registered: 2013-03-14
Posts: 274

Re: [S] Keychron's Fn keys - Rebuild the initramfs for another keyboard?

Interesting! And quite clever, if I may say so. smile

Thank you, dear Andy Turfer.
Also a belated thanks to progandy. smile

Last edited by jones (2022-06-09 19:29:28)

Offline

Board footer

Powered by FluxBB