Reported-by: E. Holzminister <[email protected]>
Tested-by: Vu Ngoc San <[email protected]>
Tested-by: E. Holzminister <[email protected]>
Signed-off-by: Ping Cheng <[email protected]>
---
src/wcmCommon.c | 51 ++++++++++++++++++++++++++++++++++++++++++---------
src/xf86WacomDefs.h | 3 +++
2 files changed, 45 insertions(+), 9 deletions(-)
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 031fe2d..37737bb 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -384,15 +384,27 @@ static int getWheelButton(InputInfoPtr pInfo, const
WacomDeviceState* ds,
}
/* emulate events for absolute wheel when it is a touch ring (on pad) */
- if ( (ds->abswheel != priv->oldWheel) && IsPad(priv) )
+ if ((ds->abswheel != priv->oldWheel) && IsPad(priv)
+ && priv->oldWheel && ds->abswheel)
{
value = priv->oldWheel - ds->abswheel;
- fakeButton = (value > 0) ? priv->wheelup : priv->wheeldn;
- *fakeKey = (value > 0) ? priv->wheel_keys[2] :
priv->wheel_keys[3];
+
+ /* don't turn direction on the first value change in case it was
+ * an user touch error
+ */
+ if (value * priv->oldWheelChange > 0)
+ {
+ fakeButton = (value > 0) ? priv->wheelup :
priv->wheeldn;
+ *fakeKey = (value > 0) ? priv->wheel_keys[2] :
priv->wheel_keys[3];
+ }
+ priv->oldWheelChange = value;
}
+ if (!ds->abswheel)
+ priv->oldWheelChange = 0;
+
/* emulate events for left strip */
- if ( ds->stripx != priv->oldStripX )
+ if (ds->stripx != priv->oldStripX && priv->oldStripX && ds->stripx)
{
int temp = 0, n, i;
for (i=1; i<14; i++)
@@ -407,12 +419,22 @@ static int getWheelButton(InputInfoPtr pInfo, const
WacomDeviceState* ds,
value -= temp;
- fakeButton = (value > 0) ? priv->striplup : priv->stripldn;
- *fakeKey = (value > 0) ? priv->strip_keys[0] :
priv->strip_keys[1];
+ /* don't turn direction on the first value change in case it was
+ * an user touch error
+ */
+ if (value * priv->oldStripXChange > 0)
+ {
+ fakeButton = (value > 0) ? priv->striplup :
priv->stripldn;
+ *fakeKey = (value > 0) ? priv->strip_keys[0] :
priv->strip_keys[1];
+ }
+ priv->oldStripXChange = value;
}
+ if (!ds->stripx)
+ priv->oldStripXChange = 0;
+
/* emulate events for right strip */
- if ( ds->stripy != priv->oldStripY )
+ if (ds->stripy != priv->oldStripY && priv->oldStripY && ds->stripy)
{
int temp = 0, n, i;
for (i=1; i<14; i++)
@@ -426,10 +448,21 @@ static int getWheelButton(InputInfoPtr pInfo, const
WacomDeviceState* ds,
}
value -= temp;
- fakeButton = (value > 0) ? priv->striprup : priv->striprdn;
- *fakeKey = (value > 0) ? priv->strip_keys[2] :
priv->strip_keys[2];
+
+ /* don't turn direction on the first value change in case it was
+ * an user touch error
+ */
+ if (value * priv->oldStripYChange > 0)
+ {
+ fakeButton = (value > 0) ? priv->striprup :
priv->striprdn;
+ *fakeKey = (value > 0) ? priv->strip_keys[2] :
priv->strip_keys[2];
+ }
+ priv->oldStripYChange = value;
}
+ if (!ds->stripy)
+ priv->oldStripYChange = 0;
+
DBG(10, priv, "send fakeButton %x with value = %d \n",
fakeButton, value);
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 8cdc9e2..f6e26ca 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -240,6 +240,9 @@ struct _WacomDeviceRec
int hardProx; /* previous hardware proximity */
int old_device_id; /* last in prox device id */
int old_serial; /* last in prox tool serial number */
+ int oldWheelChange; /* last absolute pad wheel changed */
+ int oldStripXChange; /* last pad left strip changed */
+ int oldStripYChange; /* last pad right strip changed */
int devReverseCount; /* Relative ReverseConvert called twice each
movement*/
int numScreen; /* number of configured screens */
int currentScreen; /* current screen in display */
--
1.7.2.3
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel