I upgraded to Debian Squeeze over the week-end and it broke my custom Xmodmap. While I was fixing it, I realized that the special keys of my Microsoft Natural keyboard that were not working under Lenny were now functionnal. The only piece missing was the "zoom" key. Here is how I got it to work.
I found on the askubuntu forum an solution to the same problem, that is missing the following details.
To find which keysym to map, I listed input devices:
$ ls /dev/input/by-id/ usb-Logitech_USB-PS.2_Optical_Mouse-mouse usb-Logitech_USB-PS_2_Optical_Mouse-mouse usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse usb-Microsoft_Natural??_Ergonomic_Keyboard_4000-event-kbd
then used evtest to find the keysym:
$ evtest /dev/input/by-id/usb-Microsoft*
then used udevadm to find the identifiers:
$ udevadm info --export-db | less
then edited /lib/udev/rules.d/95-keymap.rules to add:
ENV{ID_VENDOR}=="Microsoft", ENV{ID_MODEL_ID}=="00db", RUN+="keymap $name microsoft-natural-keyboard-4000"
in the section keyboard_usbcheck
and created the keymap file:
$ cat /lib/udev/keymaps/microsoft-natural-keyboard-4000 0xc022d pageup 0xc022e pagedown
then loaded the keymap:
$ /lib/udev/keymap /dev/input/by-id/usb-Microsoft_Natural®_Ergonomic_Keyboard_4000-event-kbd /lib/udev/keymaps/microsoft-natural-keyboard-4000
then used evtest again to check it was working.
Of course, you do not have to map the events to pageup and pagedown, but I found it convenient to use that key to scroll up and down pages.
Hope this helps :)
Comments
Nice work, thanks.
It would also help to indicate which of these steps need superuser and which do not.
Also it would be helpful if someone (not necessarily you) could write a complete description on one page how to get this keyboard working. After all, it is one of the most common ones in the world, and Squeeze is one of the main distributions, so thousands of people will need exactly that.
That would be good so people don't have to go to the linked askubuntu page where one guy writes "Please don't ask me to define a rule for you." Such arrogance is not helpful. That is not the fault of the guy here (logilab), but a 1-stop solution would be better.
Is this a solution only for a PC with one user? Because it says "my Xmodmap", indicating (non-root) regular user, but the steps look like they will change Xmodmap for every regular user.