To be honest, this is not true scrolling, I'm mapping the zoom in and out to page up and down. Those buttons already exist, so some might think it redundant, but I find that the zoom slider is nicely placed in the middle of the keyboard, so it works for me. Also, you could, using this method, map it to just about any function.
The changes that have been made in Linux, in particular, the integration of systemd and udev, means that a lot of the older solutions you might find do not work. The keymap command no longer exists, for example.
- Create a file: /etc/udev/hwdb.d/61-keyboard-local.hwdb
- Paste the following text (exclude the "1."):
- # Microsoft Natural Ergonomic Keyboard 4000
keyboard:usb:v045Ep00DB*
KEYBOARD_KEY_c022d=pageup
KEYBOARD_KEY_c022e=pagedown - In terminal, rebuild the HW DB index: sudo udevadm hwdb --update
- Reboot
- Your zoom in/out slider should now function as page up/down.
In case anyone is interested in how I came to this...
The reason I didn't need to fiddle about with evtest and event numbers etc, is that the work has already been done. If you look in /lib/udev/hwdb.d/60-keyboard.hwdb, there is already an entry for this keyboard, and for these keys:
# Microsoft Natural Ergonomic Keyboard 4000Now, you could just change it in that file, but that means that it will stop working if it is updated, better to add a separate file. So all that is needed is a hwdb file with a higher index (under etc rather than lib, to keep it separate). The point is that we can use the syntax, including VID, PID, and keycodes, in our new config file.
keyboard:usb:v045Ep00DB*
KEYBOARD_KEY_c022d=zoomin
KEYBOARD_KEY_c022e=zoomout
As I said in the beginning, you could map them to pretty much anything you like. I tried, but did not get scroll up/down to work for some reason... Anyway, if you feel like trying other things, here is a link to the list of key-mappings that you could use to map it to.
No comments:
Post a Comment