Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1404051

Re: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger

From 'Dmitry Torokhov' <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger
Date 2016-05-20 03:00 +0200
Message-ID <rAGXf-728-3@gated-at.bofh.it> (permalink)
References <rkJFL-3PD-5@gated-at.bofh.it> <rzp2q-6ui-17@gated-at.bofh.it> <rzp2q-6ui-15@gated-at.bofh.it> <rzuY9-1Ei-5@gated-at.bofh.it> <rzOau-5Hf-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 17, 2016 at 10:20:40PM +0800, 廖崇榮 wrote:
> Hi Dmitry,
> 
> I want to confirm my thought for your idea to avoid misunderstanding.
> I think you want to encapsulate " BTN_TOOL_FINGER" in the [input_mt_report_pointer_emulation] if hover happen.
> Vendor driver only report "ABS_DISTANCE" and let [input_mt_report_pointer_emulation] emit BTN_TOOL_FINGER report without change function parameter.
> 
> Please let me know if my misunderstand about your idea.

Yes, that is correct. Something like this:

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index 54fce56..a1bbec9 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -218,8 +218,23 @@ 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)
+
+	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) {
+			/*
+			 * Force reporting BTN_TOOL_FINGER for devices that
+			 * only report general hover (and not per-contact
+			 * distance) when contact is in proximity but not
+			 * on the surface.
+			 */
+			count = 1;
+		}
+
 		input_mt_report_finger_count(dev, count);
+	}
 
 	if (oldest) {
 		int x = input_mt_get_value(oldest, ABS_MT_POSITION_X);

-- 
Dmitry

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger 廖崇榮 <kt.liao@emc.com.tw> - 2016-05-16 13:40 +0200
  Re: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event  trigger Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-05-16 20:00 +0200
    RE: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger 廖崇榮 <kt.liao@emc.com.tw> - 2016-05-17 16:30 +0200
      Re: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event  trigger 'Dmitry Torokhov' <dmitry.torokhov@gmail.com> - 2016-05-20 03:00 +0200
        RE: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger 廖崇榮 <kt.liao@emc.com.tw> - 2016-05-23 16:30 +0200
          Re: [PATCH] Input: Change BTN_TOOL_FINGER flag when hover event  trigger 'Dmitry Torokhov' <dmitry.torokhov@gmail.com> - 2016-05-26 02:30 +0200

csiph-web