转自:https://unix.stackexchange.com/questions/74903/explain-ev-in-proc-bus-input-devices-data

  1. It represent the bitmask for events supported by the device.
  2.  
  3. Sample of devices entry for a AT Keyboard:
  4.  
  5. I: Bus= Vendor= Product= Version=ab41
  6. N: Name="AT Translated Set 2 keyboard"
  7. P: Phys=isa0060/serio0/input0
  8. S: Sysfs=/devices/platform/i8042/serio0/input/input2
  9. U: Uniq=
  10. H: Handlers=sysrq kbd event2
  11. B: PROP=
  12. B: EV=
  13. B: KEY= 500f f900d401 feffffdf ffefffff ffffffff fffffffe
  14. B: MSC=
  15. B: LED=
  16.  
  17. The B in front stands for bitmap, N, P, S, U, H are simply first letter in corresponding name value and I is for ID. In ordered fashion:
  18.  
  19. I => @id: id of the device (struct input_id)
  20. Bus => id.bustype
  21. Vendor => id.vendor
  22. Product => id.product
  23. Version => id.version
  24. N => name of the device.
  25. P => physical path to the device in the system hierarchy.
  26. S => sysfs path.
  27. U => unique identification code for the device (if device has it).
  28. H => list of input handles associated with the device.
  29. B => bitmaps
  30. PROP => device properties and quirks.
  31. EV => types of events supported by the device.
  32. KEY => keys/buttons this device has.
  33. MSC => miscellaneous events supported by the device.
  34. LED => leds present on the device.
  35.  
  36. Bitmasks
  37.  
  38. As you know computers deal in binary, so:
  39.  
  40. =
  41. =
  42. =
  43. =
  44. =
  45. ...
  46.  
  47. So if i have a bitmap with value that one would hold bits and in other word one can give each number a name and check if they correspond to a value.
  48.  
  49. E.g.
  50.  
  51. A = ,
  52. B = ,
  53. C = ,
  54.  
  55. Then if I have MYVAR = which is in binary this would check out:
  56.  
  57. MYVAR & A == TRUE ( & => )
  58. MYVAR & B == FALSE ( & => )
  59. MYVAR & C == TRUE ( & => )
  60.  
  61. Thus my var has A and C.
  62.  
  63. The kernel uses a bit more sophisticated/complex way, and set bits by offset. One reason being that more bits then is available in one computer (CPU) integer is used. For example look at the KEY bitmap.
  64.  
  65. So, if we say:
  66.  
  67. A =
  68. B =
  69. C =
  70. ...
  71.  
  72. And then
  73.  
  74. target = ;
  75. set_bit(A, target); => target ==
  76. set_bit(C, target); => target ==
  77.  
  78. Decoding
  79.  
  80. The value is a hexadecimal. As binary it gives us:
  81.  
  82. 0x120013 == binary
  83.  
  84. Numbered from right they are:
  85.  
  86. <= offset ('s)
  87. <= offset (counted from right)
  88. <= binary
  89.  
  90. Set bits are:
  91. , , , ,
  92.  
  93. Then check input.h you find that they correspond to:
  94.  
  95. EV_SYN (0x00)
  96. EV_KEY (0x01)
  97. EV_MSC (0x04)
  98. EV_LED (0x11)
  99. EV_REP (0x14)
  100.  
  101. To check what they mean a quick introduction is given by kernel Documentation.
  102.  
  103. * EV_SYN:
  104. - Used as markers to separate events. Events may be separated in time or in
  105. space, such as with the multitouch protocol.
  106.  
  107. * EV_KEY:
  108. - Used to describe state changes of keyboards, buttons, or other key-like
  109. devices.
  110.  
  111. * EV_MSC:
  112. - Used to describe miscellaneous input data that do not fit into other types.
  113.  
  114. * EV_LED:
  115. - Used to turn LEDs on devices on and off.
  116.  
  117. * EV_REP:
  118. - Used for autorepeating devices.
  119.  
  120. This, "EDIT 2 (continued):" in particular, might be of interest.

Explain EV in /proc/bus/input/devices data【转】的更多相关文章

  1. cannot open /proc/bus/usb/devices, No such file or directory

    由于kernel config中没有打开对应的配置. make menuconfig 选择: Device Drivers ---> [*] USB support ---> [*] US ...

  2. linux下bus、devices和platform的基础模型

    转自:http://blog.chinaunix.net/uid-20672257-id-3147337.html 一.kobject的定义:kobject是Linux2.6引入的设备管理机制,在内核 ...

  3. linux下bus、devices和platform的基础模型 【转】

    转自:http://blog.chinaunix.net/uid-20672257-id-3147337.html 一.kobject的定义:kobject是Linux2.6引入的设备管理机制,在内核 ...

  4. 12、API - 输入设备(API - Input Devices)

    学习目录:树莓派学习之路-GPIO Zero 官网地址:https://gpiozero.readthedocs.io/en/stable/api_input.html 环境:UbuntuMeta-1 ...

  5. Linux input子系统 io控制字段【转】

    转自:http://www.cnblogs.com/leaven/archive/2011/02/12/1952793.html http://blog.csdn.net/guoshaobei/arc ...

  6. Linux Input子系统浅析(二)-- 模拟tp上报键值【转】

    转自:https://blog.csdn.net/xiaopangzi313/article/details/52383226 版权声明:本文为博主原创文章,未经博主允许不得转载. https://b ...

  7. input上报流程分析【转】

    转自:http://blog.chinaunix.net/uid-28320320-id-3389196.html .参考文章 [Andorid]input系统的事件处理 .源码分析 linux )查 ...

  8. linux input输入子系统应用分析

    输入设备(如按键.键盘.触摸屏.鼠标等)是典型的字符设备,其一般的工作机理是底层在按键.触摸等动作发送时产生一个中断(或驱动通过timer定时查询),然后CPU通过SPI.I2 C或外部存储器总线读取 ...

  9. Input event驱动

    Input event驱动 Linux 专门对输入设备. 键盘,鼠标,手柄,触摸屏.按键.封装一个类驱动. 主要统一与应用程序接口.这一类的设备结点都是在/dev/input/eventn( 0< ...

随机推荐

  1. 第一个spring,第一天。

    陈志棚:界面跳转与框架 李天麟:游戏界面ui 徐侃:算法代码的设计 经过热烈的讨论后,我们各自在完成自己的任务.

  2. C++的OOP特性

    内存模型和名称空间 存储持续性,作用域和链接性 C++有三种方案来存储数据 自动存储持续性:在函数定义中声明的变量,包括函数参数.在函数或代码块开始执行时创建.执行完函数或者代码块,内存自动释放. 静 ...

  3. c#程序阅读分析

    using System; using System.Collections.Generic; using System.Text; namespace FindTheNumber { class P ...

  4. node之post提交上传

    post文件上传 multer 中间件 在node中 express为了性能考虑采用按需加载的方式,引入各种中间件来完成需求, 平时解析post上传数据时候,是用body-parse.但这个中间件有缺 ...

  5. NGINX.conf配置文件支持pathinfo

    # power by www.php.cn #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/e ...

  6. 利用powerful number求积性函数前缀和

    好久没更博客了,先水一篇再说.其实这个做法应该算是杜教筛的一个拓展. powerful number的定义是每个质因子次数都 $\geq 2$ 的数.首先,$\leq n$ 的powerful num ...

  7. 主机 & 虚拟机 & 开发板 相互通信

    @2018年7月10日 成功方法之一: 虚拟机设置为桥接模式,保证三者在同一网段,ping方式测试网络连通性OK

  8. git other-误删恢复等

    修改未push的最后一次commit 如在commit后发现漏添加的文件或者commit message需要修改,则可以依次执行: git add FILE_UN_STAGED # 将未提交的文件添加 ...

  9. HTML5 文件API

    filelist 表示文件对象的列表. <form name="upload"> <input type="file" name=" ...

  10. 标准误(Standard Error)

    sklearn实战-乳腺癌细胞数据挖掘 https://study.163.com/course/introduction.htm?courseId=1005269003&utm_campai ...