linux event

1. /dev/input目录

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

  1. crw-rw---- root     input     13,  64 1970-01-01 08:00 event0    
  2. crw-rw---- root     input     13,  65 1970-01-01 08:00 event1    
  3. crw-rw---- root     input     13,  66 1970-01-01 08:00 event2    
  4. crw-rw---- root     input     13,  67 1970-01-01 08:00 event3    
  5. crw-rw---- root     input     13,  68 1970-01-01 08:00 event4    
  6. crw-rw---- root     input     13,  69 1970-01-01 08:00 event5    
  7. crw-rw---- root     input     13,  70 2013-08-30 09:56 event6    

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

2. 与event对应的设备信息

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

  1. root@android:/ # cat /proc/bus/input/devices    
  2. cat /proc/bus/input/devices    
  3. I: Bus=0019 Vendor=0001 Product=0001 Version=0100    
  4. N: Name="rk29-keypad"    
  5. P: Phys=gpio-keys/input0    
  6. S: Sysfs=/devices/platform/rk29-keypad/input/input0    
  7. U: Uniq=    
  8. H: Handlers=kbd event0 keychord    
  9. B: PROP=0    
  10. B: EV=3    
  11. B: KEY=8000 100000 0 0 0    
  12.     
  13. I: Bus=0019 Vendor=0001 Product=0001 Version=0100    
  14. N: Name="rkxx-remotectl"    
  15. P: Phys=gpio-keys/input0    
  16. S: Sysfs=/devices/platform/rkxx-remotectl/input/input1    
  17. U: Uniq=    
  18. H: <span style="color:#ff0000;">Handlers=kbd event1 keychord    
  19. </span>B: PROP=0    
  20. B: EV=3    
  21. B: KEY=c 70110 260000 0 0 0 20100 2000000 7800000 4000a800 1e16c0 19 78000000 10006ffc    
  22.     
  23. I: Bus=0003 Vendor=0c45 Product=1109 Version=0100    
  24. N: Name="coocaa Device coocaa Wireless Device"    
  25. P: Phys=usb-usb20_host-1.3/input2    
  26. S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.2/input/input2    
  27. U: Uniq=    
  28. H: Handlers=sysrq kbd event2 keychord    
  29. B: PROP=0    
  30. B: EV=12001b    
  31. B: KEY=10000 7 ff800000 7ff febeffdf ffefffff ffffffff fffffffe    
  32. B: ABS=700 0    
  33. B: MSC=10    
  34. B: LED=1f    
  35.     
  36. I: Bus=0003 Vendor=0c45 Product=1109 Version=0100    
  37. N: Name="coocaa Device coocaa Wireless Device"    
  38. P: Phys=usb-usb20_host-1.3/input3    
  39. S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.3/input/input3    
  40. U: Uniq=    
  41. H: <span style="color:#ff0000;">Handlers=sysrq kbd event3 keychord    
  42. </span>B: PROP=0    
  43. B: EV=12001f    
  44. B: KEY=4837fff 72ff32d bf544446 0 0 1 30f90 8b17c007 ffe77bfa d941dfff febeffdf ffefffff ffffffff fffffffe    
  45. B: REL=40    
  46. B: ABS=ffffff01 0    
  47. B: MSC=10    
  48. B: LED=1f    
  49.     
  50. I: Bus=0003 Vendor=0c45 Product=1109 Version=0100    
  51. N: Name="coocaa Device coocaa Wireless Device"    
  52. P: Phys=usb-usb20_host-1.3/input4    
  53. S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.4/input/input4    
  54. U: Uniq=    
  55. H: <span style="color:#ff0000;">Handlers=event4    
  56. </span>B: PROP=0    
  57. B: EV=17    
  58. B: KEY=1f0000 0 0 0 0 0 0 0 0    
  59. B: REL=103    
  60. B: MSC=10    
  61.     
  62. I: Bus=0003 Vendor=0c45 Product=1109 Version=0100    
  63. N: Name="coocaa Device coocaa Wireless Device"    
  64. P: Phys=usb-usb20_host-1.3/input5    
  65. S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.5/input/input5    
  66. U: Uniq=    
  67. H: <span style="color:#ff0000;">Handlers=sysrq kbd event5 keychord    
  68. </span>B: PROP=0    
  69. B: EV=12001f    
  70. B: KEY=4837fff 72ff32d bf544446 0 0 1 30f90 8b17c007 ffff7bfa d941dfff febeffdf ffefffff ffffffff fffffffe    
  71. B: REL=40    
  72. B: ABS=1 0    
  73. B: MSC=10    
  74. B: LED=1f    
  75.     
  76. I: Bus=0003 Vendor=093a Product=2510 Version=0111    
  77. N: Name="PixArt USB Optical Mouse"    
  78. P: Phys=usb-usb20_host-1.2.4/input0    
  79. S: Sysfs=/devices/platform/usb20_host/usb2/2-1/2-1.2/2-1.2.4/2-1.2.4:1.0/input/input7    
  80. U: Uniq=    
  81. H: <span style="color:#ff0000;">Handlers=event6 </span>   
  82. B: PROP=0    
  83. B: EV=17    
  84. B: KEY=70000 0 0 0 0 0 0 0 0    
  85. B: REL=103    
  86. B: MSC=10   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值