blob: 1085cbee4ee720bf465b804b0ccdafc177b8ff43 [file] [log] [blame]
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -07001.. include:: <isonum.txt>
2
3=========================
Henrik Rydbergeacaad02009-04-28 07:49:21 -07004Multi-touch (MT) Protocol
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -07005=========================
6
7:Copyright: |copy| 2009-2010 Henrik Rydberg <rydberg@euromail.se>
Henrik Rydbergeacaad02009-04-28 07:49:21 -07008
9
10Introduction
11------------
12
Henrik Rydberg72c8a942010-07-15 23:22:07 -070013In order to utilize the full power of the new multi-touch and multi-user
14devices, a way to report detailed data from multiple contacts, i.e.,
15objects in direct contact with the device surface, is needed. This
16document describes the multi-touch (MT) protocol which allows kernel
17drivers to report details for an arbitrary number of contacts.
18
19The protocol is divided into two types, depending on the capabilities of the
20hardware. For devices handling anonymous contacts (type A), the protocol
21describes how to send the raw data for all contacts to the receiver. For
22devices capable of tracking identifiable contacts (type B), the protocol
23describes how to send updates for individual contacts via event slots.
Henrik Rydbergeacaad02009-04-28 07:49:21 -070024
Dmitry Torokhov6c6d5752017-04-06 17:23:39 -070025.. note::
Colin Ian Kingac862502019-08-05 11:49:51 +010026 MT protocol type A is obsolete, all kernel drivers have been
Dmitry Torokhov6c6d5752017-04-06 17:23:39 -070027 converted to use type B.
Henrik Rydbergeacaad02009-04-28 07:49:21 -070028
Henrik Rydberg72c8a942010-07-15 23:22:07 -070029Protocol Usage
30--------------
Henrik Rydbergeacaad02009-04-28 07:49:21 -070031
Henrik Rydberg72c8a942010-07-15 23:22:07 -070032Contact details are sent sequentially as separate packets of ABS_MT
33events. Only the ABS_MT events are recognized as part of a contact
34packet. Since these events are ignored by current single-touch (ST)
35applications, the MT protocol can be implemented on top of the ST protocol
36in an existing driver.
37
38Drivers for type A devices separate contact packets by calling
39input_mt_sync() at the end of each packet. This generates a SYN_MT_REPORT
40event, which instructs the receiver to accept the data for the current
41contact and prepare to receive another.
42
43Drivers for type B devices separate contact packets by calling
44input_mt_slot(), with a slot as argument, at the beginning of each packet.
45This generates an ABS_MT_SLOT event, which instructs the receiver to
46prepare for updates of the given slot.
47
48All drivers mark the end of a multi-touch transfer by calling the usual
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -070049input_sync() function. This instructs the receiver to act upon events
Henrik Rydberg72c8a942010-07-15 23:22:07 -070050accumulated since last EV_SYN/SYN_REPORT and prepare to receive a new set
51of events/packets.
52
53The main difference between the stateless type A protocol and the stateful
54type B slot protocol lies in the usage of identifiable contacts to reduce
55the amount of data sent to userspace. The slot protocol requires the use of
56the ABS_MT_TRACKING_ID, either provided by the hardware or computed from
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -070057the raw data [#f5]_.
Henrik Rydberg72c8a942010-07-15 23:22:07 -070058
59For type A devices, the kernel driver should generate an arbitrary
60enumeration of the full set of anonymous contacts currently on the
61surface. The order in which the packets appear in the event stream is not
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -070062important. Event filtering and finger tracking is left to user space [#f3]_.
Henrik Rydberg72c8a942010-07-15 23:22:07 -070063
64For type B devices, the kernel driver should associate a slot with each
65identified contact, and use that slot to propagate changes for the contact.
66Creation, replacement and destruction of contacts is achieved by modifying
67the ABS_MT_TRACKING_ID of the associated slot. A non-negative tracking id
68is interpreted as a contact, and the value -1 denotes an unused slot. A
69tracking id not previously present is considered new, and a tracking id no
70longer present is considered removed. Since only changes are propagated,
71the full state of each initiated contact has to reside in the receiving
72end. Upon receiving an MT event, one simply updates the appropriate
73attribute of the current slot.
74
Daniel Kurtza93bd152011-08-23 23:02:36 -070075Some devices identify and/or track more contacts than they can report to the
76driver. A driver for such a device should associate one type B slot with each
77contact that is reported by the hardware. Whenever the identity of the
78contact associated with a slot changes, the driver should invalidate that
79slot by changing its ABS_MT_TRACKING_ID. If the hardware signals that it is
80tracking more contacts than it is currently reporting, the driver should use
81a BTN_TOOL_*TAP event to inform userspace of the total number of contacts
82being tracked by the hardware at that moment. The driver should do this by
83explicitly sending the corresponding BTN_TOOL_*TAP event and setting
84use_count to false when calling input_mt_report_pointer_emulation().
85The driver should only advertise as many slots as the hardware can report.
86Userspace can detect that a driver can report more total contacts than slots
87by noting that the largest supported BTN_TOOL_*TAP event is larger than the
88total number of type B slots reported in the absinfo for the ABS_MT_SLOT axis.
Henrik Rydberg72c8a942010-07-15 23:22:07 -070089
Peter Hutterer257867d2013-05-31 16:29:44 +100090The minimum value of the ABS_MT_SLOT axis must be 0.
91
Henrik Rydberg72c8a942010-07-15 23:22:07 -070092Protocol Example A
93------------------
94
95Here is what a minimal event sequence for a two-contact touch would look
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -070096like for a type A device::
Henrik Rydberg72c8a942010-07-15 23:22:07 -070097
98 ABS_MT_POSITION_X x[0]
99 ABS_MT_POSITION_Y y[0]
100 SYN_MT_REPORT
101 ABS_MT_POSITION_X x[1]
102 ABS_MT_POSITION_Y y[1]
103 SYN_MT_REPORT
104 SYN_REPORT
105
106The sequence after moving one of the contacts looks exactly the same; the
107raw data for all present contacts are sent between every synchronization
108with SYN_REPORT.
109
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700110Here is the sequence after lifting the first contact::
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700111
112 ABS_MT_POSITION_X x[1]
113 ABS_MT_POSITION_Y y[1]
114 SYN_MT_REPORT
115 SYN_REPORT
116
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700117And here is the sequence after lifting the second contact::
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700118
119 SYN_MT_REPORT
120 SYN_REPORT
121
122If the driver reports one of BTN_TOUCH or ABS_PRESSURE in addition to the
123ABS_MT events, the last SYN_MT_REPORT event may be omitted. Otherwise, the
124last SYN_REPORT will be dropped by the input core, resulting in no
125zero-contact event reaching userland.
126
127
128Protocol Example B
129------------------
130
131Here is what a minimal event sequence for a two-contact touch would look
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700132like for a type B device::
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700133
134 ABS_MT_SLOT 0
135 ABS_MT_TRACKING_ID 45
136 ABS_MT_POSITION_X x[0]
137 ABS_MT_POSITION_Y y[0]
138 ABS_MT_SLOT 1
139 ABS_MT_TRACKING_ID 46
140 ABS_MT_POSITION_X x[1]
141 ABS_MT_POSITION_Y y[1]
142 SYN_REPORT
143
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700144Here is the sequence after moving contact 45 in the x direction::
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700145
146 ABS_MT_SLOT 0
147 ABS_MT_POSITION_X x[0]
148 SYN_REPORT
149
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700150Here is the sequence after lifting the contact in slot 0::
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700151
152 ABS_MT_TRACKING_ID -1
153 SYN_REPORT
154
155The slot being modified is already 0, so the ABS_MT_SLOT is omitted. The
156message removes the association of slot 0 with contact 45, thereby
157destroying contact 45 and freeing slot 0 to be reused for another contact.
158
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700159Finally, here is the sequence after lifting the second contact::
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700160
161 ABS_MT_SLOT 1
162 ABS_MT_TRACKING_ID -1
163 SYN_REPORT
164
165
166Event Usage
167-----------
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700168
169A set of ABS_MT events with the desired properties is defined. The events
170are divided into categories, to allow for partial implementation. The
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800171minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700172allows for multiple contacts to be tracked. If the device supports it, the
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800173ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200174of the contact area and approaching tool, respectively.
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800175
176The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
177looking through a window at someone gently holding a finger against the
178glass. You will see two regions, one inner region consisting of the part
179of the finger actually touching the glass, and one outer region formed by
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200180the perimeter of the finger. The center of the touching region (a) is
181ABS_MT_POSITION_X/Y and the center of the approaching finger (b) is
182ABS_MT_TOOL_X/Y. The touch diameter is ABS_MT_TOUCH_MAJOR and the finger
183diameter is ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger
184harder against the glass. The touch region will increase, and in general,
185the ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller
186than unity, is related to the contact pressure. For pressure-based devices,
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800187ABS_MT_PRESSURE may be used to provide the pressure on the contact area
Henrik Rydberge42a98b2010-12-06 10:05:43 +0100188instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
189indicate the distance between the contact and the surface.
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800190
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700191::
192
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200193
194 Linux MT Win8
195 __________ _______________________
196 / \ | |
197 / \ | |
198 / ____ \ | |
199 / / \ \ | |
200 \ \ a \ \ | a |
201 \ \____/ \ | |
202 \ \ | |
203 \ b \ | b |
204 \ \ | |
205 \ \ | |
206 \ \ | |
207 \ / | |
208 \ / | |
209 \ / | |
210 \__________/ |_______________________|
211
212
213In addition to the MAJOR parameters, the oval shape of the touch and finger
214regions can be described by adding the MINOR parameters, such that MAJOR
215and MINOR are the major and minor axis of an ellipse. The orientation of
216the touch ellipse can be described with the ORIENTATION parameter, and the
217direction of the finger ellipse is given by the vector (a - b).
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800218
Henrik Rydberg22f075a2010-12-20 15:09:27 +0100219For type A devices, further specification of the touch shape is possible
220via ABS_MT_BLOB_ID.
221
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800222The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
Henrik Rydberg22f075a2010-12-20 15:09:27 +0100223finger or a pen or something else. Finally, the ABS_MT_TRACKING_ID event
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700224may be used to track identified contacts over time [#f5]_.
Henrik Rydberg22f075a2010-12-20 15:09:27 +0100225
226In the type B protocol, ABS_MT_TOOL_TYPE and ABS_MT_TRACKING_ID are
227implicitly handled by input core; drivers should instead call
228input_mt_report_slot_state().
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -0700229
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700230
231Event Semantics
232---------------
233
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700234ABS_MT_TOUCH_MAJOR
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700235 The length of the major axis of the contact. The length should be given in
236 surface units. If the surface has an X times Y resolution, the largest
237 possible value of ABS_MT_TOUCH_MAJOR is sqrt(X^2 + Y^2), the diagonal [#f4]_.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700238
239ABS_MT_TOUCH_MINOR
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700240 The length, in surface units, of the minor axis of the contact. If the
241 contact is circular, this event can be omitted [#f4]_.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700242
243ABS_MT_WIDTH_MAJOR
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700244 The length, in surface units, of the major axis of the approaching
245 tool. This should be understood as the size of the tool itself. The
246 orientation of the contact and the approaching tool are assumed to be the
247 same [#f4]_.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700248
249ABS_MT_WIDTH_MINOR
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700250 The length, in surface units, of the minor axis of the approaching
251 tool. Omit if circular [#f4]_.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700252
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700253 The above four values can be used to derive additional information about
254 the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
255 the notion of pressure. The fingers of the hand and the palm all have
256 different characteristic widths.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700257
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800258ABS_MT_PRESSURE
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700259 The pressure, in arbitrary units, on the contact area. May be used instead
260 of TOUCH and WIDTH for pressure-based devices or any device with a spatial
261 signal intensity distribution.
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800262
Peter Hutterer20ccc8d2021-01-13 09:03:10 +1000263 If the resolution is zero, the pressure data is in arbitrary units.
Randy Dunlap338b6602021-03-02 14:35:20 -0800264 If the resolution is non-zero, the pressure data is in units/gram. See
Peter Hutterer20ccc8d2021-01-13 09:03:10 +1000265 :ref:`input-event-codes` for details.
266
Henrik Rydberge42a98b2010-12-06 10:05:43 +0100267ABS_MT_DISTANCE
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700268 The distance, in surface units, between the contact and the surface. Zero
269 distance means the contact is touching the surface. A positive number means
270 the contact is hovering above the surface.
Henrik Rydberge42a98b2010-12-06 10:05:43 +0100271
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700272ABS_MT_ORIENTATION
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700273 The orientation of the touching ellipse. The value should describe a signed
274 quarter of a revolution clockwise around the touch center. The signed value
275 range is arbitrary, but zero should be returned for an ellipse aligned with
Wei-Ning Huang00720272017-10-12 14:21:43 +0800276 the Y axis (north) of the surface, a negative value when the ellipse is
277 turned to the left, and a positive value when the ellipse is turned to the
278 right. When aligned with the X axis in the positive direction, the range
279 max should be returned; when aligned with the X axis in the negative
280 direction, the range -max should be returned.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700281
Randy Dunlap338b6602021-03-02 14:35:20 -0800282 Touch ellipses are symmetrical by default. For devices capable of true 360
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700283 degree orientation, the reported orientation must exceed the range max to
284 indicate more than a quarter of a revolution. For an upside-down finger,
285 range max * 2 should be returned.
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200286
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700287 Orientation can be omitted if the touch area is circular, or if the
288 information is not available in the kernel driver. Partial orientation
Randy Dunlap338b6602021-03-02 14:35:20 -0800289 support is possible if the device can distinguish between the two axes, but
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700290 not (uniquely) any values in between. In such cases, the range of
291 ABS_MT_ORIENTATION should be [0, 1] [#f4]_.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700292
293ABS_MT_POSITION_X
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700294 The surface X coordinate of the center of the touching ellipse.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700295
296ABS_MT_POSITION_Y
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700297 The surface Y coordinate of the center of the touching ellipse.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700298
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200299ABS_MT_TOOL_X
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700300 The surface X coordinate of the center of the approaching tool. Omit if
301 the device cannot distinguish between the intended touch point and the
302 tool itself.
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200303
304ABS_MT_TOOL_Y
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700305 The surface Y coordinate of the center of the approaching tool. Omit if the
306 device cannot distinguish between the intended touch point and the tool
307 itself.
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200308
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700309 The four position values can be used to separate the position of the touch
310 from the position of the tool. If both positions are present, the major
311 tool axis points towards the touch point [#f1]_. Otherwise, the tool axes are
312 aligned with the touch axes.
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200313
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700314ABS_MT_TOOL_TYPE
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700315 The type of approaching tool. A lot of kernel drivers cannot distinguish
316 between different tool types, such as a finger or a pen. In such cases, the
Benjamin Tissoiresb875a5a2018-07-13 16:13:43 +0200317 event should be omitted. The protocol currently mainly supports
318 MT_TOOL_FINGER, MT_TOOL_PEN, and MT_TOOL_PALM [#f2]_.
319 For type B devices, this event is handled by input core; drivers should
320 instead use input_mt_report_slot_state(). A contact's ABS_MT_TOOL_TYPE may
321 change over time while still touching the device, because the firmware may
322 not be able to determine which tool is being used when it first appears.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700323
324ABS_MT_BLOB_ID
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700325 The BLOB_ID groups several packets together into one arbitrarily shaped
326 contact. The sequence of points forms a polygon which defines the shape of
327 the contact. This is a low-level anonymous grouping for type A devices, and
328 should not be confused with the high-level trackingID [#f5]_. Most type A
329 devices do not have blob capability, so drivers can safely omit this event.
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -0700330
331ABS_MT_TRACKING_ID
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700332 The TRACKING_ID identifies an initiated contact throughout its life cycle
333 [#f5]_. The value range of the TRACKING_ID should be large enough to ensure
334 unique identification of a contact maintained over an extended period of
335 time. For type B devices, this event is handled by input core; drivers
336 should instead use input_mt_report_slot_state().
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -0700337
338
339Event Computation
340-----------------
341
342The flora of different hardware unavoidably leads to some devices fitting
343better to the MT protocol than others. To simplify and unify the mapping,
344this section gives recipes for how to compute certain events.
345
346For devices reporting contacts as rectangular shapes, signed orientation
347cannot be obtained. Assuming X and Y are the lengths of the sides of the
348touching rectangle, here is a simple formula that retains the most
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700349information possible::
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -0700350
351 ABS_MT_TOUCH_MAJOR := max(X, Y)
352 ABS_MT_TOUCH_MINOR := min(X, Y)
353 ABS_MT_ORIENTATION := bool(X > Y)
354
355The range of ABS_MT_ORIENTATION should be set to [0, 1], to indicate that
356the device can distinguish between a finger along the Y axis (0) and a
357finger along the X axis (1).
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700358
Randy Dunlap338b6602021-03-02 14:35:20 -0800359For Win8 devices with both T and C coordinates, the position mapping is::
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200360
361 ABS_MT_POSITION_X := T_X
362 ABS_MT_POSITION_Y := T_Y
363 ABS_MT_TOOL_X := C_X
Daniel Martinb14527232015-09-19 11:27:19 -0700364 ABS_MT_TOOL_Y := C_Y
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200365
366Unfortunately, there is not enough information to specify both the touching
367ellipse and the tool ellipse, so one has to resort to approximations. One
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700368simple scheme, which is compatible with earlier usage, is::
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200369
370 ABS_MT_TOUCH_MAJOR := min(X, Y)
371 ABS_MT_TOUCH_MINOR := <not used>
372 ABS_MT_ORIENTATION := <not used>
373 ABS_MT_WIDTH_MAJOR := min(X, Y) + distance(T, C)
374 ABS_MT_WIDTH_MINOR := min(X, Y)
375
376Rationale: We have no information about the orientation of the touching
377ellipse, so approximate it with an inscribed circle instead. The tool
Masanari Iidadf5cbb22014-03-21 10:04:30 +0900378ellipse should align with the vector (T - C), so the diameter must
Henrik Rydbergcab7fac2012-06-27 09:53:47 +0200379increase with distance(T, C). Finally, assume that the touch diameter is
380equal to the tool thickness, and we arrive at the formulas above.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700381
382Finger Tracking
383---------------
384
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -0700385The process of finger tracking, i.e., to assign a unique trackingID to each
Henrik Rydberg72c8a942010-07-15 23:22:07 -0700386initiated contact on the surface, is a Euclidian Bipartite Matching
387problem. At each event synchronization, the set of actual contacts is
388matched to the set of contacts from the previous synchronization. A full
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700389implementation can be found in [#f3]_.
Henrik Rydbergf9fcfc32009-05-23 09:51:21 -0700390
391
Henrik Rydbergf6bdc232010-01-28 22:28:28 -0800392Gestures
393--------
394
395In the specific application of creating gesture events, the TOUCH and WIDTH
396parameters can be used to, e.g., approximate finger pressure or distinguish
397between index finger and thumb. With the addition of the MINOR parameters,
398one can also distinguish between a sweeping finger and a pointing finger,
399and with ORIENTATION, one can detect twisting of fingers.
400
401
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700402Notes
403-----
404
Henrik Rydberg22f075a2010-12-20 15:09:27 +0100405In order to stay compatible with existing applications, the data reported
406in a finger packet must not be recognized as single-touch events.
Henrik Rydbergeacaad02009-04-28 07:49:21 -0700407
Henrik Rydberg22f075a2010-12-20 15:09:27 +0100408For type A devices, all finger data bypasses input filtering, since
409subsequent events of the same type refer to different fingers.
410
Mauro Carvalho Chehabeba31a32017-04-04 17:46:28 -0700411.. [#f1] Also, the difference (TOOL_X - POSITION_X) can be used to model tilt.
412.. [#f2] The list can of course be extended.
413.. [#f3] The mtdev project: http://bitmath.org/code/mtdev/.
414.. [#f4] See the section on event computation.
415.. [#f5] See the section on finger tracking.