Touchscrren is in absolute mode. Send left click down/up when
the first finger touches/leaves the tablet.

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

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 6fe5926..5669e1a 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -982,9 +982,16 @@ static int usbParseAbsEvent(WacomCommonPtr common,
        return change;
 }
 
+#define MOD_BUTTONS(bit, value) do { \
+       shift = 1<<bit; \
+       ds->buttons = (((value) != 0) ? \
+                      (ds->buttons | (shift)) : (ds->buttons & ~(shift))); \
+        } while (0)
+
 static int usbParseAbsMTEvent(WacomCommonPtr common, struct input_event *event)
 {
        int change = 1;
+       int shift;
        wcmUSBData* private = common->private;
        WacomDeviceState *ds;
 
@@ -1003,6 +1010,13 @@ static int usbParseAbsMTEvent(WacomCommonPtr common, 
struct input_event *event)
                        ds->device_id = TOUCH_DEVICE_ID;
                        ds->serial_num = private->wcmMTChannel+1;
                        ds->sample = (int)GetTimeInMillis();
+
+                       /* Send left click down/up for touchscreen
+                        * when the first finger touches/leaves the tablet.
+                        */
+                       if (TabletHasFeature(common, WCM_LCD) &&
+                                       !private->wcmMTChannel)
+                               MOD_BUTTONS(0, event->value != -1);
                        break;
 
                case ABS_MT_POSITION_X:
@@ -1042,12 +1056,6 @@ static struct
        { PAD_ID,    BTN_0              }
 };
 
-#define MOD_BUTTONS(bit, value) do { \
-       shift = 1<<bit; \
-       ds->buttons = (((value) != 0) ? \
-                      (ds->buttons | (shift)) : (ds->buttons & ~(shift))); \
-        } while (0)
-
 static int usbParseKeyEvent(WacomCommonPtr common,
                            struct input_event *event, WacomDeviceState *ds,
                            WacomDeviceState *dslast)
-- 
1.7.4


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to