1, 两种多点触摸协议:

  • A类: 处理无关联的接触: 用于直接发送原始数据;
  • B类: 处理跟踪识别类的接触: 通过事件slot发送相关联的独立接触更新。

2, 触摸协议的使用:

A类协议:

A类协议在每发送完一个接触数据包后会调用 input_mt_sync() 声明 一次数据的结束; input_mt_sync() 会发出一个 SYN_MT_REPORT

B类协议:

与A类协议不同的是, B类在使用input_mt_slot()的时候会带有一个slot的参数,在每个数据包开始时 产生一个ABS_MT_SLOT事件,提示接收器更新数据。

最终A,B类协议均会调用 input_sync();

A类与B类协议不同的在于: B类协议 通过B类协议 slot 协议需要是用到ABS_MT_TRACKING_ID------ 可以从硬件上获取,或者从原始数据中计算。

3, B类协议:

ABS_MT_TRACKING_ID 表示一次接触; -1 代表一个不用的slot;

使用参考例子:

释放事件:

input_mt_slot(data->input_dev, i);
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER, false);

点击事件:

input_mt_slot(data->input_dev, i);
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER, true);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_POSITION_X, current_events[i].x);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, current_events[i].y)

补充: 不同事件的标记: 备忘。

ABS_MT_TOUCH_MAJOR

The length of the major axis of the contact. The length should be given insurface units. If the surface has an X times Y resolution, the largestpossible value of ABS_MT_TOUCH_MAJOR is sqrt(X^2 + Y^2), the diagonal [4].

ABS_MT_TOUCH_MINOR

The length, in surface units, of the minor axis of the contact. If thecontact is circular, this event can be omitted [4].

ABS_MT_WIDTH_MAJOR

The length, in surface units, of the major axis of the approachingtool. This should be understood as the size of the tool itself. Theorientation of the contact and the approaching tool are assumed to be thesame [4].

ABS_MT_WIDTH_MINOR

The length, in surface units, of the minor axis of the approachingtool. Omit if circular [4].The above four values can be used to derive additional information aboutthe contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximatesthe notion of pressure. The fingers of the hand and the palm all havedifferent characteristic widths [1].

ABS_MT_PRESSURE

The pressure, in arbitrary units, on the contact area. May be used insteadof TOUCH and WIDTH for pressure-based devices or any device with a spatialsignal intensity distribution.

ABS_MT_DISTANCE

The distance, in surface units, between the contact and the surface. Zerodistance means the contact is touching the surface. A positive number meansthe contact is hovering above the surface.

ABS_MT_ORIENTATION

The orientation of the ellipse. The value should describe a signed quarterof a revolution clockwise around the touch center. The signed value rangeis arbitrary, but zero should be returned for a finger aligned along the Yaxis of the surface, a negative value when finger is turned to the left, anda positive value when finger turned to the right. When completely aligned withthe X axis, the range max should be returned. Orientation can be omittedif the touching object is circular, or if the information is not availablein the kernel driver. Partial orientation support is possible if the devicecan distinguish between the two axis, but not (uniquely) any values inbetween. In such cases, the range of ABS_MT_ORIENTATION should be [0, 1][4].

ABS_MT_POSITION_X

The surface X coordinate of the center of the touching ellipse.ABS_MT_POSITION_YThe surface Y coordinate of the center of the touching ellipse.

ABS_MT_TOOL_TYPE

The type of approaching tool. A lot of kernel drivers cannot distinguishbetween different tool types, such as a finger or a pen. In such cases, theevent should be omitted. The protocol currently supports MT_TOOL_FINGER andMT_TOOL_PEN [2]. For type B devices, this event is handled by input core;drivers should instead use input_mt_report_slot_state().

ABS_MT_BLOB_ID

The BLOB_ID groups several packets together into one arbitrarily shapedcontact. The sequence of points forms a polygon which defines the shape ofthe contact. This is a low-level anonymous grouping for type A devices, andshould not be confused with the high-level trackingID [5]. Most type Adevices do not have blob capability, so drivers can safely omit this event.

ABS_MT_TRACKING_ID

The TRACKING_ID identifies an initiated contact throughout its life cycle[5]. The value range of the TRACKING_ID should be large enough to ensureunique identification of a contact maintained over an extended period oftime. For type B devices, this event is handled by input core; driversshould instead use input_mt_report_slot_state().

最新文章

  1. JMeter学习-034-JMeter调试工具之一---HTTP Mirror Server
  2. ShellShock 攻击实验
  3. 关于无法使用xx-pc附加到应用程序iisexpress.exe
  4. 2017.1.8a版给信息源新增:max_len、max_db字段
  5. css排版
  6. C语言二重指针与malloc
  7. Centos安装桌面环境
  8. 【Java学习笔记】数组使用
  9. 第二百五十二天 how can I 坚持
  10. WCF之各种WCF引用方式
  11. YUV数据格式
  12. ios 烟花 火焰 雨水 雪花等特效属性
  13. java 解决时间相减问题
  14. ACM KMP 格式输入导致TLE
  15. Python学习之旅(三十七)
  16. kubernetes ceph-rbd挂载步骤 类型PersistentVolume
  17. 用iframe嵌入了一个微信公众号平台文章的URL
  18. oauth 2.0 授权流程图
  19. Android开发之使用GridView+仿微信图片上传功能(附源代码)
  20. html5 app开发

热门文章

  1. 【实习第二天】odoo开发基础(二)
  2. STL--标准模板库--简要概述
  3. Redis 找出大 key
  4. JVM-2-JVM结构
  5. Less(5)
  6. leetcode 双周赛9 进击的骑士
  7. 排序算法| Array.sort()算法规则
  8. CF1278B-A and B-(简单数学)
  9. vue中\$refs、\$emit、$on的使用场景
  10. angularjs中使用锚点,angular路由导致锚点失效的两种解决方案