Craig Weber

Keychron K2 Linux Bug Workaround

Using a Keychron K2 with Linux has been a very buggy experience, but it's the only wireless keyboard I have, and I'm too stubborn to buy a different one. This post is going to document the fix for the "connected but not working" keychron bug.

Occassionally I'll run into an issue where I'm able to connect the keyboard and the keyboard displays as paired, connected, and trusted. I can see keystrokes coming through when I run sudo btmon, but there's no corresponding input device created when I run sudo evtest.

I've run into this issue a couple of times, and the first time I guess I just tried the right combination until it went away. This time, after much scouring of the Internet and debugging with AI, I managed to find an obscure Reddit post, documenting the steps. I'm copying it here in whole to help preserve it:

https://www.reddit.com/r/Keychron/comments/n159kl/comment/icth31g/

There are a bunch of posts that describe the same issue. Here're all of them that I've managed to find: https://forum.manjaro.org/t/bluetooth-keyboard-keeps-connecting-and-disconnecting-after-rebooting/107772/3 https://m.facebook.com/groups/Keychronlinux/permalink/653334812061057/?_se_imp=1siGazV1fpPzwEcQD https://bbs.archlinux.org/viewtopic.php?id=246479

It seems that Keychron firmware needs to have very specific sequence of actions in order for bluetooth to work. This is how it should be in the exact order:

Remove the keyboard from known bluetooth devices if it's there.

Hold Fn+[1-3] to start pairing with the keyboard

In blueman-manager press "Search" (or type `scan on` in bluetoothctl)

DO NOT CONNECT THE DEVICE, pair it instead. Right click on device in
blueman-manager and select "Pair" (or type `pair <mac>` in bluetoothctl)

Pairing takes a couple of seconds after which keyboard disconnects. Wait
until it fully disconnects

Now, connect the keyboard. Double click it in blueman-manager (or `connect
<mac>` in bluetootctl)

After keyboard is connected, make it "trusted". Right click the device in
blueman-manager and select "Trusted" (or `trust <mac>` in bluetoothctl)

This solves the problem and after switching modes on the keyboard, it connects back automatically. One thing to note is that when you switch off the kb, bluetooth doesn't register that it was disconnected. This means that when you connect it again, you will get two notifications "disconnected" and then "connected" right after.

This sequence was discovered after reading this post which is not Keychron specific: https://superuser.com/questions/1160934/bluetoothctl-connects-and-disconnects-repeatedly