Keychron K1 keyboard not working

Bug #1814481 reported by Alejandro Mery
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Confirmed
Undecided
Unassigned

Bug Description

I recently got a nice mechanical bluetooth keyboard to use on my thinkpad. It works fine with Android, Windows 10 and Xubuntu 19.04 live, but on my installed xubuntu 18.04, 18.04 live and 18.10 live it only works after calling `sudo evtest /dev/input/eventN`.

Xorg.0.log shows it is detected fine, and I can't see anything there after temporarily getting it to work using the evtest trick.

    18.515] (II) config/udev: Adding input device Keychron K1 (/dev/input/event23)
[ 18.515] (**) Keychron K1: Applying InputClass "libinput keyboard catchall"
[ 18.515] (II) Using input driver 'libinput' for 'Keychron K1'
[ 18.515] (**) Keychron K1: always reports core events
[ 18.515] (**) Option "Device" "/dev/input/event23"
[ 18.515] (**) Option "_source" "server/udev"
[ 18.516] (II) event23 - Keychron K1: is tagged by udev as: Keyboard
[ 18.516] (II) event23 - Keychron K1: device is a keyboard
[ 18.516] (II) event23 - Keychron K1: device removed
[ 18.524] (II) libinput: Keychron K1: needs a virtual subdevice
[ 18.524] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:256/0005:05AC:0255.0007/input/input24/event23"
[ 18.524] (II) XINPUT: Adding extended input device "Keychron K1" (type: MOUSE, id 20)
[ 18.524] (**) Option "AccelerationScheme" "none"
[ 18.524] (**) Keychron K1: (accel) selected scheme none/0
[ 18.524] (**) Keychron K1: (accel) acceleration factor: 2.000
[ 18.524] (**) Keychron K1: (accel) acceleration threshold: 4
[ 18.524] (II) event23 - Keychron K1: is tagged by udev as: Keyboard
[ 18.524] (II) event23 - Keychron K1: device is a keyboard
[ 18.524] (**) Keychron K1: Applying InputClass "libinput keyboard catchall"
[ 18.524] (II) Using input driver 'libinput' for 'Keychron K1'
[ 18.524] (**) Keychron K1: always reports core events
[ 18.524] (**) Option "Device" "/dev/input/event23"
[ 18.524] (**) Option "_source" "_driver/libinput"
[ 18.524] (II) libinput: Keychron K1: is a virtual subdevice
[ 18.524] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:256/0005:05AC:0255.0007/input/input24/event23"
[ 18.524] (II) XINPUT: Adding extended input device "Keychron K1" (type: KEYBOARD, id 21)
[ 18.524] (**) Option "xkb_model" "pc105"
[ 18.524] (**) Option "xkb_layout" "us"
[ 18.524] (**) Option "xkb_variant" "altgr-intl"
[ 18.524] (WW) Option "xkb_options" requires a string value

I've also tried using the latest 4.20.6 from mainline-ppa and the latest bluetooth/bluz ppa without success.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: xorg 1:7.7+19ubuntu7.1
ProcVersionSignature: Ubuntu 4.15.0-45.48-lowlatency 4.15.18
Uname: Linux 4.15.0-45-lowlatency x86_64
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: XFCE
Date: Sun Feb 3 23:51:29 2019
DistUpgraded: 2019-02-03 21:49:33,752 DEBUG /openCache(), new cache size 92675
DistroCodename: bionic
DistroVariant: ubuntu
DkmsStatus: virtualbox, 5.2.18, 4.15.0-45-lowlatency, x86_64: installed
ExtraDebuggingInterest: Yes
GraphicsCard:
 Intel Corporation HD Graphics 620 [8086:5916] (rev 02) (prog-if 00 [VGA controller])
   Subsystem: Lenovo HD Graphics 620 [17aa:224b]
InstallationDate: Installed on 2017-07-24 (559 days ago)
InstallationMedia: Xubuntu 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215)
MachineType: LENOVO 20HFCTO1WW
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.15.0-45-lowlatency root=UUID=8f8366ae-4d29-44cf-9b85-f83f1771eab1 ro quiet splash vt.handoff=1
SourcePackage: xorg
UpgradeStatus: Upgraded to bionic on 2019-02-03 (0 days ago)
dmi.bios.date: 09/14/2018
dmi.bios.vendor: LENOVO
dmi.bios.version: N1WET51W (1.30 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20HFCTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40709 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrN1WET51W(1.30):bd09/14/2018:svnLENOVO:pn20HFCTO1WW:pvrThinkPadT470s:rvnLENOVO:rn20HFCTO1WW:rvrSDK0J40709WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad T470s
dmi.product.name: 20HFCTO1WW
dmi.product.version: ThinkPad T470s
dmi.sys.vendor: LENOVO
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.95-1~18.04.1
version.libgl1-mesa-dri: libgl1-mesa-dri 18.2.2-0ubuntu1~18.04.1
version.libgl1-mesa-glx: libgl1-mesa-glx 18.2.2-0ubuntu1~18.04.1
version.xserver-xorg-core: xserver-xorg-core 2:1.19.6-1ubuntu4.2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:18.0.1-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20171229-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.15-2

Revision history for this message
Alejandro Mery (amery) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg (Ubuntu):
status: New → Confirmed
affects: xorg (Ubuntu) → bluez (Ubuntu)
Revision history for this message
Alejandro Mery (amery) wrote :

I did test with bluez ppa and didn't change anything.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

You say Xubuntu 19.04 live doesn't have the problem... Can you please try regular Ubuntu 19.04 live?

http://cdimages.ubuntu.com/daily-live/current/

Changed in bluez (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Alejandro Mery (amery) wrote :

I can confirm it works out of the box using the latest Ubuntu "disco" live stick.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

You say 18.10 is broken but 19.04 works, however 'bluez' did not change between those versions. So this sounds more likely to be a kernel bug (which was fixed in later versions).

Next step:

On the 18.04 installation with the bug, please try some newer kernel versions:

  https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

and try to identify the earliest version where the problem stops happening.

affects: bluez (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: Incomplete → Fix Released
Changed in linux (Ubuntu Bionic):
status: New → Incomplete
Revision history for this message
Alejandro Mery (amery) wrote :

I had to uninstall virtualbox because apparently, something related to dkms was preventing me from generating correct initramfs... then it refused to boot because the image wasn't properly signed... are there _signed_ equivalents to these kernel packages?

Revision history for this message
Alejandro Mery (amery) wrote :

I disabled secure boot and tried the latest, 4.20.12... problem persists, and evtest workaround too.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Does kernel parameter "btusb.enable_autosuspend=0" help?

Revision history for this message
Alejandro Mery (amery) wrote :
Download full text (12.3 KiB)

nope, didn't.

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.20.12-042012-lowlatency root=UUID=8f8366ae-4d29-44cf-9b85-f83f1771eab1 ro quiet splash btusb.enable_autosuspend=0 vt.handoff=1

$ dmesg | tail
[ 5691.346757] apple 0005:05AC:0255.0002: unknown main item tag 0x0
[ 5691.347055] input: Keychron K1 as /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:256/0005:05AC:0255.0002/input/input20
[ 5691.348242] apple 0005:05AC:0255.0002: input,hidraw0: BLUETOOTH HID v1.1b Keyboard [Keychron K1] on f8:59:71:4a:0b:72

$ $ sudo evtest /dev/input/event18
[sudo] password for amery:
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x5ac product 0x255 version 0x11b
Input device name: "Keychron K1"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3)
    Event code 5 (KEY_4)
    Event code 6 (KEY_5)
    Event code 7 (KEY_6)
    Event code 8 (KEY_7)
    Event code 9 (KEY_8)
    Event code 10 (KEY_9)
    Event code 11 (KEY_0)
    Event code 12 (KEY_MINUS)
    Event code 13 (KEY_EQUAL)
    Event code 14 (KEY_BACKSPACE)
    Event code 15 (KEY_TAB)
    Event code 16 (KEY_Q)
    Event code 17 (KEY_W)
    Event code 18 (KEY_E)
    Event code 19 (KEY_R)
    Event code 20 (KEY_T)
    Event code 21 (KEY_Y)
    Event code 22 (KEY_U)
    Event code 23 (KEY_I)
    Event code 24 (KEY_O)
    Event code 25 (KEY_P)
    Event code 26 (KEY_LEFTBRACE)
    Event code 27 (KEY_RIGHTBRACE)
    Event code 28 (KEY_ENTER)
    Event code 29 (KEY_LEFTCTRL)
    Event code 30 (KEY_A)
    Event code 31 (KEY_S)
    Event code 32 (KEY_D)
    Event code 33 (KEY_F)
    Event code 34 (KEY_G)
    Event code 35 (KEY_H)
    Event code 36 (KEY_J)
    Event code 37 (KEY_K)
    Event code 38 (KEY_L)
    Event code 39 (KEY_SEMICOLON)
    Event code 40 (KEY_APOSTROPHE)
    Event code 41 (KEY_GRAVE)
    Event code 42 (KEY_LEFTSHIFT)
    Event code 43 (KEY_BACKSLASH)
    Event code 44 (KEY_Z)
    Event code 45 (KEY_X)
    Event code 46 (KEY_C)
    Event code 47 (KEY_V)
    Event code 48 (KEY_B)
    Event code 49 (KEY_N)
    Event code 50 (KEY_M)
    Event code 51 (KEY_COMMA)
    Event code 52 (KEY_DOT)
    Event code 53 (KEY_SLASH)
    Event code 54 (KEY_RIGHTSHIFT)
    Event code 55 (KEY_KPASTERISK)
    Event code 56 (KEY_LEFTALT)
    Event code 57 (KEY_SPACE)
    Event code 58 (KEY_CAPSLOCK)
    Event code 59 (KEY_F1)
    Event code 60 (KEY_F2)
    Event code 61 (KEY_F3)
    Event code 62 (KEY_F4)
    Event code 63 (KEY_F5)
    Event code 64 (KEY_F6)
    Event code 65 (KEY_F7)
    Event code 66 (KEY_F8)
    Event code 67 (KEY_F9)
    Event code 68 (KEY_F10)
    Event code 69 (KEY_NUMLOCK)
    Event code 70 (KEY_SCROLLLOCK)
    Event code 71 (KEY_KP7)
    Event code 72 (KEY_KP8)
    Event code 73 (KEY_KP9)
    Event code 74 (KEY_KPMINUS)
    Event code 75 (KEY_KP4)
    Event code 76 (KEY_KP5)
    Event code 77 (KEY_KP6)
    Event code 78 (KEY_KPPLUS)
    Event code 79 (KEY_KP1)
    Event code 80 (KEY_KP2)
    Event code 81 (KEY_KP3)
    Event code 82 (KEY_KP0)
    Event code 83 (KEY_KPDOT)
    Event code 85 (KEY_ZENKAKUHANKAKU)
    Event code 86 (KEY...

Revision history for this message
Alejandro Mery (amery) wrote :

I just realised the keyboard works in lightdm, and the stops working after logging in.

Revision history for this message
Alejandro Mery (amery) wrote :

I just tried updating the kernel to v5.0, same situation as before. works on lightdm but not on X... until I run evtest.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

So it's not a kernel bug. I am not sure which update fixed it though...

Revision history for this message
Mario Mira (mariomira) wrote :

I can confirm mine "stopped" working via Bluetooth after updating from 18.10 to 19.04. Works with the evtest workaround.

It seems to still work but with the wrong mapping. the numpad (which this model doesn't have) seems to be mapped around the u,i,o keys (as in, u -> 4, i -> 5, o -> 6, 7 -> 7, j -> 1, etc).

Has there been any development on this bug?

Brad Figg (brad-figg)
tags: added: ubuntu-certified
Revision history for this message
Antoine (spectrenoir06) wrote :

Same probleme with ubuntu 19.04 and Keychron K2 keyboard

Revision history for this message
Anibal Rivero (anibalrivero) wrote :

Same problem,

ubuntu 18.04.3
Linux 5.0.0-31-lowlatency
Keychron K1

Works with evtest workaround

Revision history for this message
Mario Mira (mariomira) wrote :

Upgrading to Ubuntu 19.10 seems to have fixed this problem.

Ubuntu 19.10
Kernel 5.3.0-18-generic

Revision history for this message
Yaroslav Kolodiy (y.kolodiy) wrote :

Same problem with Keychrom K2 ubuntu 19.10
but when I'm in the loggin screen it works fine...

Revision history for this message
Eferox (tadas-urbon) wrote :

Hello,

Please try this:
 echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode

If it works for you you can make permanent fix by:
 echo 'options hid_apple fnmode=0' | sudo tee /etc/modprobe.d/hid_apple.conf
 sudo update-initramfs -u

Hope it will help!

Revision history for this message
Alejandro Mery (amery) wrote :
no longer affects: linux (Ubuntu Bionic)
Revision history for this message
Alejandro Mery (amery) wrote :

@vanvugt, shouldn't that be after actually merging the fix?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes, sorry. I'm not sure what I was aiming for there.

summary: - bluetooth keyboard not working
+ Keychron K1 keyboard not working
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

To ensure this bug does not become oversubscribed by other people with other problems I have clarified this bug is only about the "Keychron K1 keyboard".

Revision history for this message
Alejandro Mery (amery) wrote :

good idea, thanks

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Note that if the problem is fixed in later Ubuntu releases then it likely would be fixed in Ubuntu 18.04.4 too:

  https://ubuntu.com/download/desktop

If you just update Ubuntu 18.04 then you won't ever get the same newer kernel as comes with 18.04.4. So maybe the issue is already fixed-released via the HWE kernel. You should be able to try it by:

  sudo apt install linux-generic-hwe-18.04

Revision history for this message
GeckoEidechse (geckoeidechse) wrote :

Keychron K1v3 (firmware V3.7) on Ubuntu 19.10 (upgrad path from 18.04), can confirm that https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1814481/comments/19 fixes the issue when connected via Bluetooth.

Some additional information: For me when connected via Bluetooth only the function keys would work. The following command as described by Eferox, allowed me to use the keyboard normally:

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

Note that this means that the `fn` key is now disabled by default, so pressing one of the `F<num>` keys registers as `F1`, `F2`, etc. In order to get the media key functions you have to press `fn` + `F<num>`. Also note that if you also use an Apple keyboard this probably modifies its default behaviour.

Explanation of parameters for `/sys/module/hid_apple/parameters/fnmode`
https://superuser.com/questions/79822/how-to-swap-the-fn-use-of-function-keys-on-an-apple-keyboard-in-linux

Revision history for this message
GeckoEidechse (geckoeidechse) wrote :

Additionally if you want to change the default `F<num>` key behaviour again, press and hold `fn + X + L` in that order for >3 seconds until the keyboard blinks red twice.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu Bionic):
status: New → Confirmed
Revision history for this message
Paul (fryfry377) wrote :

I was having the same issue on the Vissles 84 mech keyboard, but

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1814481/comments/19

mostly fixed it. F11 & F12 don't seem to be affected by the fix, they still act as multimedia volume keys regardless of whether I hold the fn key or not.

To clarify, my keyboard is also bluetooth but I use it wired due to hardware issues on the linux PC. I am a VERY recent Linux user. My problem was pretty much the same as OP: no fn keys, they only registered as multimedia even with the fn key held. No fix in BIOS. I used the same keyboard on a windows computer and it worked fine.

Anyway, thanks! Was nervous since I don't know too much about the command line yet, but it seems mostly fixed now.

Revision history for this message
kevin flynn (etothex23) wrote :

NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu

Keychron K1 keyboard

Bluetooth connection:
Loss of most chars, numbers and some symbols show.

Using: echo 'options hid_apple fnmode=0' | sudo tee /etc/modprobe.d/hid_apple.conf

fixes the issue

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.