MT(Multi-Touch) Protocol (5)

来源:互联网 发布:ubuntu 22 端口不通 编辑:程序博客网 时间:2024/05/21 00:11

Event Usage
-----------
事件用法

 

A set of ABS_MT events with the desired properties is defined. The events
are divided into categories, to allow for partial implementation.  The minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which allows for multiple contacts to be tracked.  If the device supports it, the ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide

the size of the contact area and approaching contact, respectively.
一套携带各种需求属性的ABS_MT事件被定义了。这些事件被分成各种类别集合,有助于特殊需求的实现。最小系列包含ABS_MT_POSITION_X和ABS_MT_POSITION_Y,他们允许多点接触被跟踪。如果设备支持,ABS_MT_TOUCH_MAJOR和ABS_MT_WIDTH_MAJOR也许被分别用来提供接触区域和接近接触的大小。

 

The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
looking through a window at someone gently holding a finger against the
glass.  You will see two regions, one inner region consisting of the part
of the finger actually touching the glass, and one outer region formed by
the perimeter of the finger. The diameter of the inner region is the
ABS_MT_TOUCH_MAJOR, the diameter of the outer region is
ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder
against the glass. The inner region will increase, and in general, the
ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than unity, is related to the contact pressure. For pressure-based devices,
ABS_MT_PRESSURE may be used to provide the pressure on the contact area
instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
indicate the distance between the contact and the surface.
TOUCH参数和WIDTH参数有一个几何方面的解释;想象一下,通过一个窗户看到一个人轻轻地将手指按在玻璃上。你将会看到两个区域:一个内部区域,由手指实际接触到
玻璃上的部分组成;一个外部区域,由手指的周长形成。
内部区域的直径就是ABS_MT_TOUCH_MAJOR,外部区域的直径就是ABS_MT_WIDTH_MAJOR。
现在想象那个人更加用力地将手指按到玻璃上。如此,内部区域就会增加。以及通常
ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR的比率(总是小于1的)跟接触的压力有关。
对于基于压力的设备,ABS_MT_PRESSURE也许会被用来替代上面的一对参数,提供接触区域的压力。拥有接触靠近能力的设备可以使用ABS_MT_DISTANCE显示接触处与设备表面的距离。

 

In addition to the MAJOR parameters, the oval shape of the contact can be
described by adding the MINOR parameters, such that MAJOR and MINOR are the
major and minor axis of an ellipse. Finally, the orientation of the oval
shape can be describe with the ORIENTATION parameter.
除了MAJOR参数外,接触的椭圆形状还可以被MINOR参数描述。MAJOR和MINOR是椭圆的major和minor轴参数。最后椭圆的方向可以用ORIENTATION参数来描述。

 

For type A devices, further specification of the touch shape is possible
via ABS_MT_BLOB_ID.
对于A类设备,关于触摸形状是可以通过ABS_MT_BLOB_ID参数进一步说明的。

 

The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
finger or a pen or something else. Finally, the ABS_MT_TRACKING_ID event
may be used to track identified contacts over time [5].

ABS_MT_TOOL_TYPE参数可以被用来说明触摸的工具是手指,还是钢笔或还是其他的东西。ABS_MT_TRACKING_ID事件可以被用来实时跟踪已经被标识的接触。

 

In the type B protocol, ABS_MT_TOOL_TYPE and ABS_MT_TRACKING_ID are
implicitly handled by input core; drivers should instead call
input_mt_report_slot_state().
在B类协议里,ABS_MT_TOOL_TYPE 和 ABS_MT_TRACKING_ID是默认由input 核心处理的。驱动程序里直接调用input_mt_report_slot_state()函数即可。