Issue with F1-F12 Keys on Lenovo Keyboards
Many Lenovo keyboards implement Fn key functionality at the hardware level, requiring Windows drivers for mode switching between F1-F12 and special functions. This creates compatibility issues in Linux environments where these keys default to special functions.
Solution Implementation
The GitHub repository tp-compact-keyboard provides tools for certain Lenovo keyboard models including:
- Thinkpad Compact USB keyboard with Trackpoint (KU-1255)
- Lenovo Low Profile USB Keyboard (LXH-JME2209U)
- Bluetooth variants
Installation Steps
- Clone and build the utility:
git clone https://github.com/lentinj/tp-compact-keyboard
cd tp-compact-keyboard
make
sudo cp tp-compact-usb-keyboard /usr/local/bin/
- Identify the correct hidraw device:
ls /dev | grep hidraw
- Test the configuration:
sudo /usr/local/bin/tp-compact-usb-keyboard /dev/hidrawX # Replace X with your device number
Persistent Configuration via Udev
Create a rules file at /etc/udev/rules.d/99-keyboard.rules:
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="6018", RUN+="/usr/local/bin/tp-compact-usb-keyboard %E{DEVNAME}"
Verify you're keyboard's vendor and product IDs with:
lsusb
Apply the new rules:
sudo udevadm control --reload-rules
sudo udevadm trigger
This configuration ensures the keyboard automatically switches to F1-F12 mode when connected.