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

It represent the bitmask for events supported by the device.

Sample of devices entry for a AT Keyboard:

I: Bus= Vendor= Product= Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input2
U: Uniq=
H: Handlers=sysrq kbd event2
B: PROP=
B: EV=
B: KEY= 500f f900d401 feffffdf ffefffff ffffffff fffffffe
B: MSC=
B: LED= 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: I => @id: id of the device (struct input_id)
Bus => id.bustype
Vendor => id.vendor
Product => id.product
Version => id.version
N => name of the device.
P => physical path to the device in the system hierarchy.
S => sysfs path.
U => unique identification code for the device (if device has it).
H => list of input handles associated with the device.
B => bitmaps
PROP => device properties and quirks.
EV => types of events supported by the device.
KEY => keys/buttons this device has.
MSC => miscellaneous events supported by the device.
LED => leds present on the device. Bitmasks As you know computers deal in binary, so: =
=
=
=
=
... 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. E.g. A = ,
B = ,
C = , Then if I have MYVAR = which is in binary this would check out: MYVAR & A == TRUE ( & => )
MYVAR & B == FALSE ( & => )
MYVAR & C == TRUE ( & => ) Thus my var has A and C. 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. So, if we say: A =
B =
C =
... And then target = ;
set_bit(A, target); => target ==
set_bit(C, target); => target == Decoding The value is a hexadecimal. As binary it gives us: 0x120013 == binary Numbered from right they are: <= offset ('s)
<= offset (counted from right)
<= binary Set bits are:
, , , , Then check input.h you find that they correspond to: EV_SYN (0x00)
EV_KEY (0x01)
EV_MSC (0x04)
EV_LED (0x11)
EV_REP (0x14) To check what they mean a quick introduction is given by kernel Documentation. * EV_SYN:
- Used as markers to separate events. Events may be separated in time or in
space, such as with the multitouch protocol. * EV_KEY:
- Used to describe state changes of keyboards, buttons, or other key-like
devices. * EV_MSC:
- Used to describe miscellaneous input data that do not fit into other types. * EV_LED:
- Used to turn LEDs on devices on and off. * EV_REP:
- Used for autorepeating devices. This, "EDIT 2 (continued):" in particular, might be of interest.

最新文章

  1. Android 手机卫士--弹出对话框
  2. Android 正则表达式
  3. java分别通过httpclient和HttpURLConnection获取图片验证码内容
  4. 【BZOJ】【1049】【HAOI2006】数字序列
  5. JAVA float double数据类型保留2位小数点5种方法
  6. interbase C++Builder 简单例子
  7. POJ 3279 Fliptile[二进制状压DP]
  8. Android特效专辑(七)——飞机升空特效,一键清理缓存,灵活运用动画会有不一样的感受
  9. atx-agent minicap、minitouch源码分析
  10. c#处理json数据最好的方式,没有之一。
  11. 【Eigen开源库】linux系统如何安装使用Eigen库
  12. Spring 事务传播行为实验
  13. 【转载】关于quartus ii软件中注释乱码问题的解决方法
  14. 使用minikube在本机测试kubernetes
  15. PHP简单模拟登录功能实例分享
  16. struts2漏洞S2-046修复解决方案
  17. Telnet命令参考手册
  18. JQuery.extend扩展实现同步post请求
  19. Necklace - CF613C
  20. 关于 web中 使用 java.net.URLEncoder.encode 要编码两次呢 , js的encodeURIComponent 同理

热门文章

  1. 软件工程之四则运算--Github
  2. RAC系统化学习
  3. ElasticSearch 2 (11) - 节点调优(ElasticSearch性能)
  4. SpringBoot 2.SpringBoot整合Mybatis
  5. Delphi 之 菜单组件(TMainMenu)
  6. 【BZOJ1967】[AHOI2005]穿越磁场(最短路)
  7. 【BZOJ4260】Codechef REBXOR (Trie树)
  8. 网络传输---HttpURLConnection
  9. 前端学习 -- Css -- 默认样式
  10. 未处理的异常 stack overflow