Since wcmKeys can be accessed from usbWcmGetRanges, we retrieve
the supported tool types instead of product ID for touch devices
that also report pad data. This change makes the code generic to
all touch devices that report pad data.

Signed-off-by: Ping Cheng <[email protected]>

P.S., hope it passes Peter's grammar check this time :).
From 9b0814719c220608f8085ade06c0399abdc2dfe8 Mon Sep 17 00:00:00 2001
From: Ping Cheng <[email protected]>
Date: Wed, 17 Mar 2010 22:04:42 -0700
Subject: [PATCH 2/3] use wcmKeys to check tool type

Since wcmKeys can be accessed from usbWcmGetRanges, we retrieve
the supported tool types instead of product ID for touch devices
that also report pad data. This change makes the code generic to
all touch devices that report pad data.

Signed-off-by: Ping Cheng <[email protected]>
---
 src/wcmUSB.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index e7b1f30..26c4754 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -528,16 +528,14 @@ int usbWcmGetRanges(LocalDevicePtr local)
 	unsigned long abs[NBITS(ABS_MAX)] = {0};
 	WacomDevicePtr priv = (WacomDevicePtr)local->private;
 	WacomCommonPtr common =	priv->common;
-	int is_touch;
+	int is_touch = IsTouch(priv);
 
-	is_touch = IsTouch(priv);
-	/* Bamboo P&T have both Touch and Pad types on same
-	 * device.  Its normal for this to be called for pad
-	 * case and logic requires it to act same as Touch
-	 * case.
+	/* Devices such as Bamboo P&T may have Pad data reported in the same
+	 * packet as Touch.  It's normal for Pad to be called first but logic
+	 * requires it to act the same as Touch.
 	 */
-	if (IsPad(priv) &&
-	    common->tablet_id >= 0xd0 && common->tablet_id <= 0xd3)
+	if (ISBITSET(common->wcmKeys, BTN_TOOL_DOUBLETAP)
+	     && ISBITSET(common->wcmKeys, BTN_TOOL_FINGER))
 		is_touch = 1;
 
 	if (ioctl(local->fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0)
-- 
1.6.6.1

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to