From: Chris Bagwell <[email protected]>

This allows unknown touchscreens to work as expected (default to
absolute mode for example).  We no longer need to update case
statement in wcmDeviceTypeKeys() each time a new ID is used with
new hardware.

Signed-off-by: Chris Bagwell <[email protected]>
---

No change in behavior for this patch but had to change function
prototype to allow using TabletSetTablet().  So removed previous
Reviewed-by.

 src/wcmUSB.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 0ea7737..30f7c07 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1613,8 +1613,19 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
                wcmEvent(common, private->wcmBTNChannel, btn_ds);
 }
 
-/* Quirks to unify the tool types for GENERIC protocol tablet PCs */
-static void usbGenericTouchscreenQuirks(unsigned long *keys, unsigned long 
*abs)
+/* Quirks to unify the tool and tablet types for GENERIC protocol tablet PCs
+ *
+ * @param[in,out] keys Contains keys queried from hardware. If a
+ *   touchscreen is detected, keys are modified to add BTN_TOOL_FINGER so
+ *   that a TOUCH device is created later.
+ * @param[in] abs Used to detect multi-touch touchscreens.  When detected,
+ *   updates keys to add possibly missing BTN_TOOL_DOUBLETAP.
+ * @param[in,out] common Used only for tablet features.  Adds TCM_TPC for
+ *   touchscreens so correct defaults, such as absolute mode, are used.
+ */
+static void usbGenericTouchscreenQuirks(unsigned long *keys,
+                                       unsigned long *abs,
+                                       WacomCommonPtr common)
 {
        /* USB Tablet PC single finger touch devices do not emit
         * BTN_TOOL_FINGER since it is a touchscreen device.
@@ -1622,7 +1633,10 @@ static void usbGenericTouchscreenQuirks(unsigned long 
*keys, unsigned long *abs)
        if (ISBITSET(keys, BTN_TOUCH) &&
                        !ISBITSET(keys, BTN_TOOL_FINGER) &&
                        !ISBITSET(keys, BTN_TOOL_PEN))
+       {
                SETBIT(keys, BTN_TOOL_FINGER); /* 1FGT */
+               TabletSetFeature(common, WCM_TPC);
+       }
 
        /* Serial Tablet PC two finger touch devices do not emit
         * BTN_TOOL_DOUBLETAP since they are not touchpads.
@@ -1672,7 +1686,7 @@ static int usbProbeKeys(InputInfoPtr pInfo)
        if (!ISBITSET(abs, ABS_MISC))
        {
                common->wcmProtocolLevel = WCM_PROTOCOL_GENERIC;
-               usbGenericTouchscreenQuirks(common->wcmKeys, abs);
+               usbGenericTouchscreenQuirks(common->wcmKeys, abs, common);
        }
 
        common->vendor_id = wacom_id.vendor;
-- 
1.7.5.2


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to