linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gerecke <killertofu@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linux Input <linux-input@vger.kernel.org>,
	Ping Cheng <pinglinux@gmail.com>,
	Jason Gerecke <jgerecke@wacom.com>, Dima Zavin <dima@android.com>,
	Jason Gerecke <killertofu@gmail.com>
Subject: [PATCH 3/4] Fix hover in Android (Gingerbread)
Date: Thu,  7 Jul 2011 14:04:59 -0700	[thread overview]
Message-ID: <1310072700-2829-3-git-send-email-killertofu@gmail.com> (raw)
In-Reply-To: <1310072700-2829-1-git-send-email-killertofu@gmail.com>

As of Gingerbread, Android does not pay attention to if the pen
is in contact with the screen, or merely in proximity. Since the
Xorg Wacom driver does not make use of MT pen events, we simply
do not emit MT data while hovering.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
 Now being sent upstream to LKML at the behest of Google.

 drivers/input/touchscreen/wacom_w8001.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index e94a21a..40ed685 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -279,10 +279,12 @@ static void report_pen_events(struct w8001 *w8001, struct w8001_coord *coord)
 	input_report_key(dev, BTN_STYLUS, coord->f1);
 	input_report_key(dev, w8001->type, coord->rdy);
 
-	input_report_abs(dev, ABS_MT_POSITION_X, coord->x);
-	input_report_abs(dev, ABS_MT_POSITION_Y, coord->y);
-	input_report_abs(dev, ABS_MT_PRESSURE, coord->pen_pressure);
-	input_report_abs(dev, ABS_MT_TOOL_TYPE, MT_TOOL_PEN);
+	if (coord->pen_pressure > 0) {
+		input_report_abs(dev, ABS_MT_POSITION_X, coord->x);
+		input_report_abs(dev, ABS_MT_POSITION_Y, coord->y);
+		input_report_abs(dev, ABS_MT_PRESSURE, coord->pen_pressure);
+		input_report_abs(dev, ABS_MT_TOOL_TYPE, MT_TOOL_PEN);
+	}
 
 	input_mt_sync(dev);
 	input_sync(dev);
-- 
1.7.5.2


  parent reply	other threads:[~2011-07-07 21:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 21:04 [PATCH 1/4] Revert to anonymous 'type A' MT protocol for touch Jason Gerecke
2011-07-07 21:04 ` [PATCH 2/4] Use MT (in addition to single-touch) protocol for all events Jason Gerecke
2011-07-07 21:04 ` Jason Gerecke [this message]
2011-07-08  1:13   ` [PATCH 3/4] Fix hover in Android (Gingerbread) Jaya Kumar
2011-07-08 21:04     ` Jason Gerecke
2011-07-09  6:16       ` Dima Zavin
2011-07-09  6:15   ` Jeffrey Brown
2011-07-09  6:22     ` Dima Zavin
2011-07-07 21:05 ` [PATCH 4/4] Only report multi-touch when pen is out of range Jason Gerecke
2011-07-09  6:19   ` Jeffrey Brown
2011-07-07 21:35 ` [PATCH 1/4] Revert to anonymous 'type A' MT protocol for touch Dmitry Torokhov
2011-07-07 21:52   ` Dima Zavin
2011-07-07 22:32     ` Jason Gerecke
2011-08-03  4:31     ` Jiejing.Zhang 

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310072700-2829-3-git-send-email-killertofu@gmail.com \
    --to=killertofu@gmail.com \
    --cc=dima@android.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jgerecke@wacom.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pinglinux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).