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< ...
随机推荐
- 在 IntelliJ IDEA 中配置 Spark(Java API) 运行环境
1. 新建Maven项目 初始Maven项目完成后,初始的配置(pom.xml)如下: 2. 配置Maven 向项目里新建Spark Core库 <?xml version="1.0& ...
- 高效获取网页源码COM
目前获取网页源码有几种方法: 1.WebClient下载页面2.HttpWebRequest发请求获取3.com组件xmlhttp获取 三者比较:WebClient代码最少,效率最慢:xmlhttp代 ...
- JDBC学习笔记——PreparedStatement的使用
PreparedStatement public interface PreparedStatement extends Statement;可以看到PreparedStatement是Stateme ...
- Mac安装Appium的Android环境
1.下载android sdk http://down.tech.sina.com.cn/page/45703.html 2.解压,配置环境变量 ANDROID_HOME=/Users/wp/ ...
- 联想一体机怎么设置u盘启动|联想一体机bios改U盘启动方法(转)
本文转自:http://www.xitongcheng.com/jiaocheng/xtazjc_article_29090.html 所需工具: 1.联想Lenovo品牌一体机 2.启动U盘:大白菜 ...
- [转帖]ESXi 网卡绑定 增加吞吐量的方法
VMware ESX 5.0 网卡负载均衡配置3种方法 http://blog.chinaunix.net/uid-186064-id-3984942.html (1) 基于端口的负载均衡 (Rout ...
- DevExpress15.2+VS2015 破解、汉化
破解 下载有效的激活工具DEV15.X在VS2015 (亲测),地址 http://download.csdn.net/download/u011149525/9581176 解压后的注册说明: 感谢 ...
- Java NIO 详解(二)
异步IO 异步 I/O 是一种没有阻塞地读写数据的方法.通常,在代码进行 read() 调用时,代码会阻塞直至有可供读取的数据.同样, write()调用将会阻塞直至数据能够写入,关于同步的IO请参考 ...
- 知识点【JavaScript模块化】
JavaScript模块化历程 JavaScript发展变迁大概是一下几个步骤: 工具(浏览器兼容) 组件(功能模块) 框架(功能模块组织) 应用(业务模块组织) 但是经过了长长的后天努力过程Java ...
- 【题解】 bzoj1864: [Zjoi2006]三色二叉树 (动态规划)
bzoj1864,懒得复制,戳我戳我 Solution: 其实想出来了\(dp\)方程推出来了最大值,一直没想到推最小值 \(dp[i][1/0]\)表示\(i\)号节点的子树中的绿色染色最大值,\( ...