Skip to content

Commit e42a98b

Browse files
committed
input: mt: Add hovering distance axis
Touch devices capable of hovering, i.e., fingers detected a distance from the surface, are not supported by the current input MT protocol. This patch adds ABS_MT_DISTANCE, which may be used to indicate the distance between the contact and the surface. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
1 parent c5f4dec commit e42a98b

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ against the glass. The inner region will increase, and in general, the
161161
ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
162162
unity, is related to the contact pressure. For pressure-based devices,
163163
ABS_MT_PRESSURE may be used to provide the pressure on the contact area
164-
instead.
164+
instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
165+
indicate the distance between the contact and the surface.
165166

166167
In addition to the MAJOR parameters, the oval shape of the contact can be
167168
described by adding the MINOR parameters, such that MAJOR and MINOR are the
@@ -213,6 +214,12 @@ The pressure, in arbitrary units, on the contact area. May be used instead
213214
of TOUCH and WIDTH for pressure-based devices or any device with a spatial
214215
signal intensity distribution.
215216

217+
ABS_MT_DISTANCE
218+
219+
The distance, in surface units, between the contact and the surface. Zero
220+
distance means the contact is touching the surface. A positive number means
221+
the contact is hovering above the surface.
222+
216223
ABS_MT_ORIENTATION
217224

218225
The orientation of the ellipse. The value should describe a signed quarter

‎include/linux/input.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,12 @@ struct input_keymap_entry {
733733
#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
734734
#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
735735
#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
736+
#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
736737

737738
#ifdef __KERNEL__
738739
/* Implementation details, userspace should not care about these */
739740
#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR
740-
#define ABS_MT_LAST ABS_MT_PRESSURE
741+
#define ABS_MT_LAST ABS_MT_DISTANCE
741742
#endif
742743

743744
#define ABS_MAX 0x3f

0 commit comments

Comments
 (0)