[ltp] Re: T440s extra function keys

altary linux-thinkpad@linux-thinkpad.org
Wed, 4 Jun 2014 11:21:30 -0700 (PDT)

After some playing aroud with udev I found the solution.

You need to add the mapping scancode->keycode in '/lib/udev/hwdb.d/'
The syntax is KEYBOARD_KEY_<scan_code>=<keycode>

$sudo nano /lib/udev/hwdb.d/70-lenovo-extra-fn.hwdb
keyboard:name:ThinkPad Extra Buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*

After changing it you have to restart so the changes take effect. 
You can check if the database has been updated with `udevadm info
--export-db | grep KEYBOARD_KEY_`.

Apparently the keycodes can only be inputted by name. The full list can be
found here : '/usr/include/linux/input.h'. 
To use them you have to remove the 'KEY_' and lowercase it.

All the info on how to bind scancode using udev is from : 

View this message in context: http://linux-thinkpad.10952.n7.nabble.com/T440s-extra-function-keys-tp21061p21249.html
Sent from the Linux Thinkpad mailing list archive at Nabble.com.