We borrowed _TAP_ for 2FGT Tablet PC support when MT protocol was
not available (before kernel 2.6.30 was released). MT support in
the kernel is getting stable now. To move Tablet PC to MT format,
we face two issues:

1. USB Tablet PC 1FGT devices will not emit BTN_TOOL_FINGER event
since it is a touchscreen device.

2. Serial Tablet PC 2FGT devices do not emit BTN_TOOL_DOUBLETAP
event since they are not touchpads.

This patch add those keys back to the supported key array so we
can retrieve the proper keys when we need to decide the features
that are associated with the device.

Changes to v1:

1. Replace usbGenericTPCQuirks with usbGenericTouchscreenQuirks
2. Remove USB from the second item above

as suggested by Chris Bagwell.

Signed-off-by: Ping Cheng <pingli...@gmail.com>
Acked-by: Chris Bagwell <ch...@cnpbagwell.com>
---
 src/wcmUSB.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 8343032..689378a 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1340,6 +1340,24 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        }
 }
 
+/* Quirks to unify the tool types for GENERIC protocol tablet PCs */
+static void usbGenericTouchscreenQuirks(unsigned long *keys, unsigned long 
*abs)
+{
+       /* USB Tablet PC signle finger touch devices do not emit
+        * BTN_TOOL_FINGER since it is a touchscreen device.
+        */
+       if (ISBITSET(keys, BTN_TOUCH) &&
+                       !ISBITSET(keys, BTN_TOOL_FINGER) &&
+                       !ISBITSET(keys, BTN_TOOL_PEN))
+               SETBIT(keys, BTN_TOOL_FINGER); /* 1FGT */
+
+       /* Serial Tablet PC two finger touch devices do not emit
+        * BTN_TOOL_DOUBLETAP since they are not touchpads.
+        */
+       if (ISBITSET(abs, ABS_MT_SLOT) && !ISBITSET(keys, BTN_TOOL_DOUBLETAP))
+               SETBIT(keys, BTN_TOOL_DOUBLETAP); /* 2FGT */
+}
+
 /**
  * Query the device's fd for the key bits and the tablet ID. Returns the ID
  * on success or 0 on failure.
@@ -1379,7 +1397,10 @@ static int usbProbeKeys(InputInfoPtr pInfo)
         * generic.
         */
        if (!ISBITSET(abs, ABS_MISC))
+       {
                common->wcmProtocolLevel = WCM_PROTOCOL_GENERIC;
+               usbGenericTouchscreenQuirks(common->wcmKeys, abs);
+       }
 
        return wacom_id.product;
 }
-- 
1.7.4


------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to