@@ -162,26 +162,48 @@ are divided into categories, to allow for partial implementation. The
162162minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which
163163allows for multiple contacts to be tracked. If the device supports it, the
164164ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size
165- of the contact area and approaching contact , respectively.
165+ of the contact area and approaching tool , respectively.
166166
167167The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
168168looking through a window at someone gently holding a finger against the
169169glass. You will see two regions, one inner region consisting of the part
170170of the finger actually touching the glass, and one outer region formed by
171- the perimeter of the finger. The diameter of the inner region is the
172- ABS_MT_TOUCH_MAJOR, the diameter of the outer region is
173- ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder
174- against the glass. The inner region will increase, and in general, the
175- ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
176- unity, is related to the contact pressure. For pressure-based devices,
171+ the perimeter of the finger. The center of the touching region (a) is
172+ ABS_MT_POSITION_X/Y and the center of the approaching finger (b) is
173+ ABS_MT_TOOL_X/Y. The touch diameter is ABS_MT_TOUCH_MAJOR and the finger
174+ diameter is ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger
175+ harder against the glass. The touch region will increase, and in general,
176+ the ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller
177+ than unity, is related to the contact pressure. For pressure-based devices,
177178ABS_MT_PRESSURE may be used to provide the pressure on the contact area
178179instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
179180indicate the distance between the contact and the surface.
180181
181- In addition to the MAJOR parameters, the oval shape of the contact can be
182- described by adding the MINOR parameters, such that MAJOR and MINOR are the
183- major and minor axis of an ellipse. Finally, the orientation of the oval
184- shape can be describe with the ORIENTATION parameter.
182+
183+ Linux MT Win8
184+ __________ _______________________
185+ / \ | |
186+ / \ | |
187+ / ____ \ | |
188+ / / \ \ | |
189+ \ \ a \ \ | a |
190+ \ \____/ \ | |
191+ \ \ | |
192+ \ b \ | b |
193+ \ \ | |
194+ \ \ | |
195+ \ \ | |
196+ \ / | |
197+ \ / | |
198+ \ / | |
199+ \__________/ |_______________________|
200+
201+
202+ In addition to the MAJOR parameters, the oval shape of the touch and finger
203+ regions can be described by adding the MINOR parameters, such that MAJOR
204+ and MINOR are the major and minor axis of an ellipse. The orientation of
205+ the touch ellipse can be described with the ORIENTATION parameter, and the
206+ direction of the finger ellipse is given by the vector (a - b).
185207
186208For type A devices, further specification of the touch shape is possible
187209via ABS_MT_BLOB_ID.
@@ -224,7 +246,7 @@ tool. Omit if circular [4].
224246The above four values can be used to derive additional information about
225247the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
226248the notion of pressure. The fingers of the hand and the palm all have
227- different characteristic widths [1] .
249+ different characteristic widths.
228250
229251ABS_MT_PRESSURE
230252
@@ -240,17 +262,24 @@ the contact is hovering above the surface.
240262
241263ABS_MT_ORIENTATION
242264
243- The orientation of the ellipse. The value should describe a signed quarter
244- of a revolution clockwise around the touch center. The signed value range
245- is arbitrary, but zero should be returned for a finger aligned along the Y
246- axis of the surface, a negative value when finger is turned to the left, and
247- a positive value when finger turned to the right. When completely aligned with
248- the X axis, the range max should be returned. Orientation can be omitted
249- if the touching object is circular, or if the information is not available
250- in the kernel driver. Partial orientation support is possible if the device
251- can distinguish between the two axis, but not (uniquely) any values in
252- between. In such cases, the range of ABS_MT_ORIENTATION should be [0, 1]
253- [4].
265+ The orientation of the touching ellipse. The value should describe a signed
266+ quarter of a revolution clockwise around the touch center. The signed value
267+ range is arbitrary, but zero should be returned for an ellipse aligned with
268+ the Y axis of the surface, a negative value when the ellipse is turned to
269+ the left, and a positive value when the ellipse is turned to the
270+ right. When completely aligned with the X axis, the range max should be
271+ returned.
272+
273+ Touch ellipsis are symmetrical by default. For devices capable of true 360
274+ degree orientation, the reported orientation must exceed the range max to
275+ indicate more than a quarter of a revolution. For an upside-down finger,
276+ range max * 2 should be returned.
277+
278+ Orientation can be omitted if the touch area is circular, or if the
279+ information is not available in the kernel driver. Partial orientation
280+ support is possible if the device can distinguish between the two axis, but
281+ not (uniquely) any values in between. In such cases, the range of
282+ ABS_MT_ORIENTATION should be [0, 1] [4].
254283
255284ABS_MT_POSITION_X
256285
@@ -260,6 +289,23 @@ ABS_MT_POSITION_Y
260289
261290The surface Y coordinate of the center of the touching ellipse.
262291
292+ ABS_MT_TOOL_X
293+
294+ The surface X coordinate of the center of the approaching tool. Omit if
295+ the device cannot distinguish between the intended touch point and the
296+ tool itself.
297+
298+ ABS_MT_TOOL_Y
299+
300+ The surface Y coordinate of the center of the approaching tool. Omit if the
301+ device cannot distinguish between the intended touch point and the tool
302+ itself.
303+
304+ The four position values can be used to separate the position of the touch
305+ from the position of the tool. If both positions are present, the major
306+ tool axis points towards the touch point [1]. Otherwise, the tool axes are
307+ aligned with the touch axes.
308+
263309ABS_MT_TOOL_TYPE
264310
265311The 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
305351the device can distinguish between a finger along the Y axis (0) and a
306352finger along the X axis (1).
307353
354+ For 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+
361+ Unfortunately, there is not enough information to specify both the touching
362+ ellipse and the tool ellipse, so one has to resort to approximations. One
363+ simple 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+
371+ Rationale: We have no information about the orientation of the touching
372+ ellipse, so approximate it with an inscribed circle instead. The tool
373+ ellipse should align with the the vector (T - C), so the diameter must
374+ increase with distance(T, C). Finally, assume that the touch diameter is
375+ equal to the tool thickness, and we arrive at the formulas above.
308376
309377Finger Tracking
310378---------------
@@ -338,9 +406,7 @@ subsequent events of the same type refer to different fingers.
338406For example usage of the type A protocol, see the bcm5974 driver. For
339407example usage of the type B protocol, see the hid-egalax driver.
340408
341- [1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the
342- difference between the contact position and the approaching tool position
343- could be used to derive tilt.
409+ [1] Also, the difference (TOOL_X - POSITION_X) can be used to model tilt.
344410[2] The list can of course be extended.
345411[3] The mtdev project: http://bitmath.org/code/mtdev/.
346412[4] See the section on event computation.
0 commit comments