aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/input
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-06-27 03:53:47 -0400
committerHenrik Rydberg <rydberg@euromail.se>2012-07-05 01:13:51 -0400
commitcab7faca5e446b84e829d57d2095035d72edba09 (patch)
tree2dd72400210b44cdc0d85edb4d3f46de21138b04 /Documentation/input
parentfdf804210f297b7a114fa7a216c2ab65b0f693da (diff)
Input: MT - Include win8 support
The newly released HID protocol for win8 multitouch devices is capable of transmitting more information about each touch. In particular, it includes details useful for touch alignment. This patch completes the MT protocol with the ABS_MT_TOOL_X/Y events, and documents how to map win8 devices. Cc: Stephane Chatty <chatty@enac.fr> Cc: Benjamin Tissoires <benjamin.tissoires@enac.fr> Cc: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'Documentation/input')
-rw-r--r--Documentation/input/multi-touch-protocol.txt118
1 files changed, 92 insertions, 26 deletions
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index 543101c5bf26..2c179613f81b 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -162,26 +162,48 @@ are divided into categories, to allow for partial implementation. The
162minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which 162minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which
163allows for multiple contacts to be tracked. If the device supports it, the 163allows for multiple contacts to be tracked. If the device supports it, the
164ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size 164ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size
165of the contact area and approaching contact, respectively. 165of the contact area and approaching tool, respectively.
166 166
167The TOUCH and WIDTH parameters have a geometrical interpretation; imagine 167The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
168looking through a window at someone gently holding a finger against the 168looking through a window at someone gently holding a finger against the
169glass. You will see two regions, one inner region consisting of the part 169glass. You will see two regions, one inner region consisting of the part
170of the finger actually touching the glass, and one outer region formed by 170of the finger actually touching the glass, and one outer region formed by
171the perimeter of the finger. The diameter of the inner region is the 171the perimeter of the finger. The center of the touching region (a) is
172ABS_MT_TOUCH_MAJOR, the diameter of the outer region is 172ABS_MT_POSITION_X/Y and the center of the approaching finger (b) is
173ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder 173ABS_MT_TOOL_X/Y. The touch diameter is ABS_MT_TOUCH_MAJOR and the finger
174against the glass. The inner region will increase, and in general, the 174diameter is ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger
175ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than 175harder against the glass. The touch region will increase, and in general,
176unity, is related to the contact pressure. For pressure-based devices, 176the ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller
177than unity, is related to the contact pressure. For pressure-based devices,
177ABS_MT_PRESSURE may be used to provide the pressure on the contact area 178ABS_MT_PRESSURE may be used to provide the pressure on the contact area
178instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to 179instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
179indicate the distance between the contact and the surface. 180indicate the distance between the contact and the surface.
180 181
181In addition to the MAJOR parameters, the oval shape of the contact can be 182
182described by adding the MINOR parameters, such that MAJOR and MINOR are the 183 Linux MT Win8
183major and minor axis of an ellipse. Finally, the orientation of the oval 184 __________ _______________________
184shape can be describe with the ORIENTATION parameter. 185 / \ | |
186 / \ | |
187 / ____ \ | |
188 / / \ \ | |
189 \ \ a \ \ | a |
190 \ \____/ \ | |
191 \ \ | |
192 \ b \ | b |
193 \ \ | |
194 \ \ | |
195 \ \ | |
196 \ / | |
197 \ / | |
198 \ / | |
199 \__________/ |_______________________|
200
201
202In addition to the MAJOR parameters, the oval shape of the touch and finger
203regions can be described by adding the MINOR parameters, such that MAJOR
204and MINOR are the major and minor axis of an ellipse. The orientation of
205the touch ellipse can be described with the ORIENTATION parameter, and the
206direction of the finger ellipse is given by the vector (a - b).
185 207
186For type A devices, further specification of the touch shape is possible 208For type A devices, further specification of the touch shape is possible
187via ABS_MT_BLOB_ID. 209via ABS_MT_BLOB_ID.
@@ -224,7 +246,7 @@ tool. Omit if circular [4].
224The above four values can be used to derive additional information about 246The above four values can be used to derive additional information about
225the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates 247the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
226the notion of pressure. The fingers of the hand and the palm all have 248the notion of pressure. The fingers of the hand and the palm all have
227different characteristic widths [1]. 249different characteristic widths.
228 250
229ABS_MT_PRESSURE 251ABS_MT_PRESSURE
230 252
@@ -240,17 +262,24 @@ the contact is hovering above the surface.
240 262
241ABS_MT_ORIENTATION 263ABS_MT_ORIENTATION
242 264
243The orientation of the ellipse. The value should describe a signed quarter 265The orientation of the touching ellipse. The value should describe a signed
244of a revolution clockwise around the touch center. The signed value range 266quarter of a revolution clockwise around the touch center. The signed value
245is arbitrary, but zero should be returned for a finger aligned along the Y 267range is arbitrary, but zero should be returned for an ellipse aligned with
246axis of the surface, a negative value when finger is turned to the left, and 268the Y axis of the surface, a negative value when the ellipse is turned to
247a positive value when finger turned to the right. When completely aligned with 269the left, and a positive value when the ellipse is turned to the
248the X axis, the range max should be returned. Orientation can be omitted 270right. When completely aligned with the X axis, the range max should be
249if the touching object is circular, or if the information is not available 271returned.
250in the kernel driver. Partial orientation support is possible if the device 272
251can distinguish between the two axis, but not (uniquely) any values in 273Touch ellipsis are symmetrical by default. For devices capable of true 360
252between. In such cases, the range of ABS_MT_ORIENTATION should be [0, 1] 274degree orientation, the reported orientation must exceed the range max to
253[4]. 275indicate more than a quarter of a revolution. For an upside-down finger,
276range max * 2 should be returned.
277
278Orientation can be omitted if the touch area is circular, or if the
279information is not available in the kernel driver. Partial orientation
280support is possible if the device can distinguish between the two axis, but
281not (uniquely) any values in between. In such cases, the range of
282ABS_MT_ORIENTATION should be [0, 1] [4].
254 283
255ABS_MT_POSITION_X 284ABS_MT_POSITION_X
256 285
@@ -260,6 +289,23 @@ ABS_MT_POSITION_Y
260 289
261The surface Y coordinate of the center of the touching ellipse. 290The surface Y coordinate of the center of the touching ellipse.
262 291
292ABS_MT_TOOL_X
293
294The surface X coordinate of the center of the approaching tool. Omit if
295the device cannot distinguish between the intended touch point and the
296tool itself.
297
298ABS_MT_TOOL_Y
299
300The surface Y coordinate of the center of the approaching tool. Omit if the
301device cannot distinguish between the intended touch point and the tool
302itself.
303
304The four position values can be used to separate the position of the touch
305from the position of the tool. If both positions are present, the major
306tool axis points towards the touch point [1]. Otherwise, the tool axes are
307aligned with the touch axes.
308
263ABS_MT_TOOL_TYPE 309ABS_MT_TOOL_TYPE
264 310
265The type of approaching tool. A lot of kernel drivers cannot distinguish 311The type of approaching tool. A lot of kernel drivers cannot distinguish
@@ -305,6 +351,28 @@ The range of ABS_MT_ORIENTATION should be set to [0, 1], to indicate that
305the device can distinguish between a finger along the Y axis (0) and a 351the device can distinguish between a finger along the Y axis (0) and a
306finger along the X axis (1). 352finger along the X axis (1).
307 353
354For win8 devices with both T and C coordinates, the position mapping is
355
356 ABS_MT_POSITION_X := T_X
357 ABS_MT_POSITION_Y := T_Y
358 ABS_MT_TOOL_X := C_X
359 ABS_MT_TOOL_X := C_Y
360
361Unfortunately, there is not enough information to specify both the touching
362ellipse and the tool ellipse, so one has to resort to approximations. One
363simple scheme, which is compatible with earlier usage, is:
364
365 ABS_MT_TOUCH_MAJOR := min(X, Y)
366 ABS_MT_TOUCH_MINOR := <not used>
367 ABS_MT_ORIENTATION := <not used>
368 ABS_MT_WIDTH_MAJOR := min(X, Y) + distance(T, C)
369 ABS_MT_WIDTH_MINOR := min(X, Y)
370
371Rationale: We have no information about the orientation of the touching
372ellipse, so approximate it with an inscribed circle instead. The tool
373ellipse should align with the the vector (T - C), so the diameter must
374increase with distance(T, C). Finally, assume that the touch diameter is
375equal to the tool thickness, and we arrive at the formulas above.
308 376
309Finger Tracking 377Finger Tracking
310--------------- 378---------------
@@ -338,9 +406,7 @@ subsequent events of the same type refer to different fingers.
338For example usage of the type A protocol, see the bcm5974 driver. For 406For example usage of the type A protocol, see the bcm5974 driver. For
339example usage of the type B protocol, see the hid-egalax driver. 407example usage of the type B protocol, see the hid-egalax driver.
340 408
341[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the 409[1] Also, the difference (TOOL_X - POSITION_X) can be used to model tilt.
342difference between the contact position and the approaching tool position
343could be used to derive tilt.
344[2] The list can of course be extended. 410[2] The list can of course be extended.
345[3] The mtdev project: http://bitmath.org/code/mtdev/. 411[3] The mtdev project: http://bitmath.org/code/mtdev/.
346[4] See the section on event computation. 412[4] See the section on event computation.