1. 程式人生 > >Linux如何查看與/dev/input目錄下的event對應的設備

Linux如何查看與/dev/input目錄下的event對應的設備

http bar 分區 查看內存 form cal lan input -a

轉載:https://blog.csdn.net/cupidove/article/details/23122645

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

  1. 查看CPU信息:cat /proc/cpuinfo
  2. 查看內存信息:cat /proc/meminfo
  3. 查看USB設備:cat /proc/bus/usb/devices
  4. 查看鍵盤和鼠標:cat /proc/bus/input/devices
  5. 查看各分區使用情況:df
  6. 查看體系結構:busybox uname -a
  7. 查看中斷信息:cat /proc/interrupts

在上面的H:中可以看到對應的eventxx

Linux如何查看與/dev/input目錄下的event對應的設備