getevent中的 type,code,value
来源:互联网 发布:上海闵行区网络新村 编辑:程序博客网 时间:2024/06/06 10:44
RawEvent结构体数据,
1. RawEvent->type表示输入事件类型:
#define EV_SYN 0x00 //为结束标志
#define EV_KEY 0x01 //按键事件
#define EV_REL 0x02 //相对坐标,如光标移动,报告的是相对最后一次位置的偏移
#define EV_ABS 0x03 //绝对坐标 //如触摸屏和操纵杆,它们工作在绝对坐标系统
2. RawEvent->code表示数据类型:
#define ABS_MT_POSITION_X 0x35 //表示x坐标
#define ABS_MT_POSITION_Y 0x36 //表示y坐标
#define ABS_MT_TOUCH_MAJOR 0x30 //接触面的长轴。
#define ABS_MT_TOUCH_MINOR 0x31 //接触面的短轴,
#define ABS_MT_WIDTH_MAJOR 0x32 //接触工具的长轴
#define ABS_MT_WIDTH_MINOR 0x33 //接触工具的切面的短轴
#define ABS_MT_PRESSURE 0x 3a //接触工具对接触面的压力大小,可以用来代替上面的四个参数。
#define ABS_MT_ORIENTATION 0x34
#define ABS_MT_TRACKING_ID 0x39 //表示当前多少个手指触摸
3. RawEvent->value 表示数据的值
type, code, value的定义可参看kernel/include/linux/input.h
type如下定义
- /*
- * Event types
- */
- #define EV_SYN 0x00
- #define EV_KEY 0x01
- #define EV_REL 0x02
- #define EV_ABS 0x03
- #define EV_MSC 0x04
- #define EV_SW 0x05
- #define EV_LED 0x11
- #define EV_SND 0x12
- #define EV_REP 0x14
- #define EV_FF 0x15
- #define EV_PWR 0x16
- #define EV_FF_STATUS 0x17
- #define EV_MAX 0x1f
- #define EV_CNT (EV_MAX+1)
一般来说,常用的是EV_KEY, EV_REL, EV_ABS, EV_SYN
分别对应keyboard, 相对坐标, 绝对坐标, 同步事件
EV_SYN则表示一组完整事件已经完成,需要处理,EV_SYN的code定义事件分发的类型
EV_SYN对应的code如下
- /*
- * Synchronization events.
- */
- #define SYN_REPORT 0
- #define SYN_CONFIG 1
- #define SYN_MT_REPORT 2
EV_KEY的code比较多,这里就不列出来了,可参照input.h
EV_REL对应的code
- /*
- * Relative axes
- */
- #define REL_X 0x00
- #define REL_Y 0x01
- #define REL_Z 0x02
- #define REL_RX 0x03
- #define REL_RY 0x04
- #define REL_RZ 0x05
- #define REL_HWHEEL 0x06
- #define REL_DIAL 0x07
- #define REL_WHEEL 0x08
- #define REL_MISC 0x09
- #define REL_MAX 0x0f
- #define REL_CNT (REL_MAX+1)
EV_ABS对应的code
- /*
- * Absolute axes
- */
- #define ABS_X 0x00
- #define ABS_Y 0x01
- #define ABS_Z 0x02
- #define ABS_RX 0x03
- #define ABS_RY 0x04
- #define ABS_RZ 0x05
- #define ABS_THROTTLE 0x06
- #define ABS_RUDDER 0x07
- #define ABS_WHEEL 0x08
- #define ABS_GAS 0x09
- #define ABS_BRAKE 0x0a
- #define ABS_HAT0X 0x10
- #define ABS_HAT0Y 0x11
- #define ABS_HAT1X 0x12
- #define ABS_HAT1Y 0x13
- #define ABS_HAT2X 0x14
- #define ABS_HAT2Y 0x15
- #define ABS_HAT3X 0x16
- #define ABS_HAT3Y 0x17
- #define ABS_PRESSURE 0x18
- #define ABS_DISTANCE 0x19
- #define ABS_TILT_X 0x1a
- #define ABS_TILT_Y 0x1b
- #define ABS_TOOL_WIDTH 0x1c
- #define ABS_VOLUME 0x20
- #define ABS_MISC 0x28
- #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
- #define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
- #define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
- #define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
- #define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
- #define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
- #define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
- #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
- #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
- #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
- #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
- #define ABS_MAX 0x3f
- #define ABS_CNT (ABS_MAX+1)
- getevent中的 type,code,value
- 深入了解下Swift中的Value Type
- getevent
- Value Type 和 Reference Type
- Value Type And Reference Type
- C#中的参数传递:值类型(value type)和引用类型(reference type)
- C#中的参数传递:值类型(value type)和引用类型(reference type)
- Type-length-value数据格式
- Case: Hibernate: Value Type
- new (addr)type(value)
- Type-length-value
- Value Of Type
- data-type,data-value
- Value and type
- value stack code
- MIME Content Type code
- Value Type和Reference Type的区别
- swift中value type和reference type
- hive占用CPU100%2
- realloc 使用详解(分析realloc invalid pointer、指针无效等错误)
- MoveFile, MoveFileEx, CopyFile的几点心得 C++
- V4L2 soc-camera 分析 - 调用关系
- 在进程间,通过socket()进行通信,实现聊天功能
- getevent中的 type,code,value
- ZigBee学习笔记_osal_int_disable()
- POJ 1275 Drainage Ditches
- 技术网站
- LR中java vuser直接连接数据库脚本
- CSS与网站优化
- MFC 对excel2007简单操作
- MongoDB由来
- oracle的sqlplus登陆的时候老报错:ORA-12560: TNS: 协议适配器错误