Now that the touch code doesn't look in statically-defined
channels and usbChooseChannel is capable of locating channel
numbers for arbitrary tool type/serial combinations, we can
use the latter to track an aribrary number of touches without
fear of stepping on the toes of another channel.

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 7d64265..f90def9 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1176,15 +1176,18 @@ static void usbParseAbsMTEvent(WacomCommonPtr common, 
struct input_event *event)
        switch(event->code)
        {
                case ABS_MT_SLOT:
-                       if (event->value >= 0 && event->value < MAX_FINGERS)
-                               private->wcmMTChannel = event->value;
+                       if (event->value >= 0) {
+                               int serial = event->value + 1;
+                               private->wcmMTChannel = 
usbChooseChannel(common, TOUCH_ID, serial);
+                               ds = 
&common->wcmChannel[private->wcmMTChannel].work;
+                               ds->serial_num = serial;
+                       }
                        break;
 
                case ABS_MT_TRACKING_ID:
                        ds->proximity = (event->value != -1);
                        ds->device_type = TOUCH_ID;
                        ds->device_id = TOUCH_DEVICE_ID;
-                       ds->serial_num = private->wcmMTChannel+1;
                        ds->sample = (int)GetTimeInMillis();
                        break;
 
-- 
1.7.12


------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to