Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  28] [ 0]  / answers: 1 / hits: 14375  / 3 Years ago, wed, october 13, 2021, 2:19:30

I tried to use this tutorial to make scroll switch work on my Microsoft Natural Ergonomic Keyboard 4000. But I face following error:



sudo: /lib/udev/keymap: command not found


I have udev version 204-5ubuntu20.2 (the version found in Trusty)



I noticed that this version doesn't include keymap tool. But I notices that greater udev versions (which available for Debian, for example) include this tool.



Could somebody explain this diff for me? =) And what should I do in this case - install package from Debian repo?


More From » 14.04

 Answers
3

If you look at /lib/udev/rules.d/60-keyboard.rules you'll see that everything has been messed around with. This is just part of the udev merger into systemd that has gone on.



All hardware rules are compiled into a binary hardware database. These follow a really strange format. The existing rules for keyboards that ship with udev live in /lib/udev/hwdb.d/60-keyboard.hwdb. Look at that but don't edit it (updates will probably overwrite it).



To add your custom rules, we'll create a new file in /etc/udev/hwdb.d/ by running sudoedit /etc/udev/hwdb.d/61-keyboard-local.hwdb. All you need to do is paste in the following -



If you are using the 4000 model:



keyboard:usb:v045Ep00DB*
KEYBOARD_KEY_0c022d=pageup
KEYBOARD_KEY_0c022e=pagedown


If you are using 7000 model:



keyboard:usb:v045Ep071D*
KEYBOARD_KEY_0c022d=pageup
KEYBOARD_KEY_0c022e=pagedown


This is adapated from the tutorial you posted so you might need to tweak based on your keyboard. Look at lsusb and make sure the vendor:product code above (as v####p####) is correct. It won't work if they don't match.



Once you're done editing, recompile the hwdb that udev uses:



sudo udevadm hwdb --update


And then you might need to re-plug. If it's a PS/2 keyboard you might need to reboot. In some cases you also need to reboot.


[#25019] Wednesday, October 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arkcker

Total Points: 296
Total Questions: 111
Total Answers: 104

Location: Nepal
Member since Tue, Sep 8, 2020
4 Years ago
arkcker questions
Tue, Aug 17, 21, 00:08, 3 Years ago
Sun, May 14, 23, 01:04, 1 Year ago
Wed, Nov 16, 22, 03:12, 1 Year ago
Tue, Jun 1, 21, 01:29, 3 Years ago
;