The code in usbParseKeyEvent which is supposed to set a device
ID ignores the case of devices which use the generic protocol.
This patch changes the logic so that a device ID is assigned
from the BTN_* event for any non-protocol 5 device.

Fixes: https://sourceforge.net/p/linuxwacom/bugs/246/
Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 2e4d39e..5696fc6 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1301,7 +1301,7 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                case BTN_TOOL_BRUSH:
                case BTN_TOOL_AIRBRUSH:
                        /* V5 tools use ABS_MISC to report device_id */
-                       if (common->wcmProtocolLevel == WCM_PROTOCOL_4)
+                       if (common->wcmProtocolLevel != WCM_PROTOCOL_5)
                                ds->device_id = STYLUS_DEVICE_ID;
                        ds->proximity = (event->value != 0);
                        DBG(6, common,
@@ -1311,7 +1311,7 @@ static void usbParseKeyEvent(WacomCommonPtr common,
 
                case BTN_TOOL_RUBBER:
                        /* V5 tools use ABS_MISC to report device_id */
-                       if (common->wcmProtocolLevel == WCM_PROTOCOL_4)
+                       if (common->wcmProtocolLevel != WCM_PROTOCOL_5)
                                ds->device_id = ERASER_DEVICE_ID;
                        ds->proximity = (event->value != 0);
                        DBG(6, common,
@@ -1325,7 +1325,7 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                            "USB mouse detected %x (value=%d)\n",
                            event->code, event->value);
                        /* V5 tools use ABS_MISC to report device_id */
-                       if (common->wcmProtocolLevel == WCM_PROTOCOL_4)
+                       if (common->wcmProtocolLevel != WCM_PROTOCOL_5)
                                ds->device_id = CURSOR_DEVICE_ID;
                        ds->proximity = (event->value != 0);
                        break;
-- 
2.0.0


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to