Multi-touch (MT) Protocol 小结
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().
Multi-touch (MT) Protocol 小结的更多相关文章
- sencha touch的开源插件和例子
写了好久的sencha touch,没想到换工作竟然一年多没有搞了.因为项目的缘故收集了好多的组件,由于懒惰,没有整理,现在想想有点后悔了,再加上如果就这样丢弃,感觉有些遗憾,今天整理了一下放在git ...
- 多点触摸(MT)协议(翻译)
参考: http://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt 转自:http://www.arm9home.ne ...
- 内核中的多点触摸协议文档 Multi【转】
转自:http://www.arm9home.net/read.php?tid=24754 前段时间改写了一个GT801的内核驱动,仔细阅读 MT Event 上报的时候,发现这个驱动是针对 Andr ...
- linux常用基本命令整理小结
linux系统遵循的基本原则 由目标单一的小程序组成,组合小程序完成复杂任务: 一切皆文件: 尽量避免捕捉用户接口: 配置文件保存为纯文本文件: Linux命令行常识 命令格式 命令+选项+参数 选项 ...
- WPF- 模拟触发Touch Events
原文:WPF- 模拟触发Touch Events 基于API: [DllImport("User32.dll")] public static extern bool Initia ...
- touch,stat
touch(选项)(参数) 一是可以用来创建空文件,二是用来改变文件的元属性-a:修改文件的访问时间为当前时间-m:修改文件的改变时间为当前时间-r:把文件的属性修改成和某些文件一样的时间-t:修改成 ...
- linux查看端口及端口详解
今天现场查看了TCP端口的占用情况,如下图 红色部分是IP,现场那边问我是不是我的程序占用了tcp的链接,,我远程登陆现场查看了一下,这种类型的tcp链接占用了400多个,,后边查了一下资料,说E ...
- linux 常用端口列表
常见端口表汇总 1 tcpmux TCP Port Service Multiplexer 传输控制协议端口服务多路开关选择器 2 compressnet Management Utility com ...
- cocod2d-x 之 CCDirector、CCScene、CCSprite
CCDirector是控制游戏流程的主要组件. typedef enum { /// sets a 2D projection (orthogonal projection)2D投机模式 kCCDir ...
随机推荐
- leaflet 结合 d3.js 实现 geojson 数据地形剖面分析(附源码下载)
前言 leaflet 入门开发系列环境知识点了解: leaflet api文档介绍,详细介绍 leaflet 每个类的函数以及属性等等 leaflet 在线例子 leaflet 插件,leaflet ...
- Android 上下文菜单 PopupMenu
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); s ...
- Thymeleaf常用语法:表达式语法之运算符
Thymeleaf表达式语法之常量分为字符串常量.数字常量.布尔值常量.空值常量:运算符分为算术运算符.关系运算符.条件运算符.无操作符. 开发环境:IntelliJ IDEA 2019.2.2Spr ...
- SQL server利用脚本添加链接服务器,可设置别名
USE [master]GO EXEC master.dbo.sp_addlinkedserver @server = N'你的别名', @srvproduct=N'', @provider=N'SQ ...
- Win10家庭版激活方法
由于电脑换过主板,系统过了段时间显示未激活的状态,当时没注意随着主板口袋里的密匙,当作垃圾一起扔了,在网上试了几种方式,以下这个方法让我成功激活了系统 对开始菜单点击右键,选择Windows Powe ...
- Redis安装和基本操作
Redis 简介Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis 是属于非关系型数据库1.数据比模型较简单2.需要灵活性更强的IT系统3.对数据库性能 ...
- maven clean插件使用进阶
maven clean插件使用进阶 参考 Maven clean 插件 Maven删除外部文件 查看命令帮助 mvn clean:help mvn clean:help -Ddetail=true - ...
- matlab键盘快捷键无法使用的解决办法
打开matlab,在主页里点击 预设/preferences 左栏找 键盘/keyboard 点开键盘点击 快捷方式/shortcuts 在右边 活动设置 /Active settings 里选择 W ...
- Docker安装MySQL 8.0并挂载数据及配置文件
安装部署环境 Ubuntu 18.04.3 LTS Docker 19.03.2 MySQL latest(8.0.17) 下载镜像 # docker从仓库中拉取最新版的mysql镜像,如果没加标签的 ...
- MySQL中count和sum使用
count COUNT()函数里面的参数是列名的的时候,那么会计算有值项的次数.(NULL 不计入, 但是''值计入) COUNT(*)可以计算出行数,包括null COUNT(1)也可以计算出行数, ...