summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2011-06-25 19:38:51 -0500
committerChris Bagwell <chris@cnpbagwell.com>2011-09-04 22:24:04 -0500
commita9c7b56aa13992ec11b87c726699cf685857640c (patch)
tree0d42efd001197fdbf62d3bca9cd78e6fabfd84b0
parentcb92037af882d2479d0f677eba8be83b11632dcd (diff)
downloadxf86-input-wacom-a9c7b56aa13992ec11b87c726699cf685857640c.tar.gz
do not send touch button during gesture holdoffs
Moved 4 different places were the touchscreen button press was done to a single location. This allows to NOT send a button pressure while gesture detection is being performed. That unwanted button press could do some annoying things when trying to do a 2 finger scroll on a touchscreen. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
-rw-r--r--src/wcmISDV4.c2
-rw-r--r--src/wcmTouchFilter.c27
-rw-r--r--src/wcmUSB.c12
3 files changed, 28 insertions, 13 deletions
diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
index dbc0c6a..5a123cd 100644
--- a/src/wcmISDV4.c
+++ b/src/wcmISDV4.c
@@ -612,7 +612,7 @@ static int isdv4ParseTouchPacket(InputInfoPtr pInfo, const unsigned char *data,
ds->x = touchdata.x;
ds->y = touchdata.y;
- ds->buttons = ds->proximity = touchdata.status;
+ ds->proximity = touchdata.status;
ds->device_type = TOUCH_ID;
ds->device_id = TOUCH_DEVICE_ID;
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
index 91849f4..b788e34 100644
--- a/src/wcmTouchFilter.c
+++ b/src/wcmTouchFilter.c
@@ -194,6 +194,32 @@ static void wcmSingleFingerTap(WacomDevicePtr priv)
}
}
+/* Monitors for 1 finger touch and forces left button press or 1 finger
+ * release and will remove left button press.
+ *
+ * This function relies on wcmGestureMode will only be zero if
+ * WACOM_GESTURE_LAG_TIME has passed and still ony 1 finger on screen.
+ */
+static void wcmSingleFingerPress(WacomDevicePtr priv)
+{
+ WacomCommonPtr common = priv->common;
+ WacomChannelPtr firstChannel = common->wcmChannel;
+ WacomChannelPtr secondChannel = common->wcmChannel + 1;
+ WacomDeviceState ds[2] = { firstChannel->valid.states[0],
+ secondChannel->valid.states[0] };
+
+ DBG(10, priv, "\n");
+
+ /* This gesture is only valid on touchscreens. */
+ if (!TabletHasFeature(priv->common, WCM_LCD))
+ return;
+
+ if (ds[0].proximity && !ds[1].proximity)
+ firstChannel->valid.states[0].buttons |= 1;
+ if (!ds[0].proximity && !ds[1].proximity)
+ firstChannel->valid.states[0].buttons &= ~1;
+}
+
/* parsing gesture mode according to 2FGT data */
void wcmGestureFilter(WacomDevicePtr priv, int channel)
{
@@ -340,6 +366,7 @@ ret:
*/
if (common->wcmGesture)
wcmSingleFingerTap(priv);
+ wcmSingleFingerPress(priv);
}
}
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 4367f19..14de990 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1110,14 +1110,6 @@ 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)
- ds->buttons = mod_buttons(ds->buttons, 0,
- (event->value != -1));
break;
case ABS_MT_POSITION_X:
@@ -1223,7 +1215,6 @@ static int usbParseKeyEvent(WacomCommonPtr common,
ds->device_type = TOUCH_ID;
ds->device_id = TOUCH_DEVICE_ID;
ds->proximity = event->value;
- ds->buttons = mod_buttons(ds->buttons, 0, event->value);
}
}
break;
@@ -1253,9 +1244,6 @@ static int usbParseKeyEvent(WacomCommonPtr common,
if ((ds->proximity && !dslast->proximity) ||
(!ds->proximity && dslast->proximity))
ds->sample = (int)GetTimeInMillis();
- /* left button is always pressed for touchscreen */
- if (TabletHasFeature(common, WCM_LCD))
- ds->buttons = mod_buttons(ds->buttons, 0, event->value);
break;
case BTN_TOOL_TRIPLETAP: