- udev
- Numlock
- Insert
- Battery
- Sleep
- Caps Lock and Num Lock
- F Keys on Ubuntu
- Keymap
- Firmware
- Fast reconnect bluetooth
- GitLab
This udev rule is credited to Emilio Coppa from the Facebook: Keychron User Group and was provided as GitHub Gist: ercoppa/80-keychron.rules.
- Create udev rule
sudo touch /etc/udev/rules.d/80-keychron.rules
- Add the udev rule
SUBSYSTEMS=="input", ATTRS{name}=="Keychron K2", RUN+="echo 0 | tee /sys/module/hid_apple/parameters/fnmode"
to/etc/udev/rules.d/80-keychron.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
An alternative solution was offered by Thạch Nguyễn.
- Set fkeyfirst by:
- create the conf file
sudo touch /etc/modprobe.d/hid_apple.conf
. - add this line to the file:
options hid_apple fnmode=2
and save sudo update-initramfs -u
reboot
- Use the keyboard in Windows/Android mode
If you get stuck in Numlock mode, double tap F6 to disable it.
Alternative way is to open onboard
and disable "NmLk" in there.
By default there is no Insert
key natively on the Keychron K2. But since firmware v1.6, fn
+ DEL will be interpreted as Insert
. Also it is possible to switch to permanent Insert
by pressing fn
+ I
+ D
(for 6 seconds).
The battery can report it's state via upower. If your distribution supports this you will be able to get a battery indicator on your desktop.
To check the keyboard is recognized type:
$ upower --dump | grep keyboard -A 7
You can get some GUI front-end to reflect the battery status, and different distributions often have them enabled by default. Examples include gnome-power-statistics
, mate-power-statistics
, Arch with Gnome has battery reporting working out of the box and in Ubuntu Settings ⇾ Power
it's also working.
The keyboard goes to Auto Sleep Mode in 10 mins of sitting idle to save battery.
Press fn
+ S
+ O
(for 3 seconds) to disable the Auto Sleep Mode. If you want to go back to the Auto Sleep Mode, press fn
+ S
+ O
(for 3 seconds) again. (Wait for the visual light confirmation.)
The Caps Lock key does not have an dedicated hardware indicator, but since firmware v1.37 you can press fn
+ Caps Lock
+ P
for 6 seconds and the Caps Lock key will no longer follow the backlight mode. Instead it will be used to indicate the status of capital/ small letters (with red LED).
There is also a Gnome Extension: Lock Keys that will show a Caps Lock and Num Lock indicator on the panel.
There is a discussion on Stackexchange regarding making the F Keys work.
Claus Zotter noticed the F1
⇾ F12
keys always act as though function
key is pressed.
Edit (create if it doesn't exist, it doesn't on 16.04) /etc/modprobe.d/hid_apple.conf
and add the line options hid_apple fnmode=2
followed by:
$ sudo update-initramfs -u && reboot
fnmode = 0 disable
fn
key fnmode = 1 function keys are used as last key fnmode = 2 function keys are used as first key
Reference:
- Claus Zotter Gist
- Andrii Shkodyn Gist who also noticed he does not get a bind action on Ubuntu 16.04 but that it was working as expected on 18.04. (Seems of no issue with 1.6 in 16.04)
If your Keymap appears to be incorrect make sure that /sys/module/hid_apple/parameters/fnmode
is set to 0
and not 1
.
Method of binding shift
+ delete
to insert
suggested by Konstantinos Liopetas.
$ xmodmap -pke | grep Delete
My Output was:
keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Separator
keycode 119 = Delete NoSymbol Delete NoSymbol Delete
So what I did was to add the following line on my ~/.bashrc
(to persist change on reboot)
xmodmap -e "keycode 119 = Delete Insert Delete NoSymbol Delete"
Reference: Ask Ubuntu
If you use Linux and Wayland (opposed to X11), you can't use X11 utilities such as xmodmap
. Here's a guide on how to customize a Keychron K2 when using the Sway window manager (with links to the original X11 documentation to customize keymappings).
When the keymap is changed to en-GB many characters useful for Linux administration and programming are hard to find.
The following is a list of the characters I have been able to locate on the changed keymap.
The \ ~
describes the key above enter on the Keychron K2.
The ` ~ describes the key above tab on the Keychron K2.
# = "` |"
| = AltGr + "` ~"
\ = AltGr + "\ |" (or alternatively AltGR + "- _")
Keychron are investigating Linux Vendor Firmware Service as a possible solution to delivering firmware on Linux, at present it is only possible to update the firmware via Windows.
Firmware 1.6 arrived with some new features, they are listed below but taken from the firmware update page.
- fn + Caps Lock + P -- Hold these three keys together for 6 seconds, the Caps Lock key will no longer follow the backlight mode, it will be used to indicate the status of capital/ small letters. This feature was included in the last firmware, but with bugs, this time we have fixed the bug for this feature.
- fn + L + light effect key (the light bulb key) -- Hold these three keys together for 6 seconds, it will lock the light effect you are using now. To unlock the light effect, press these three keys together for 6 seconds again. Please make sure to hold the fn and L key first then hold the light effect key.
- Under the no backlight circumstances, if you press the light effect key, the backlight will be turned on. (We add this because there are too many users send questions to us saying "my backlight is not working." "my keyboard's backlight has dead '', but the reason for it is they accidentally turned off the backlight and forgot to turn it back.
- fn + I + D -- By default, short press del to get del, press fn + del to get insert; Hold these three keys together for 6 seconds, the function of the del key will be reversed to insert. Then the short press the key to get insert, press fn key combination will get the del function. Hold these three keys together for 6 seconds again to change back to the default.
For faster reconnect need to set "FastConnectable" to true in /etc/bluetooth/main.conf
Мухаммад Алифф Муаззам also maintains a GitLab repository that is dedicated to tracking issues with the K2.