Skip to content

Commit f6bdc23

Browse files
rydbergdtor
authored andcommitted
Input: update multi-touch protocol documentation
This patch documents a new ABS_MT parameter and adds further text to clarify some points around the MT protocol. Requested-by: Yoonyoung Shim <jy0922.shim@samsung.com> Requested-by: Mika Kuoppala <mika.kuoppala@nokia.com> Requested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent cb6ecf6 commit f6bdc23

1 file changed

Lines changed: 40 additions & 8 deletions

File tree

‎Documentation/input/multi-touch-protocol.txt‎

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,30 @@ set of events/packets.
2727

2828
A set of ABS_MT events with the desired properties is defined. The events
2929
are divided into categories, to allow for partial implementation. The
30-
minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and
31-
ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the
32-
device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size
33-
of the approaching finger. Anisotropy and direction may be specified with
34-
ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. The
35-
ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
30+
minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which
31+
allows for multiple fingers to be tracked. If the device supports it, the
32+
ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size
33+
of the contact area and approaching finger, respectively.
34+
35+
The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
36+
looking through a window at someone gently holding a finger against the
37+
glass. You will see two regions, one inner region consisting of the part
38+
of the finger actually touching the glass, and one outer region formed by
39+
the perimeter of the finger. The diameter of the inner region is the
40+
ABS_MT_TOUCH_MAJOR, the diameter of the outer region is
41+
ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder
42+
against the glass. The inner region will increase, and in general, the
43+
ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
44+
unity, is related to the finger pressure. For pressure-based devices,
45+
ABS_MT_PRESSURE may be used to provide the pressure on the contact area
46+
instead.
47+
48+
In addition to the MAJOR parameters, the oval shape of the finger can be
49+
described by adding the MINOR parameters, such that MAJOR and MINOR are the
50+
major and minor axis of an ellipse. Finally, the orientation of the oval
51+
shape can be describe with the ORIENTATION parameter.
52+
53+
The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
3654
finger or a pen or something else. Devices with more granular information
3755
may specify general shapes as blobs, i.e., as a sequence of rectangular
3856
shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices
@@ -42,11 +60,9 @@ report finger tracking from hardware [5].
4260
Here is what a minimal event sequence for a two-finger touch would look
4361
like:
4462

45-
ABS_MT_TOUCH_MAJOR
4663
ABS_MT_POSITION_X
4764
ABS_MT_POSITION_Y
4865
SYN_MT_REPORT
49-
ABS_MT_TOUCH_MAJOR
5066
ABS_MT_POSITION_X
5167
ABS_MT_POSITION_Y
5268
SYN_MT_REPORT
@@ -87,6 +103,12 @@ the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
87103
the notion of pressure. The fingers of the hand and the palm all have
88104
different characteristic widths [1].
89105

106+
ABS_MT_PRESSURE
107+
108+
The pressure, in arbitrary units, on the contact area. May be used instead
109+
of TOUCH and WIDTH for pressure-based devices or any device with a spatial
110+
signal intensity distribution.
111+
90112
ABS_MT_ORIENTATION
91113

92114
The orientation of the ellipse. The value should describe a signed quarter
@@ -170,6 +192,16 @@ There are a few devices that support trackingID in hardware. User space can
170192
make use of these native identifiers to reduce bandwidth and cpu usage.
171193

172194

195+
Gestures
196+
--------
197+
198+
In the specific application of creating gesture events, the TOUCH and WIDTH
199+
parameters can be used to, e.g., approximate finger pressure or distinguish
200+
between index finger and thumb. With the addition of the MINOR parameters,
201+
one can also distinguish between a sweeping finger and a pointing finger,
202+
and with ORIENTATION, one can detect twisting of fingers.
203+
204+
173205
Notes
174206
-----
175207

0 commit comments

Comments
 (0)