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< ...
随机推荐
- TAC队--团队选题报告
The Art of Code--团队选题报告 一个APP项目能否被大众所接受,能否拥有受众,the most important是它的idea. 一个好的idea可以为项目带来巨大的改变 一个 独特 ...
- C++学习记录(留坑)
#include <iostream> #include <ctime> #include <fstream> ///文件打开有o.i权限 #include < ...
- Windows 设置开机自动登录
1. 自己一些windows的虚拟机 有时候开机之后 输入用户名密码时间特别长. 需要等待很久, 如果能够设置开机自动登录的话 能够节约很多时间. 2. 最简单的办法 运行输入 control us ...
- [转帖]Kubernetes及容器编排的总体介绍【译】
Kubernetes及容器编排的总体介绍[译] 翻译自The New Stack<Kubernetes 生态环境>作者:JANAKIRAM MSV和 KRISHNAN SUBRAMANIA ...
- teamviewer & commercial-use
teamviewer & commercial-use https://www.teamviewer.com/zhCN/pricing/commercial-use/ https://www. ...
- 淘宝卖家搜索器V1.6算法注册机。
该软件的算法非常简单,适合小白练手.(E语言写的)1.OD加载该软件,输入bp MessageBoxA 2.点击注册 3.OD就会中断下来了 4.按ALT+K打开调用堆栈 5.往上翻,就来到算法处了 ...
- 【刷题】LOJ 6226 「网络流 24 题」骑士共存问题
题目描述 在一个 \(\text{n} \times \text{n}\) 个方格的国际象棋棋盘上,马(骑士)可以攻击的棋盘方格如图所示.棋盘上某些方格设置了障碍,骑士不得进入. 对于给定的 \(\t ...
- 【刷题】LOJ 6002 「网络流 24 题」最小路径覆盖
题目描述 给定有向图 \(G = (V, E)\) .设 \(P\) 是 \(G\) 的一个简单路(顶点不相交)的集合.如果 \(V\) 中每个顶点恰好在 \(P\) 的一条路上,则称 \(P\) 是 ...
- Elastic-Job-Lite 源码分析 —— 运维平台
本文基于 Elastic-Job V2.1.5 版本分享 1. 概述 2. Maven模块 elastic-job-common-restful 3. Maven模块 elastic-job-cons ...
- HGOI 20181030晚 题解
Problem:给出全班人的个数总分和小明的分数(满分100分),求小明最低排名和最高排名 sol:假设小明的排名为k,总分为sum,小明的分数是r, 贪心求解, 最坏情况下,小明前面的比小明高一分( ...