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.txt71
1 files changed, 57 insertions, 14 deletions
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index a12ea3b586e6..c0fc1c75fd88 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -27,12 +27,30 @@ set of events/packets.
27 27
28A set of ABS_MT events with the desired properties is defined. The events 28A set of ABS_MT events with the desired properties is defined. The events
29are divided into categories, to allow for partial implementation. The 29are divided into categories, to allow for partial implementation. The
30minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and 30minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which
31ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the 31allows for multiple fingers to be tracked. If the device supports it, the
32device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size 32ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size
33of the approaching finger. Anisotropy and direction may be specified with 33of the contact area and approaching finger, respectively.
34ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. The 34
35ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a 35The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
36looking through a window at someone gently holding a finger against the
37glass. You will see two regions, one inner region consisting of the part
38of the finger actually touching the glass, and one outer region formed by
39the perimeter of the finger. The diameter of the inner region is the
40ABS_MT_TOUCH_MAJOR, the diameter of the outer region is
41ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder
42against the glass. The inner region will increase, and in general, the
43ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
44unity, is related to the finger pressure. For pressure-based devices,
45ABS_MT_PRESSURE may be used to provide the pressure on the contact area
46instead.
47
48In addition to the MAJOR parameters, the oval shape of the finger can be
49described by adding the MINOR parameters, such that MAJOR and MINOR are the
50major and minor axis of an ellipse. Finally, the orientation of the oval
51shape can be describe with the ORIENTATION parameter.
52
53The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
36finger or a pen or something else. Devices with more granular information 54finger or a pen or something else. Devices with more granular information
37may specify general shapes as blobs, i.e., as a sequence of rectangular 55may specify general shapes as blobs, i.e., as a sequence of rectangular
38shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices 56shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices
@@ -42,16 +60,30 @@ report finger tracking from hardware [5].
42Here is what a minimal event sequence for a two-finger touch would look 60Here is what a minimal event sequence for a two-finger touch would look
43like: 61like:
44 62
45 ABS_MT_TOUCH_MAJOR
46 ABS_MT_POSITION_X 63 ABS_MT_POSITION_X
47 ABS_MT_POSITION_Y 64 ABS_MT_POSITION_Y
48 SYN_MT_REPORT 65 SYN_MT_REPORT
49 ABS_MT_TOUCH_MAJOR
50 ABS_MT_POSITION_X 66 ABS_MT_POSITION_X
51 ABS_MT_POSITION_Y 67 ABS_MT_POSITION_Y
52 SYN_MT_REPORT 68 SYN_MT_REPORT
53 SYN_REPORT 69 SYN_REPORT
54 70
71Here is the sequence after lifting one of the fingers:
72
73 ABS_MT_POSITION_X
74 ABS_MT_POSITION_Y
75 SYN_MT_REPORT
76 SYN_REPORT
77
78And here is the sequence after lifting the remaining finger:
79
80 SYN_MT_REPORT
81 SYN_REPORT
82
83If the driver reports one of BTN_TOUCH or ABS_PRESSURE in addition to the
84ABS_MT events, the last SYN_MT_REPORT event may be omitted. Otherwise, the
85last SYN_REPORT will be dropped by the input core, resulting in no
86zero-finger event reaching userland.
55 87
56Event Semantics 88Event Semantics
57--------------- 89---------------
@@ -87,6 +119,12 @@ the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
87the notion of pressure. The fingers of the hand and the palm all have 119the notion of pressure. The fingers of the hand and the palm all have
88different characteristic widths [1]. 120different characteristic widths [1].
89 121
122ABS_MT_PRESSURE
123
124The pressure, in arbitrary units, on the contact area. May be used instead
125of TOUCH and WIDTH for pressure-based devices or any device with a spatial
126signal intensity distribution.
127
90ABS_MT_ORIENTATION 128ABS_MT_ORIENTATION
91 129
92The orientation of the ellipse. The value should describe a signed quarter 130The orientation of the ellipse. The value should describe a signed quarter
@@ -170,6 +208,16 @@ There are a few devices that support trackingID in hardware. User space can
170make use of these native identifiers to reduce bandwidth and cpu usage. 208make use of these native identifiers to reduce bandwidth and cpu usage.
171 209
172 210
211Gestures
212--------
213
214In the specific application of creating gesture events, the TOUCH and WIDTH
215parameters can be used to, e.g., approximate finger pressure or distinguish
216between index finger and thumb. With the addition of the MINOR parameters,
217one can also distinguish between a sweeping finger and a pointing finger,
218and with ORIENTATION, one can detect twisting of fingers.
219
220
173Notes 221Notes
174----- 222-----
175 223
@@ -185,11 +233,6 @@ where examples can be found.
185difference between the contact position and the approaching tool position 233difference between the contact position and the approaching tool position
186could be used to derive tilt. 234could be used to derive tilt.
187[2] The list can of course be extended. 235[2] The list can of course be extended.
188[3] The multi-touch X driver is currently in the prototyping stage. At the 236[3] Multitouch X driver project: http://bitmath.org/code/multitouch/.
189time of writing (April 2009), the MT protocol is not yet merged, and the
190prototype implements finger matching, basic mouse support and two-finger
191scrolling. The project aims at improving the quality of current multi-touch
192functionality available in the Synaptics X driver, and in addition
193implement more advanced gestures.
194[4] See the section on event computation. 237[4] See the section on event computation.
195[5] See the section on finger tracking. 238[5] See the section on finger tracking.