Linux如何查看与/dev/input目录下的event对应的设备

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

1. /dev/input目录

    /dev/input目录下的事件都是在驱动中调用input_register_device(struct input_dev *dev)产生的。如我的盒子的/dev/input目录的内容如下:

crw-rw---- root     input     1364 1970-01-01 08:00 event0crw-rw---- root     input     1365 1970-01-01 08:00 event1crw-rw---- root     input     1366 1970-01-01 08:00 event2crw-rw---- root     input     1367 1970-01-01 08:00 event3crw-rw---- root     input     1368 1970-01-01 08:00 event4crw-rw---- root     input     1369 1970-01-01 08:00 event5crw-rw---- root     input     1370 2013-08-30 09:56 event6

    每个event将上报指定的事件,如G-Sensor、触摸屏、Mouse、按键等。

2. 与event对应的设备信息

     与event对应的相关设备信息位于/proc/bus/input/devices,例子如下:

root@android:/ # cat /proc/bus/input/devicescat /proc/bus/input/devicesI: Bus=0019 Vendor=0001 Product=0001 Version=0100N: Name="rk29-keypad"P: Phys=gpio-keys/input0S: Sysfs=/devices/platform/rk29-keypad/input/input0U: Uniq=H: Handlers=kbd event0 keychordB: PROP=0B: EV=3B: KEY=8000 100000 0 0 0I: Bus=0019 Vendor=0001 Product=0001 Version=0100N: Name="rkxx-remotectl"P: Phys=gpio-keys/input0S: Sysfs=/devices/platform/rkxx-remotectl/input/input1U: Uniq=H: Handlers=kbd event1 keychordB: PROP=0B: EV=3B: KEY=c 70110 260000 0 0 0 20100 2000000 7800000 4000a800 1e16c0 19 78000000 10006ffcI: Bus=0003 Vendor=0c45 Product=1109 Version=0100N: Name="coocaa Device coocaa Wireless Device"P: Phys=usb-usb20_host-1.3/input2S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.2/input/input2U: Uniq=H: Handlers=sysrq kbd event2 keychordB: PROP=0B: EV=12001bB: KEY=10000 7 ff800000 7ff febeffdf ffefffff ffffffff fffffffeB: ABS=700 0B: MSC=10B: LED=1fI: Bus=0003 Vendor=0c45 Product=1109 Version=0100N: Name="coocaa Device coocaa Wireless Device"P: Phys=usb-usb20_host-1.3/input3S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.3/input/input3U: Uniq=H: Handlers=sysrq kbd event3 keychordB: PROP=0B: EV=12001fB: KEY=4837fff 72ff32d bf544446 0 0 1 30f90 8b17c007 ffe77bfa d941dfff febeffdf ffefffff ffffffff fffffffeB: REL=40B: ABS=ffffff01 0B: MSC=10B: LED=1fI: Bus=0003 Vendor=0c45 Product=1109 Version=0100N: Name="coocaa Device coocaa Wireless Device"P: Phys=usb-usb20_host-1.3/input4S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.4/input/input4U: Uniq=H: Handlers=event4B: PROP=0B: EV=17B: KEY=1f0000 0 0 0 0 0 0 0 0B: REL=103B: MSC=10I: Bus=0003 Vendor=0c45 Product=1109 Version=0100N: Name="coocaa Device coocaa Wireless Device"P: Phys=usb-usb20_host-1.3/input5S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.5/input/input5U: Uniq=H: Handlers=sysrq kbd event5 keychordB: PROP=0B: EV=12001fB: KEY=4837fff 72ff32d bf544446 0 0 1 30f90 8b17c007 ffff7bfa d941dfff febeffdf ffefffff ffffffff fffffffeB: REL=40B: ABS=1 0B: MSC=10B: LED=1fI: Bus=0003 Vendor=093a Product=2510 Version=0111N: Name="PixArt USB Optical Mouse"P: Phys=usb-usb20_host-1.2.4/input0S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.2/2-1.2.4/2-1.2.4:1.0/input/input7U: Uniq=H: Handlers=event6B: PROP=0B: EV=17B: KEY=70000 0 0 0 0 0 0 0 0B: REL=103B: MSC=10


    在上面的H:中可以看到对应的eventxx。














    

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
这里写图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值