Explain EV in /proc/bus/input/devices data【转】
转自: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.
Explain EV in /proc/bus/input/devices data【转】的更多相关文章
- cannot open /proc/bus/usb/devices, No such file or directory
由于kernel config中没有打开对应的配置. make menuconfig 选择: Device Drivers ---> [*] USB support ---> [*] US ...
- linux下bus、devices和platform的基础模型
转自:http://blog.chinaunix.net/uid-20672257-id-3147337.html 一.kobject的定义:kobject是Linux2.6引入的设备管理机制,在内核 ...
- linux下bus、devices和platform的基础模型 【转】
转自:http://blog.chinaunix.net/uid-20672257-id-3147337.html 一.kobject的定义:kobject是Linux2.6引入的设备管理机制,在内核 ...
- 12、API - 输入设备(API - Input Devices)
学习目录:树莓派学习之路-GPIO Zero 官网地址:https://gpiozero.readthedocs.io/en/stable/api_input.html 环境:UbuntuMeta-1 ...
- Linux input子系统 io控制字段【转】
转自:http://www.cnblogs.com/leaven/archive/2011/02/12/1952793.html http://blog.csdn.net/guoshaobei/arc ...
- Linux Input子系统浅析(二)-- 模拟tp上报键值【转】
转自:https://blog.csdn.net/xiaopangzi313/article/details/52383226 版权声明:本文为博主原创文章,未经博主允许不得转载. https://b ...
- input上报流程分析【转】
转自:http://blog.chinaunix.net/uid-28320320-id-3389196.html .参考文章 [Andorid]input系统的事件处理 .源码分析 linux )查 ...
- linux input输入子系统应用分析
输入设备(如按键.键盘.触摸屏.鼠标等)是典型的字符设备,其一般的工作机理是底层在按键.触摸等动作发送时产生一个中断(或驱动通过timer定时查询),然后CPU通过SPI.I2 C或外部存储器总线读取 ...
- Input event驱动
Input event驱动 Linux 专门对输入设备. 键盘,鼠标,手柄,触摸屏.按键.封装一个类驱动. 主要统一与应用程序接口.这一类的设备结点都是在/dev/input/eventn( 0< ...
随机推荐
- 第一个spring,第一天。
陈志棚:界面跳转与框架 李天麟:游戏界面ui 徐侃:算法代码的设计 经过热烈的讨论后,我们各自在完成自己的任务.
- C++的OOP特性
内存模型和名称空间 存储持续性,作用域和链接性 C++有三种方案来存储数据 自动存储持续性:在函数定义中声明的变量,包括函数参数.在函数或代码块开始执行时创建.执行完函数或者代码块,内存自动释放. 静 ...
- c#程序阅读分析
using System; using System.Collections.Generic; using System.Text; namespace FindTheNumber { class P ...
- node之post提交上传
post文件上传 multer 中间件 在node中 express为了性能考虑采用按需加载的方式,引入各种中间件来完成需求, 平时解析post上传数据时候,是用body-parse.但这个中间件有缺 ...
- NGINX.conf配置文件支持pathinfo
# power by www.php.cn #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/e ...
- 利用powerful number求积性函数前缀和
好久没更博客了,先水一篇再说.其实这个做法应该算是杜教筛的一个拓展. powerful number的定义是每个质因子次数都 $\geq 2$ 的数.首先,$\leq n$ 的powerful num ...
- 主机 & 虚拟机 & 开发板 相互通信
@2018年7月10日 成功方法之一: 虚拟机设置为桥接模式,保证三者在同一网段,ping方式测试网络连通性OK
- git other-误删恢复等
修改未push的最后一次commit 如在commit后发现漏添加的文件或者commit message需要修改,则可以依次执行: git add FILE_UN_STAGED # 将未提交的文件添加 ...
- HTML5 文件API
filelist 表示文件对象的列表. <form name="upload"> <input type="file" name=" ...
- 标准误(Standard Error)
sklearn实战-乳腺癌细胞数据挖掘 https://study.163.com/course/introduction.htm?courseId=1005269003&utm_campai ...