diff options
Diffstat (limited to 'Documentation/input/multi-touch-protocol.txt')
-rw-r--r-- | Documentation/input/multi-touch-protocol.txt | 71 |
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 | ||
28 | A set of ABS_MT events with the desired properties is defined. The events | 28 | A set of ABS_MT events with the desired properties is defined. The events |
29 | are divided into categories, to allow for partial implementation. The | 29 | are divided into categories, to allow for partial implementation. The |
30 | minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and | 30 | minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which |
31 | ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the | 31 | allows for multiple fingers to be tracked. If the device supports it, the |
32 | device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size | 32 | ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size |
33 | of the approaching finger. Anisotropy and direction may be specified with | 33 | of the contact area and approaching finger, respectively. |
34 | ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. The | 34 | |
35 | ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a | 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 | ||
36 | finger or a pen or something else. Devices with more granular information | 54 | finger or a pen or something else. Devices with more granular information |
37 | may specify general shapes as blobs, i.e., as a sequence of rectangular | 55 | may specify general shapes as blobs, i.e., as a sequence of rectangular |
38 | shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices | 56 | shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices |
@@ -42,16 +60,30 @@ report finger tracking from hardware [5]. | |||
42 | Here is what a minimal event sequence for a two-finger touch would look | 60 | Here is what a minimal event sequence for a two-finger touch would look |
43 | like: | 61 | like: |
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 | ||
71 | Here 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 | |||
78 | And here is the sequence after lifting the remaining finger: | ||
79 | |||
80 | SYN_MT_REPORT | ||
81 | SYN_REPORT | ||
82 | |||
83 | If the driver reports one of BTN_TOUCH or ABS_PRESSURE in addition to the | ||
84 | ABS_MT events, the last SYN_MT_REPORT event may be omitted. Otherwise, the | ||
85 | last SYN_REPORT will be dropped by the input core, resulting in no | ||
86 | zero-finger event reaching userland. | ||
55 | 87 | ||
56 | Event Semantics | 88 | Event Semantics |
57 | --------------- | 89 | --------------- |
@@ -87,6 +119,12 @@ the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates | |||
87 | the notion of pressure. The fingers of the hand and the palm all have | 119 | the notion of pressure. The fingers of the hand and the palm all have |
88 | different characteristic widths [1]. | 120 | different characteristic widths [1]. |
89 | 121 | ||
122 | ABS_MT_PRESSURE | ||
123 | |||
124 | The pressure, in arbitrary units, on the contact area. May be used instead | ||
125 | of TOUCH and WIDTH for pressure-based devices or any device with a spatial | ||
126 | signal intensity distribution. | ||
127 | |||
90 | ABS_MT_ORIENTATION | 128 | ABS_MT_ORIENTATION |
91 | 129 | ||
92 | The orientation of the ellipse. The value should describe a signed quarter | 130 | The 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 | |||
170 | make use of these native identifiers to reduce bandwidth and cpu usage. | 208 | make use of these native identifiers to reduce bandwidth and cpu usage. |
171 | 209 | ||
172 | 210 | ||
211 | Gestures | ||
212 | -------- | ||
213 | |||
214 | In the specific application of creating gesture events, the TOUCH and WIDTH | ||
215 | parameters can be used to, e.g., approximate finger pressure or distinguish | ||
216 | between index finger and thumb. With the addition of the MINOR parameters, | ||
217 | one can also distinguish between a sweeping finger and a pointing finger, | ||
218 | and with ORIENTATION, one can detect twisting of fingers. | ||
219 | |||
220 | |||
173 | Notes | 221 | Notes |
174 | ----- | 222 | ----- |
175 | 223 | ||
@@ -185,11 +233,6 @@ where examples can be found. | |||
185 | difference between the contact position and the approaching tool position | 233 | difference between the contact position and the approaching tool position |
186 | could be used to derive tilt. | 234 | could 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/. |
189 | time of writing (April 2009), the MT protocol is not yet merged, and the | ||
190 | prototype implements finger matching, basic mouse support and two-finger | ||
191 | scrolling. The project aims at improving the quality of current multi-touch | ||
192 | functionality available in the Synaptics X driver, and in addition | ||
193 | implement 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. |