I use a Microsoft Natural Ergonomic Keyboard 4000 on Ubuntu 10.10. The multimedia keys (Volume, Play/Pause) work, the Mail and Calculator button as well.

Now I would love to use the zoom slider, if it were possible I'd like to use page scrolling with that. Is there some way to enable that?

link|improve this question

feedback

2 Answers

The problem is that evdev driver ignores keycodes > 255.
The solution, thanks to Marco Chiappero:

1) you have to define all the remappings that you need (in the form of 
"scancode keycode" list) and place them in a file under "/lib/udev/keymaps/" 
(for example I created logitech-lx710-cordless there). You can find the 
scancodes using evtest ("sudo evtest /dev/input/eventX", where X is your 
keyboard device. Be careful, sometimes these extra keys are exposed through 
a different device or your mouse interface: eg. event3 --> kbd, event4 --> 
mouse & extra keys). Here some sample output:

Event: time 1294153475.909379, type 4 (Misc), code 4 (ScanCode), value c1028
"c1028" is the scancode value you're going to place in your keymap file, then 
pick up a number from input.h as described earlier and convert it to 
hexadecimal. Then write the remap pair in your file, maybe with a descriptive 
comment, like this:

0xC1028 0x9a # rotate button

Iterate for every key > 255.

2) you have to tell udev to apply this remapping file everytime it encounters 
your keyboard, so edit the "/lib/udev/rules.d/95-keymap.rules" file adding 
the udev rule that matches your HW. Please don't ask me to define a rule for 
you. 
NOTE: you can immediately apply your keymap file by yourself typing 
"sudo /lib/udev/keymap /dev/input/eventX /lib/udev/keymaps/$YOUR_FILE" and 
verify it with evtest once again.

Now, you can use the Gnome shortcuts editor to see that the keys are now 
usable inside X and create new shortcuts. However it might happen that no 
keysym is assigned to that keycode (so you'll see 0xXY instead of XF86Foo). 
You can see current mappings through xmodmap -pke, save the output into a 
file and edit it if you need (a full keysym code list is available in
"/usr/lib/X11/XKeysymDB").
Once you added the keysyms to those keys you remapped, you can save this file
as ~/.Xmodmap (or as /etc/X11/Xmodmap if you wish to apply to every user).
link|improve this answer
I figures out that the buttons I want are c022d and c022e, but I cannot find the input.h. – queueoverflow Apr 24 '11 at 13:19
As I understand (but I can't test because I don't have this hardware) you don't really need input.h, you just need to edit this file: /lib/udev/rules.d/95-keymap.rules. (May be here at launchpad you can find people with the same hardware therefore more able to help bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/313514 ). Have you edited the file I mentioned above? – desgua Apr 24 '11 at 13:37
This is far too technical and disorganized an answer for most people. A few serious gaps: no help on determining the appropriate /dev/input/eventX, unclear steps mixed in with contextual information and requests not to ask for instructions for creating keymaps. – Alain O'Dea Aug 5 '11 at 0:16
evtest isn't even installed by default making this even worse. – Alain O'Dea Aug 5 '11 at 0:21
Through trial and error I found that my keyboard is /dev/input/event3 and evtest doesn't pick up any events from the zoom slider. – Alain O'Dea Aug 5 '11 at 0:26
show 1 more comment
feedback

On my machine, extra keys (HomePage, Search, Calc, etc.) and zoom input were sent though /dev/input/event5 whereas ordinary keys were sent through /dev/input/event4. Zoom key value agree with queueoverflow's.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.