LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Custom hwdb key mappings not working after Debian upgrade to stretch (https://www.linuxquestions.org/questions/linux-general-1/custom-hwdb-key-mappings-not-working-after-debian-upgrade-to-stretch-4175581686/)

pinyaka 06-07-2016 02: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
Code:

evdev:input:b003v045Ep00DB*
 KEYBOARD_KEY_70039=leftctrl
 KEYBOARD_KEY_700e0=capslock

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

# Microsoft Natural Ergonomic Keyboard 4000
evdev:input:b0003v045Ep00DB*
 KEYBOARD_KEY_c022d=zoomin
 KEYBOARD_KEY_c022e=zoomout

I have tried rebuilding the hwdb
Code:

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):
Quote:

/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/99-default.link
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 03: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
Quote:

evdev:input:b0003v045Ep00DB*
to
Quote:

evdev:input:b*v045Ep00DB*
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 01:17 AM.