Background: I got the Microsoft Natural Ergonomic Keyboard 4000 and several keys are not working at all under Ubuntu such as the F1-F10 keys. I have Ubuntu 14.04.2 LTS running on my machine.
My solution:
I created the file /etc/udev/hwdb.d/61-keyboard-local.hwdb
and set up come custom rules:
keyboard:usb:v045ep00db*
KEYBOARD_KEY_0x1008ff27=pageup
KEYBOARD_KEY_0x1008ff26=pagedown
KEYBOARD_KEY_0xff6a=F1
KEYBOARD_KEY_0x1008ff6b=F5
I got the hex code through xev
. For instance, for the key which should be the F1 key, xev
returns
KeyRelease event, serial 37, synthetic NO, window 0x4400001,
root 0xa2, subw 0x0, time 1746028, (12,-12), root:(61,40),
state 0x10, keycode 146 (keysym 0xff6a, Help), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
After changing the file, I ran udevadm hwdb --update
and udevadm trigger
and, additionally, restarted my laptop.
Issue: The corresponding functionality is not assigned to the respective keys.
Best Answer
That one from
xev
is the key symbolkeysym
, here the idea:/keyboard/ →
scancode
→ /input driver/ →keycode
→ /X server XKB/ →keysym
man xev
says: xev - print contents of X eventsSo, what you are looking for is the early hardware data from keyboard which is the
scancode
. It can be found usingevtest
man evtest
evtest - Input device event monitor and query toolInstall it
Run
Output
Scancode is
3b