I recently acquired a Keychron K3 and decided to switch to a macOS French keyboard layout so I could maintain my macOS habits while using Linux.
All keys work except for the < and > keys.
Under X.org, it would be easy, using xmodmap
xmodmap -e "keycode 115 = less greater bar brokenbar"
Unfortunately, xmodmap
doesn't work directly with Wayland. I found inspiration in this post.
I installed evtest
and evemu-tools
sudo apt install evtest evemu-tools
Then I had a look of evtest
sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
.....
/dev/input/event17: HDA Intel PCH HDMI/DP,pcm=9
/dev/input/event18: Keychron K3
Select the device event number [0-22]: 18
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x5ac product 0x24f version 0x11b
Input device name: "Keychron K3"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Keychron K3 report like this in Bluetooth : Input device ID: bus 0x5 vendor 0x5ac product 0x24f version 0x11b
Let's create a new udev rule, /etc/udev/hwdb.d/99-keychronk3.hwdb
#
# Keychron K3
#
# Input device ID: bus 0x5 vendor 0x5ac product 0x24f version 0x11b
#
evdev:input:
b0005v05ACp024F*
Kused EYBOARD a_KEY_700=(*) so
b0005v05ACp024F* correspond to device ID, bus 0005, vendor 05AC, product 024F. I used a wilcard (*) so to rule would works in Bluetooth and USB mode
Then I restarted HDB to have hardware db updated
sudo systemd-hwdb update
sudo udevadm trigger
And voila, < and > are now available