Skip to content

Commit a736775

Browse files
Charlie Mooneydtor
authored andcommitted
Input: add MT_TOOL_PALM
Currently there are only two "tools" that can be specified by a multi-touch driver: MT_TOOL_FINGER and MT_TOOL_PEN. In working with Elan (The touch vendor) and discussing their next-gen devices it seems that it will be useful to have more tools so that their devices can give the upper layers of the stack hints as to what is touching the sensor. In particular they have new experimental firmware that can better differentiate between palms vs fingertips and would like to plumb a patch so that we can use their hints in higher-level gesture soft- ware. The firmware on the device can reasonably do a better job of palm detection because it has access to all of the raw sensor readings as opposed to just the width/pressure/etc that are exposed by the driver. As such, the firmware can characterize what a palm looks like in much finer-grained detail and this change would allow such a device to share its findings with the kernel. Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 09d042a commit a736775

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Documentation/input/multi-touch-protocol.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,12 @@ ABS_MT_TOOL_TYPE
312312

313313
The type of approaching tool. A lot of kernel drivers cannot distinguish
314314
between different tool types, such as a finger or a pen. In such cases, the
315-
event should be omitted. The protocol currently supports MT_TOOL_FINGER and
316-
MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
317-
drivers should instead use input_mt_report_slot_state().
315+
event should be omitted. The protocol currently supports MT_TOOL_FINGER,
316+
MT_TOOL_PEN, and MT_TOOL_PALM [2]. For type B devices, this event is handled
317+
by input core; drivers should instead use input_mt_report_slot_state().
318+
A contact's ABS_MT_TOOL_TYPE may change over time while still touching the
319+
device, because the firmware may not be able to determine which tool is being
320+
used when it first appears.
318321

319322
ABS_MT_BLOB_ID
320323

include/uapi/linux/input.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,8 @@ struct input_keymap_entry {
972972
*/
973973
#define MT_TOOL_FINGER 0
974974
#define MT_TOOL_PEN 1
975-
#define MT_TOOL_MAX 1
975+
#define MT_TOOL_PALM 2
976+
#define MT_TOOL_MAX 2
976977

977978
/*
978979
* Values describing the status of a force-feedback effect

0 commit comments

Comments
 (0)