summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Pfetsch <spfetsch@google.com>2020-09-02 17:59:02 -0700
committerSteve Pfetsch <spfetsch@google.com>2021-05-06 23:09:39 +0000
commit9514214348970b4a4d9e359678c073563ba258c6 (patch)
treea9231fec71a77d128a1c954fe299f2e284e016e3
parente0ee77e9af3bbf551e2cd999f6c0d3b02d49b756 (diff)
downloadfts_touch-9514214348970b4a4d9e359678c073563ba258c6.tar.gz
input: touchscreen: stm: Report edge and palm touchesandroid-s-beta-2_r0.5android-msm-redbull-4.19-s-beta-2
Map edge, palm, and cancel touches to MT_TOOL_PALM, effectively allowing them to be treated as cancel events. Signed-off-by: Steve Pfetsch <spfetsch@google.com> Change-Id: If05a00410b7d7429cb07ff16118151d1064bb87f
-rw-r--r--fts.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fts.c b/fts.c
index 63e0783..5244ad9 100644
--- a/fts.c
+++ b/fts.c
@@ -4420,13 +4420,21 @@ static void fts_offload_report(void *handle,
input_set_timestamp(info->input_dev, report->timestamp);
for (i = 0; i < MAX_COORDS; i++) {
- if (report->coords[i].status == COORD_STATUS_FINGER) {
+ if (report->coords[i].status != COORD_STATUS_INACTIVE) {
+ int mt_tool = MT_TOOL_FINGER;
+
input_mt_slot(info->input_dev, i);
touch_down = 1;
input_report_key(info->input_dev, BTN_TOUCH,
touch_down);
+
+ if (report->coords[i].status == COORD_STATUS_EDGE ||
+ report->coords[i].status == COORD_STATUS_PALM ||
+ report->coords[i].status == COORD_STATUS_CANCEL)
+ mt_tool = MT_TOOL_PALM;
+
input_mt_report_slot_state(info->input_dev,
- MT_TOOL_FINGER, 1);
+ mt_tool, 1);
input_report_abs(info->input_dev, ABS_MT_POSITION_X,
report->coords[i].x);
input_report_abs(info->input_dev, ABS_MT_POSITION_Y,