-   Linux - General (
-   -   Custom hwdb key mappings not working after Debian upgrade to stretch (

pinyaka 06-07-2016 01:07 PM

Custom hwdb key mappings not working after Debian upgrade to stretch
I use custom hwdb files to remap parts of my keyboards (MS Ergonomic and Logitech G600 mouse). After upgrading from Jessie to Stretch none of the customizations work. I'm going to focus on the MS Ergonomic keyboard here in the hopes that whatever fixes this will also fix the mouse. The mouse has a much longer configuration.

I cannot use Xmodmap instead (the mappings don't persist in virtual environments).

My hwdb file: 71-MSErgonomic.hwdb


The system definitions for the same keyboard does load.
From /lib/udev/hwdb.d/60-keyboard.hwdb

# Microsoft Natural Ergonomic Keyboard 4000

I have tried rebuilding the hwdb

udevadm hwdb --update
udevadm control --reload
udevadm trigger

followed by unplugging/plugging the device, rebooting computer, etc. and my keycodes are never used. I have verified that /etc/udev/hwdb.bin changes when I do the rebuild.

Other udevadm info (showing the successful mapping from 60-keyboard.hwdb):

/sys #udevadm --debug test-builtin keyboard /devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.1/0003:045E:00DB.0011/input/input30/event1
calling: test-builtin
=== trie on-disk ===
tool version: 230
file size: 7177792 bytes
header size 80 bytes
strings 1790456 bytes
nodes 5387256 bytes
Load module index
Found container virtualization none
timestamp of '/etc/systemd/network' changed
timestamp of '/lib/systemd/network' changed
Parsed configuration file /lib/systemd/network/
Created link configuration context.
keyboard: mapping scan code 786989 (0xc022d) to key code 418 (0x1a2)
keyboard: mapping scan code 786990 (0xc022e) to key code 419 (0x1a3)
Unload module index
Unloaded link configuration context.

pinyaka 06-07-2016 02:54 PM

Okay, I fixed it myself.

The problem was wrong bus designation. Even though the 60-keyboard specifies bus 3 (and indeed /usr/include/linux/input.h specifies that usb devices should be on 0x03), the keyboard and mouse keyboard were actually on bus 1.

In 71-MSErgonomic.hwdb I changed


I did the same for my mouse's hwdb file. Afterwards, I ran the code above to rebuild, reload and trigger the hwdb and everything is working as expected. There is a current bug report for the documentation already submitted.

All times are GMT -5. The time now is 09:47 PM.