[ltp] Re: thinkpad-acpi: inputdevice

Tino Keitel linux-thinkpad@linux-thinkpad.org
Wed, 25 Jul 2007 18:41:27 +0200


On Wed, Jul 25, 2007 at 18:07:26 +0200, Peter Jordan wrote:
> Tino Keitel, 07/25/07 17:16:
> 
> > On Wed, Jul 25, 2007 at 14:38:53 +0200, Peter Jordan wrote:
> > 
> > [...]
> > 
> >> thank you for responding, but i need the devnr for usage with input-kbd
> > 
> > I'm not sure what "devnr" is. Maybe lsinput has the information that
> > you are looking for.
> > 
> 
> devnr is the number of the event device eg devnr 6 for /dev/input/event6
> 
> and now i need to check out in a bash-script which event device is the
> device of thinkpad-acpi
> 
> thanks,

With the udev rule above, I get this directory layout:

$ ll /dev/input/by-id2/
total 0
lrwxrwxrwx 1 root root   9 Jul 25 09:10 - -> ../event1
drwxr-xr-x 2 root root 140 Jul 25 09:10 .
drwxr-xr-x 5 root root 340 Jul 25 09:10 ..
lrwxrwxrwx 1 root root   9 Jul 25 09:10 046d-c03d -> ../event6
lrwxrwxrwx 1 root root   9 Jul 25 09:10 04d9-1400 -> ../event5
lrwxrwxrwx 1 root root   9 Jul 25 09:10 05ac-1000 -> ../event2
lrwxrwxrwx 1 root root   9 Jul 25 09:10 0ccd-0038 -> ../event7

the "046d-c03d" is "vendorID-productID". As those don't change for a
device, the "readlink" command should give you the number of an event
device with a given vendor and device ID:

$ readlink /dev/input/by-id2/046d-c03d | sed "s/.*event//"
6

Regards,
Tino