>From 6097f617de49db3592322da66253a1b88090d157 Mon Sep 17 00:00:00 2001 From: KT Liao Date: Wed, 25 May 2016 15:52:09 +0800 Subject: [PATCH] Input: drivers/input/input-mt.c Emit BTN_TOO_FINGER in function input_mt_report_pointer_emulation if touchpad meets hover condition Signed-off-by: KT Liao --- drivers/input/input-mt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 54fce56..486b1ca 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -218,8 +218,17 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) } input_event(dev, EV_KEY, BTN_TOUCH, count > 0); - if (use_count) - input_mt_report_finger_count(dev, count); + + if (use_count) { + if (count == 0 && + !test_bit(ABS_MT_DISTANCE, dev->absbit) && + test_bit(ABS_DISTANCE, dev->absbit) && + input_abs_get_val(dev, ABS_DISTANCE) != 0) { + input_report_key(dev, BTN_TOOL_FINGER, input_abs_get_val(dev, ABS_DISTANCE)); + count = 1; + } + input_mt_report_finger_count(dev, count); + } if (oldest) { int x = input_mt_get_value(oldest, ABS_MT_POSITION_X); -- 2.7.4