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< ...
随机推荐
- C语言编程—自动生成四则运算升级版
#include<stdio.h> #include<time.h> struct fenshu { int fenzi; int fenmu; }Fenshu[]; int ...
- Beta阶段冲刺三
Beta阶段冲刺三 Task1:团队TSP 团队任务 预估时间 实际时间 完成日期 新增其他学院的爬虫 180 130 11.30 新增其他学院的数据库字段修改 180 160 12.1 新增其他学院 ...
- Alpha 冲刺六
团队成员 051601135 岳冠宇 051604103 陈思孝 031602629 刘意晗 031602248 郑智文 031602234 王淇 会议照片 今天没有进行站立式会议,由于团队内有些细节 ...
- 学习Java并发的课程
https://www.javaspecialists.eu/courses/concurrency.jsp http://www.jconcurrent.com/ javaConcurrentAni ...
- webpack打包使用
md创建文件夹 dir是遍历 如何安装node环境 首先下载安装包;安装好以后 使用cmd命令 建立一个新的文件夹(一定是英文的),然后cmd 命令中 cd 进入所安装的盘的地址. 在该文件夹下面 使 ...
- PGSQL 数据库备份练习
截图先 慢慢说 1. 简单使用方法 先用 之前的setx 命令设置环境变量. set path=%PATH% ---其实第一步没必要..... 跟人学的 setx PATH "%path%& ...
- 常用的cpl 命令 运行直接打开控制台的简单方法
转载百度百科 工作中处理 windows机器 有时候 打开 网路修改ip地址特别繁琐,所以找了下 快速打开一些简单的控制台 能提高工作效率. (Control Panel extension) ...
- flask再学习-重构!启动!
1.打造MVC框架: common/libs:放置一些功能公用的方法. common/models:放置ORM模型 config:配置文件属性 web/controllers:视图层,处理url和ap ...
- BZOJ2001 [Hnoi2010]City 城市建设 CDQ分治
2001: [Hnoi2010]City 城市建设 Time Limit: 20 Sec Memory Limit: 162 MB Description PS国是一个拥有诸多城市的大国,国王Lou ...
- mes平台的一些方法
1.打开的一个缓存的页面的代码 $.openPane({ "width":"1500px", "height":"1000 ...