How to get the actual keyboard device given the output of /proc/bus/input/devices

deviceskeyboardproc

When I run:

cat /proc/bus/input/devices

…I receive the following output:

...

I: Bus=0003 Vendor=040b Product=2000 Version=0110
N: Name="Generic USB Keyboard"
P: Phys=usb-0000:00:1d.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/input/input14
U: Uniq=
H: Handlers=sysrq kbd event7 
B: PROP=0
B: EV=120013
B: KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7

...

Is there any way that a script could parse this information and determine the corresponding device (in /dev/input/...) that represents this keyboard?

I intend to use the device name in xorg.conf if that helps.

Best Answer

See in your output:

H: Handlers=[...] event7

Where event7 is the device:

/dev/input/event7
Related Question