how to detemine event file node belongs to which device
2015-05-20 11:29
232 查看
linux输入子系统,在驱动中注册register_input_device()时,会在
/dev/input/下生成节点,但是具体如何对应起来了,
这就可以看/proc/bus/input/devices这个文件呢,在这个文件中,
有个Handlers这个后面最后一个就是对应的处理器。
shell.albert@yantai:~> ls -l /dev/input/
total 0
drwxr-xr-x 2 root root 100 May 20 09:36 by-id
drwxr-xr-x 2 root root 240 May 20 09:36 by-path
crw------- 1 root root 13, 64 May 20 09:36 event0
crw------- 1 root root 13, 65 May 20 09:36 event1
crw------- 1 root root 13, 74 May 20 09:36 event10
crw------- 1 root root 13, 75 May 20 09:36 event11
crw------- 1 root root 13, 76 May 20 09:36 event12
crw------- 1 root root 13, 77 May 20 09:36 event13
crw------- 1 root root 13, 78 May 20 09:36 event14
crw------- 1 root root 13, 79 May 20 09:36 event15
crw------- 1 root root 13, 66 May 20 09:36 event2
crw------- 1 root root 13, 67 May 20 09:36 event3
crw------- 1 root root 13, 68 May 20 09:36 event4
crw------- 1 root root 13, 69 May 20 09:36 event5
crw------- 1 root root 13, 70 May 20 09:36 event6
crw------- 1 root root 13, 71 May 20 09:36 event7
crw------- 1 root root 13, 72 May 20 09:36 event8
crw------- 1 root root 13, 73 May 20 09:36 event9
crw------- 1 root root 13, 63 May 20 09:36 mice
crw------- 1 root root 13, 32 May 20 09:36 mouse0
crw------- 1 root root 13, 33 May 20 09:36 mouse1
crw------- 1 root root 13, 34 May 20 09:36 mouse2
shell.albert@yantai:~>
shell.albert@yantai:~> cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input0
U: Uniq=
H: Handlers=sysrq kbd event0
B: PROP=0
B: EV=120013
B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7
I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio4/input0
S: Sysfs=/devices/platform/i8042/serio4/input/input8
U: Uniq=
H: Handlers=mouse0 event1
B: PROP=9
B: EV=b
B: KEY=6420 30000 0 0 0 0
B: ABS=260800011000003
I: Bus=0003 Vendor=093a Product=2510 Version=0111
N: Name="PixArt USB Optical Mouse"
P: Phys=usb-0000:00:1d.0-2/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0/0003:093A:2510.0001/input/input10
U: Uniq=
H: Handlers=mouse1 event2
B: PROP=0
B: EV=17
B: KEY=70000 0 0 0 0
B: REL=103
B: MSC=10
I: Bus=0011 Vendor=0002 Product=000a Version=0000
N: Name="TPPS/2 IBM TrackPoint"
P: Phys=synaptics-pt/serio0/input0
S: Sysfs=/devices/platform/i8042/serio4/serio5/input/input9
U: Uniq=
H: Handlers=mouse2 event3
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3
I: Bus=0019 Vendor=0000 Product=0005 Version=0000
N: Name="Lid Switch"
P: Phys=PNP0C0D/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input11
U: Uniq=
H: Handlers=event4
B: PROP=0
B: EV=21
B: SW=1
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input12
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=3
B: KEY=10000000000000 0
I: Bus=0019 Vendor=0000 Product=0003 Version=0000
N: Name="Sleep Button"
P: Phys=PNP0C0E/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input13
U: Uniq=
H: Handlers=kbd event6
B: PROP=0
B: EV=3
B: KEY=4000 0 0
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input14
U: Uniq=
H: Handlers=kbd event7
B: PROP=0
B: EV=3
B: KEY=10000000000000 0
I: Bus=0019 Vendor=0000 Product=0006 Version=0000
N: Name="Video Bus"
P: Phys=LNXVIDEO/video/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/LNXVIDEO:00/input/input15
U: Uniq=
H: Handlers=kbd event8
B: PROP=0
B: EV=3
B: KEY=3e000b00000000 0 0 0
I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input16
U: Uniq=
H: Handlers=kbd event9
B: PROP=0
B: EV=40001
B: SND=6
I: Bus=0019 Vendor=17aa Product=5054 Version=4101
N: Name="ThinkPad Extra Buttons"
P: Phys=thinkpad_acpi/input0
S: Sysfs=/devices/platform/thinkpad_acpi/input/input17
U: Uniq=
H: Handlers=kbd event10 rfkill
B: PROP=0
B: EV=33
B: KEY=18040000 0 10000000000000 0 1501b02102004 c000080021104000 10e000000000000 0
B: MSC=10
B: SW=a
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA ATI HDMI HDMI/DP,pcm=3"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input18
U: Uniq=
H: Handlers=event11
B: PROP=0
B: EV=21
B: SW=140
I: Bus=0001 Vendor=10ec Product=0269 Version=0001
N: Name="HDA Digital PCBeep"
P: Phys=card0/codec#0/beep0
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/hdaudioC0D0/input19
U: Uniq=
H: Handlers=kbd event12
B: PROP=0
B: EV=40001
B: SND=6
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input20
U: Uniq=
H: Handlers=event13
B: PROP=0
B: EV=21
B: SW=10
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input21
U: Uniq=
H: Handlers=event14
B: PROP=0
B: EV=21
B: SW=4
I: Bus=0003 Vendor=17ef Product=4815 Version=1015
N: Name="Integrated Camera"
P: Phys=usb-0000:00:1d.7-6/button
S: Sysfs=/devices/pci0000:00/0000:00:1d.7/usb2/2-6/2-6:1.0/input/input22
U: Uniq=
H: Handlers=kbd event15
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0
shell.albert@yantai:~>
/dev/input/下生成节点,但是具体如何对应起来了,
这就可以看/proc/bus/input/devices这个文件呢,在这个文件中,
有个Handlers这个后面最后一个就是对应的处理器。
shell.albert@yantai:~> ls -l /dev/input/
total 0
drwxr-xr-x 2 root root 100 May 20 09:36 by-id
drwxr-xr-x 2 root root 240 May 20 09:36 by-path
crw------- 1 root root 13, 64 May 20 09:36 event0
crw------- 1 root root 13, 65 May 20 09:36 event1
crw------- 1 root root 13, 74 May 20 09:36 event10
crw------- 1 root root 13, 75 May 20 09:36 event11
crw------- 1 root root 13, 76 May 20 09:36 event12
crw------- 1 root root 13, 77 May 20 09:36 event13
crw------- 1 root root 13, 78 May 20 09:36 event14
crw------- 1 root root 13, 79 May 20 09:36 event15
crw------- 1 root root 13, 66 May 20 09:36 event2
crw------- 1 root root 13, 67 May 20 09:36 event3
crw------- 1 root root 13, 68 May 20 09:36 event4
crw------- 1 root root 13, 69 May 20 09:36 event5
crw------- 1 root root 13, 70 May 20 09:36 event6
crw------- 1 root root 13, 71 May 20 09:36 event7
crw------- 1 root root 13, 72 May 20 09:36 event8
crw------- 1 root root 13, 73 May 20 09:36 event9
crw------- 1 root root 13, 63 May 20 09:36 mice
crw------- 1 root root 13, 32 May 20 09:36 mouse0
crw------- 1 root root 13, 33 May 20 09:36 mouse1
crw------- 1 root root 13, 34 May 20 09:36 mouse2
shell.albert@yantai:~>
shell.albert@yantai:~> cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input0
U: Uniq=
H: Handlers=sysrq kbd event0
B: PROP=0
B: EV=120013
B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7
I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio4/input0
S: Sysfs=/devices/platform/i8042/serio4/input/input8
U: Uniq=
H: Handlers=mouse0 event1
B: PROP=9
B: EV=b
B: KEY=6420 30000 0 0 0 0
B: ABS=260800011000003
I: Bus=0003 Vendor=093a Product=2510 Version=0111
N: Name="PixArt USB Optical Mouse"
P: Phys=usb-0000:00:1d.0-2/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0/0003:093A:2510.0001/input/input10
U: Uniq=
H: Handlers=mouse1 event2
B: PROP=0
B: EV=17
B: KEY=70000 0 0 0 0
B: REL=103
B: MSC=10
I: Bus=0011 Vendor=0002 Product=000a Version=0000
N: Name="TPPS/2 IBM TrackPoint"
P: Phys=synaptics-pt/serio0/input0
S: Sysfs=/devices/platform/i8042/serio4/serio5/input/input9
U: Uniq=
H: Handlers=mouse2 event3
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3
I: Bus=0019 Vendor=0000 Product=0005 Version=0000
N: Name="Lid Switch"
P: Phys=PNP0C0D/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input11
U: Uniq=
H: Handlers=event4
B: PROP=0
B: EV=21
B: SW=1
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input12
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=3
B: KEY=10000000000000 0
I: Bus=0019 Vendor=0000 Product=0003 Version=0000
N: Name="Sleep Button"
P: Phys=PNP0C0E/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input13
U: Uniq=
H: Handlers=kbd event6
B: PROP=0
B: EV=3
B: KEY=4000 0 0
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input14
U: Uniq=
H: Handlers=kbd event7
B: PROP=0
B: EV=3
B: KEY=10000000000000 0
I: Bus=0019 Vendor=0000 Product=0006 Version=0000
N: Name="Video Bus"
P: Phys=LNXVIDEO/video/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/LNXVIDEO:00/input/input15
U: Uniq=
H: Handlers=kbd event8
B: PROP=0
B: EV=3
B: KEY=3e000b00000000 0 0 0
I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input16
U: Uniq=
H: Handlers=kbd event9
B: PROP=0
B: EV=40001
B: SND=6
I: Bus=0019 Vendor=17aa Product=5054 Version=4101
N: Name="ThinkPad Extra Buttons"
P: Phys=thinkpad_acpi/input0
S: Sysfs=/devices/platform/thinkpad_acpi/input/input17
U: Uniq=
H: Handlers=kbd event10 rfkill
B: PROP=0
B: EV=33
B: KEY=18040000 0 10000000000000 0 1501b02102004 c000080021104000 10e000000000000 0
B: MSC=10
B: SW=a
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA ATI HDMI HDMI/DP,pcm=3"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input18
U: Uniq=
H: Handlers=event11
B: PROP=0
B: EV=21
B: SW=140
I: Bus=0001 Vendor=10ec Product=0269 Version=0001
N: Name="HDA Digital PCBeep"
P: Phys=card0/codec#0/beep0
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/hdaudioC0D0/input19
U: Uniq=
H: Handlers=kbd event12
B: PROP=0
B: EV=40001
B: SND=6
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input20
U: Uniq=
H: Handlers=event13
B: PROP=0
B: EV=21
B: SW=10
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input21
U: Uniq=
H: Handlers=event14
B: PROP=0
B: EV=21
B: SW=4
I: Bus=0003 Vendor=17ef Product=4815 Version=1015
N: Name="Integrated Camera"
P: Phys=usb-0000:00:1d.7-6/button
S: Sysfs=/devices/pci0000:00/0000:00:1d.7/usb2/2-6/2-6:1.0/input/input22
U: Uniq=
H: Handlers=kbd event15
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0
shell.albert@yantai:~>
相关文章推荐
- How to solve DevStack error “Exception Value: /usr/bin/env: node: No such file or directory”
- how to delete .tmp file in server which is created during file upload
- How to Check Device UUID or File System UUID. (文档 ID 1505398.1)
- How to add the selinux policy access for the new created linux file node.
- How to unzip a zip file which include a folder into a folder
- How to roll back/cherry-pick a specific file to a node you want?
- How to find the file which contain a specified string
- SAP Skill - How to search a field for which table it belongs
- How to Recover Datafile Which Deleted Accidentally in Linux
- How to reference JSF managed beans which are provided in a JAR file?
- how to get device node name such as /dev/ttyS1.
- Openvms-C-Sourcecode- How to Find which Processes are using a specific pagefile or swapfile
- How to create a sysfs file node
- How to Distinguish a Physical Disk Device from an Event Message
- How to download a file with Node.js?
- How to download a file with Node.js?
- How to Check Device UUID or File System UUID. (文档 ID 1505398.1)
- Assembly to Type Library 之 Exported Member Conversion(Describes how export process converts methods, properties,event)
- How to get a handle to a device driver returned by device manager?
- how to unzip split file