MT(Multi-Touch) Protocol (5)

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()函數即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章