aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/input/multi-touch-protocol.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/input/multi-touch-protocol.txt')
-rw-r--r--Documentation/input/multi-touch-protocol.txt53
1 files changed, 34 insertions, 19 deletions
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index bdcba154b83e..71536e78406f 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -1,6 +1,6 @@
1Multi-touch (MT) Protocol 1Multi-touch (MT) Protocol
2------------------------- 2-------------------------
3 Copyright (C) 2009 Henrik Rydberg <rydberg@euromail.se> 3 Copyright (C) 2009-2010 Henrik Rydberg <rydberg@euromail.se>
4 4
5 5
6Introduction 6Introduction
@@ -161,19 +161,24 @@ against the glass. The inner region will increase, and in general, the
161ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than 161ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
162unity, is related to the contact pressure. For pressure-based devices, 162unity, is related to the contact pressure. For pressure-based devices,
163ABS_MT_PRESSURE may be used to provide the pressure on the contact area 163ABS_MT_PRESSURE may be used to provide the pressure on the contact area
164instead. 164instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
165indicate the distance between the contact and the surface.
165 166
166In addition to the MAJOR parameters, the oval shape of the contact can be 167In addition to the MAJOR parameters, the oval shape of the contact can be
167described by adding the MINOR parameters, such that MAJOR and MINOR are the 168described by adding the MINOR parameters, such that MAJOR and MINOR are the
168major and minor axis of an ellipse. Finally, the orientation of the oval 169major and minor axis of an ellipse. Finally, the orientation of the oval
169shape can be describe with the ORIENTATION parameter. 170shape can be describe with the ORIENTATION parameter.
170 171
172For type A devices, further specification of the touch shape is possible
173via ABS_MT_BLOB_ID.
174
171The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a 175The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
172contact or a pen or something else. Devices with more granular information 176finger or a pen or something else. Finally, the ABS_MT_TRACKING_ID event
173may specify general shapes as blobs, i.e., as a sequence of rectangular 177may be used to track identified contacts over time [5].
174shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices 178
175that currently support it, the ABS_MT_TRACKING_ID event may be used to 179In the type B protocol, ABS_MT_TOOL_TYPE and ABS_MT_TRACKING_ID are
176report contact tracking from hardware [5]. 180implicitly handled by input core; drivers should instead call
181input_mt_report_slot_state().
177 182
178 183
179Event Semantics 184Event Semantics
@@ -213,6 +218,12 @@ The pressure, in arbitrary units, on the contact area. May be used instead
213of TOUCH and WIDTH for pressure-based devices or any device with a spatial 218of TOUCH and WIDTH for pressure-based devices or any device with a spatial
214signal intensity distribution. 219signal intensity distribution.
215 220
221ABS_MT_DISTANCE
222
223The distance, in surface units, between the contact and the surface. Zero
224distance means the contact is touching the surface. A positive number means
225the contact is hovering above the surface.
226
216ABS_MT_ORIENTATION 227ABS_MT_ORIENTATION
217 228
218The orientation of the ellipse. The value should describe a signed quarter 229The orientation of the ellipse. The value should describe a signed quarter
@@ -240,21 +251,24 @@ ABS_MT_TOOL_TYPE
240The type of approaching tool. A lot of kernel drivers cannot distinguish 251The type of approaching tool. A lot of kernel drivers cannot distinguish
241between different tool types, such as a finger or a pen. In such cases, the 252between different tool types, such as a finger or a pen. In such cases, the
242event should be omitted. The protocol currently supports MT_TOOL_FINGER and 253event should be omitted. The protocol currently supports MT_TOOL_FINGER and
243MT_TOOL_PEN [2]. 254MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
255drivers should instead use input_mt_report_slot_state().
244 256
245ABS_MT_BLOB_ID 257ABS_MT_BLOB_ID
246 258
247The BLOB_ID groups several packets together into one arbitrarily shaped 259The BLOB_ID groups several packets together into one arbitrarily shaped
248contact. This is a low-level anonymous grouping for type A devices, and 260contact. The sequence of points forms a polygon which defines the shape of
261the contact. This is a low-level anonymous grouping for type A devices, and
249should not be confused with the high-level trackingID [5]. Most type A 262should not be confused with the high-level trackingID [5]. Most type A
250devices do not have blob capability, so drivers can safely omit this event. 263devices do not have blob capability, so drivers can safely omit this event.
251 264
252ABS_MT_TRACKING_ID 265ABS_MT_TRACKING_ID
253 266
254The TRACKING_ID identifies an initiated contact throughout its life cycle 267The TRACKING_ID identifies an initiated contact throughout its life cycle
255[5]. This event is mandatory for type B devices. The value range of the 268[5]. The value range of the TRACKING_ID should be large enough to ensure
256TRACKING_ID should be large enough to ensure unique identification of a 269unique identification of a contact maintained over an extended period of
257contact maintained over an extended period of time. 270time. For type B devices, this event is handled by input core; drivers
271should instead use input_mt_report_slot_state().
258 272
259 273
260Event Computation 274Event Computation
@@ -301,18 +315,19 @@ and with ORIENTATION, one can detect twisting of fingers.
301Notes 315Notes
302----- 316-----
303 317
304In order to stay compatible with existing applications, the data 318In order to stay compatible with existing applications, the data reported
305reported in a finger packet must not be recognized as single-touch 319in a finger packet must not be recognized as single-touch events.
306events. In addition, all finger data must bypass input filtering, 320
307since subsequent events of the same type refer to different fingers. 321For type A devices, all finger data bypasses input filtering, since
322subsequent events of the same type refer to different fingers.
308 323
309The first kernel driver to utilize the MT protocol is the bcm5974 driver, 324For example usage of the type A protocol, see the bcm5974 driver. For
310where examples can be found. 325example usage of the type B protocol, see the hid-egalax driver.
311 326
312[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the 327[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the
313difference between the contact position and the approaching tool position 328difference between the contact position and the approaching tool position
314could be used to derive tilt. 329could be used to derive tilt.
315[2] The list can of course be extended. 330[2] The list can of course be extended.
316[3] Multitouch X driver project: http://bitmath.org/code/multitouch/. 331[3] The mtdev project: http://bitmath.org/code/mtdev/.
317[4] See the section on event computation. 332[4] See the section on event computation.
318[5] See the section on finger tracking. 333[5] See the section on finger tracking.