summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpingc <pingc>2006-11-30 18:31:17 +0000
committerpingc <pingc>2006-11-30 18:31:17 +0000
commita4f118a610c3294ea1533bf2643bb89b2092707c (patch)
treeb360bf4eef76eee4601cfbf4097bd60876c15478
parentd3d22533c6227a884a1865a4b636050f0e657f9f (diff)
downloadxf86-input-wacom-a4f118a610c3294ea1533bf2643bb89b2092707c.tar.gz
Fixed Relative Cursor force out-prox issuerelease-0_7_7release-0.7.7
-rw-r--r--ChangeLog33
-rwxr-xr-xsrc/util/xsetwacom.c18
-rwxr-xr-xsrc/xdrv/wcmCommon.c50
-rwxr-xr-xsrc/xdrv/wcmConfig.c26
-rwxr-xr-xsrc/xdrv/wcmISDV4.c1
-rwxr-xr-xsrc/xdrv/wcmUSB.c15
-rwxr-xr-xsrc/xdrv/xf86Wacom.c25
-rwxr-xr-xsrc/xdrv/xf86Wacom.h16
8 files changed, 79 insertions, 105 deletions
diff --git a/ChangeLog b/ChangeLog
index bc579e6..b40280c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-11-30 Ping Cheng <pingc@wacom.com>
+ * Fixed cursor relative out-prox issue
+ * Changed CursorProx option from 2 inputs into 1
+ * updated xsetwacom and wacom_drv
+ * Split wacom.c under 2.6.11 into 4 files
+ * label 0.7.7 for testing
+
2006-11-21 Ping Cheng <pingc@wacom.com>
* Updated web scripts (Magnus Vigerlöf)
* Removed serial number and device ID in 4th - 5th
@@ -168,29 +175,3 @@
2006-03-14 Ping Cheng <pingc@wacom.com>
* Fixed a relative distance bug in wcmCommon.c
* Ready to release 0.7.3 as beta
-
-2006-03-06 Ping Cheng <pingc@wacom.com>
- * Fixed a Volito bug (Kirill Frolov)
- * Fixed a xsetwacom.c typo
- * Supporting tablet attach/detach while X driver running (Christian Lupien)
- * Remove SYSCALL from xf86 calls (Christian Lupien)
- * Swapped USB tablet wheel directions (Christian Lupien)
-
-2006-02-27 Ping Cheng <pingc@wacom.com>
- * Updated website
- * Support 2.6.15
- * Fixed a Graphire 2 issue
-
-2006-02-11 Ping Cheng <pingc@wacom.com>
- * Updated website
- * Added DTF 521, I3 12x12, and I3 12x19
-
-2006-01-09 Ping Cheng <pingc@wacom.com>
- * Restructured the website
- * Added a page for Tablet PC
- * Added a mini-HOWTO page for Fedora Core 4
- * Updated application developers' page
-
-2005-12-21 Ping Cheng <pingc@wacom.com>
- * Updated website
- * Released 0.7.2
diff --git a/src/util/xsetwacom.c b/src/util/xsetwacom.c
index 7d7547e..d80b7ff 100755
--- a/src/util/xsetwacom.c
+++ b/src/util/xsetwacom.c
@@ -30,7 +30,7 @@
#define XSETWACOM_VERSION "0.0.7"
#include "wacomcfg.h"
-#include "../include/Xwacom.h" /* give use raw access to parameter values */
+#include "../include/Xwacom.h" /* give us raw access to parameter values */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -324,19 +324,21 @@ static PARAMINFO gParamInfo[] =
RANGE, 0, 1, BOOLEAN_VALUE, 1 },
{ "CursorProx",
- "Sets cursor distance and hysteresis for proximity-out "
- "in distance from the tablet. distance = value&0xffff. "
- "hysteresis = (value>>16) & 0xffff (default is 256 8)",
- XWACOM_PARAM_CURSORPROX, VALUE_OPTIONAL, 0, 0, 0,
- TWO_VALUES, 0x00080080 },
+ "Sets cursor distance for proximity-out "
+ "in distance from the tablet. "
+ "default is 10 for Intuos series, "
+ "42 for Graphire series).",
+ XWACOM_PARAM_CURSORPROX, VALUE_OPTIONAL, RANGE,
+ 0, 255, SINGLE_VALUE, 47 },
{ "Rotate",
"Sets the rotation of the tablet. "
"Values = NONE, CW, CCW, HALF (default is NONE).",
XWACOM_PARAM_ROTATE, VALUE_OPTIONAL,
- RANGE, XWACOM_VALUE_ROTATE_NONE, XWACOM_VALUE_ROTATE_HALF, SINGLE_VALUE,
+ RANGE, XWACOM_VALUE_ROTATE_NONE,
+ XWACOM_VALUE_ROTATE_HALF, SINGLE_VALUE,
XWACOM_VALUE_ROTATE_NONE },
-
+
{ "GetTabletID",
"Returns the tablet ID of the associated device. ",
XWACOM_PARAM_TID, VALUE_REQUIRED },
diff --git a/src/xdrv/wcmCommon.c b/src/xdrv/wcmCommon.c
index 6f6bca6..3661c92 100755
--- a/src/xdrv/wcmCommon.c
+++ b/src/xdrv/wcmCommon.c
@@ -562,6 +562,8 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
rx = 0;
ry = 0;
rz = 0;
+ /* initial current max distance */
+ common->wcmMaxCursorDist = ds->distance;
}
/* don't apply speed for fairly small increments */
@@ -1003,7 +1005,6 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
const WacomChannelPtr pChannel)
{
int id, idx;
- int threshold;
WacomDevicePtr priv;
LocalDevicePtr pDev = NULL;
WacomDeviceState* ds = &pChannel->valid.states[0];
@@ -1128,44 +1129,41 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
#endif /* throttle */
- /* force out-prox when heighth is beyond threshold. */
+ /* force out-prox when distance is outside wcmCursorProxoutDist. */
if (!(priv->flags & ABSOLUTE_FLAG) && IsCursor(priv))
{
if (strstr(common->wcmModel->name, "Intuos"))
{
- if (common->wcmCursorProxoutDist > filtered.distance)
- common->wcmCursorProxoutDist = filtered.distance;
+ if (common->wcmMaxCursorDist > filtered.distance)
+ common->wcmMaxCursorDist = filtered.distance;
}
else
{
- if (common->wcmCursorProxoutDist == PROXOUT_DISTANCE)
- common->wcmCursorProxoutDist = filtered.distance;
- if (common->wcmCursorProxoutDist < filtered.distance)
- common->wcmCursorProxoutDist = filtered.distance;
+ if (common->wcmMaxCursorDist < filtered.distance)
+ common->wcmMaxCursorDist = filtered.distance;
}
-
- threshold = common->wcmCursorProxoutDist;
- /* Force prox out when distance is outside of ProxoutHyst */
- if (priv->oldProximity)
- {
- if (strstr(common->wcmModel->name, "Intuos"))
- threshold += common->wcmCursorProxoutHyst;
- else
- threshold -= common->wcmCursorProxoutHyst;
- }
+ DBG(10, ErrorF("Distance over the tablet: %d, ProxoutDist: %d current min/max %d hard prox: %d\n",
+ filtered.distance, common->wcmCursorProxoutDist, common->wcmMaxCursorDist, ds->proximity));
- DBG(10, ErrorF("Distance over the tablet: %d, ProxoutDist: %d hard prox: %d\n",
- filtered.distance, common->wcmCursorProxoutDist, ds->proximity));
- if ((filtered.distance > threshold &&
- strstr(common->wcmModel->name, "Intuos")) ||
- (filtered.distance < threshold &&
- !strstr(common->wcmModel->name, "Intuos")))
+ if (priv->oldProximity)
{
- filtered.proximity = 0;
+ if (abs(filtered.distance - common->wcmMaxCursorDist) > common->wcmCursorProxoutDist)
+ filtered.proximity = 0;
}
+ /* once it is out. Don't let it in until a hard in */
+ /* or it gets inside wcmCursorProxoutDist */
+ else
+ if (abs(filtered.distance - common->wcmMaxCursorDist) > common->wcmCursorProxoutDist && ds->proximity)
+ return;
+ else if (!ds->proximity)
+ {
+ if (strstr(common->wcmModel->name, "Intuos"))
+ common->wcmMaxCursorDist = 256;
+ else
+ common->wcmMaxCursorDist = 0;
+ }
}
-
xf86WcmSendEvents(pDev, &filtered, channel);
}
diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index cf11cc5..16de7f1 100755
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -157,12 +157,15 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag)
common->wcmMMonitor = 1; /* enabled (=1) to support multi-monitor desktop. */
/* disabled (=0) when user doesn't want to move the */
/* cursor from one screen to another screen */
- common->wcmTPCButton = 0; /* set Tablet PC button on/off, default is off */
+ common->wcmTPCButtonDefault = 0; /* default Tablet PC button support is off */
+ common->wcmTPCButton =
+ common->wcmTPCButtonDefault; /* set Tablet PC button on/off */
common->wcmRotate = ROTATE_NONE; /* default tablet rotation to off */
- common->wcmCursorProxoutDist = PROXOUT_DISTANCE;
+ common->wcmMaxCursorDist = 0; /* Max distance received so far */
+ common->wcmCursorProxoutDist = 0;
/* Max mouse distance for proxy-out max/256 units */
- common->wcmCursorProxoutHyst = PROXOUT_HYSTERESIS;
- /* Proxy-out distance hysteresis in max/256 units */
+ common->wcmCursorProxoutDistDefault = PROXOUT_GRAPHIRE_DISTANCE;
+ /* default to Graphire */
return local;
}
@@ -504,18 +507,11 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
}
}
- s = xf86FindOptionValue(local->options, "CursorProx");
- if (s && !IsCursor(priv))
+ if (IsCursor(priv))
{
- int a,b;
- if ((sscanf(s,"%d,%d",&a,&b) != 2) ||
- (a < 0) || (a > 63) || (b < 0) || (b > 63))
- xf86Msg(X_CONFIG, "WACOM: CursorProx not valid\n");
- else
- {
- common->wcmCursorProxoutDist = a;
- common->wcmCursorProxoutHyst = b;
- }
+ common->wcmCursorProxoutDist = xf86SetIntOption(local->options, "CursorProx", 0);
+ if (common->wcmCursorProxoutDist < 0 || common->wcmCursorProxoutDist > 255)
+ xf86Msg(X_CONFIG, "WACOM: CursorProx invalid %d \n", common->wcmCursorProxoutDist);
}
/* Config Monitors' resoluiton in TwinView setup.
diff --git a/src/xdrv/wcmISDV4.c b/src/xdrv/wcmISDV4.c
index a75808e..4474557 100755
--- a/src/xdrv/wcmISDV4.c
+++ b/src/xdrv/wcmISDV4.c
@@ -111,6 +111,7 @@ static void isdv4InitISDV4(WacomCommonPtr common, const char* id, float version)
common->wcmResolX = 2540; /* tablet X resolution in points/inch */
common->wcmResolY = 2540; /* tablet Y resolution in points/inch */
common->wcmTPCButton = 1; /* Tablet PC buttons on by default */
+ common->wcmTPCButtonDefault = 1;
}
static int isdv4GetRanges(LocalDevicePtr local)
{
diff --git a/src/xdrv/wcmUSB.c b/src/xdrv/wcmUSB.c
index a610e8f..842c46e 100755
--- a/src/xdrv/wcmUSB.c
+++ b/src/xdrv/wcmUSB.c
@@ -492,6 +492,11 @@ static void usbInitProtocol5(WacomCommonPtr common, const char* id,
common->wcmChannelCnt = 2;
}
common->wcmPktLength = sizeof(struct input_event);
+ common->wcmCursorProxoutDistDefault
+ = PROXOUT_INTUOS_DISTANCE;
+ /* reinitialize max here since 0 is for Graphire series */
+ common->wcmMaxCursorDist = 256;
+
}
static void usbInitProtocol4(WacomCommonPtr common, const char* id,
@@ -501,6 +506,8 @@ static void usbInitProtocol4(WacomCommonPtr common, const char* id,
common->wcmChannelCnt = 1;
common->wcmProtocolLevel = 4;
common->wcmPktLength = sizeof(struct input_event);
+ common->wcmCursorProxoutDistDefault
+ = PROXOUT_GRAPHIRE_DISTANCE;
}
int usbWcmGetRanges(LocalDevicePtr local)
@@ -608,6 +615,7 @@ static int usbDetectConfig(LocalDevicePtr local)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
+ DBG(10, ErrorF("usbDetectConfig \n"));
if (IsPad (priv))
{
priv->nbuttons = common->npadkeys;
@@ -632,6 +640,9 @@ static int usbDetectConfig(LocalDevicePtr local)
else
priv->nbuttons = common->nbuttons;
+ if (!common->wcmCursorProxoutDist)
+ common->wcmCursorProxoutDist
+ = common->wcmCursorProxoutDistDefault;
return TRUE;
}
@@ -902,10 +913,6 @@ static void usbParseChannel(WacomCommonPtr common, int channel, int serial)
}
} /* next event */
- /* reset the max proxout distance for next in */
- if (ds->device_type == CURSOR_ID && !ds->proximity)
- common->wcmCursorProxoutDist = PROXOUT_DISTANCE;
-
/* DTF720 doesn't support eraser */
if (common->tablet_id == 0xC0 && ds->device_type == ERASER_ID)
{
diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c
index dca5fca..b452c9f 100755
--- a/src/xdrv/xf86Wacom.c
+++ b/src/xdrv/xf86Wacom.c
@@ -882,15 +882,10 @@ static int xf86WcmSetParam(LocalDevicePtr local, int param, int value)
case XWACOM_PARAM_CURSORPROX:
if (IsCursor (priv))
{
- char chBuf[64];
- int d = value & 0xFFFF;
- int h = (value >> 16) & 0xFFFF;
- if ((d > 63) || (h > 63))
+ if ((value > 255) || (value < 0))
return BadValue;
- snprintf(chBuf,sizeof(chBuf),"%d,%d",d,h);
- xf86ReplaceStrOption(local->options, "CursorProx",chBuf);
- common->wcmCursorProxoutDist = d;
- common->wcmCursorProxoutHyst = h;
+ xf86ReplaceIntOption(local->options, "CursorProx",value);
+ common->wcmCursorProxoutDist = value;
}
break;
case XWACOM_PARAM_ROTATE:
@@ -1103,8 +1098,7 @@ static int xf86WcmGetParam(LocalDevicePtr local, int param)
return common->wcmTPCButton;
case XWACOM_PARAM_CURSORPROX:
if (IsCursor (priv))
- return common->wcmCursorProxoutDist |
- (common->wcmCursorProxoutHyst << 16);
+ return common->wcmCursorProxoutDist;
return -1;
case XWACOM_PARAM_TID:
return common->tablet_id;
@@ -1121,7 +1115,6 @@ static int xf86WcmGetDefaultParam(LocalDevicePtr local, int param)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
- char *s;
DBG(10, ErrorF("xf86WcmGetDefaultParam param = %d\n",param));
switch (param)
@@ -1154,15 +1147,15 @@ static int xf86WcmGetDefaultParam(LocalDevicePtr local, int param)
case XWACOM_PARAM_MMT:
return 1;
case XWACOM_PARAM_TPCBUTTON:
- s = xf86FindOptionValue(local->options, "ForceDevice");
- if ( s )
- return 1;
- else
- return 0;
+ return common->wcmTPCButtonDefault;
case XWACOM_PARAM_PRESSCURVE:
if (!IsCursor (priv) && !IsPad (priv))
return (0 << 24) | (0 << 16) | (100 << 8) | 100;
return -1;
+ case XWACOM_PARAM_CURSORPROX:
+ if (IsCursor (priv))
+ return common->wcmCursorProxoutDistDefault;
+ return -1;
case XWACOM_PARAM_GETMODEL:
xf86WcmModelToFile(local);
return 0;
diff --git a/src/xdrv/xf86Wacom.h b/src/xdrv/xf86Wacom.h
index d9ba973..d288dac 100755
--- a/src/xdrv/xf86Wacom.h
+++ b/src/xdrv/xf86Wacom.h
@@ -128,17 +128,11 @@
#define MAXTRY 3 /* max number of try to receive magic number */
#define MAX_COORD_RES 1270.0 /* Resolution of the returned MaxX and MaxY */
-/* Max distance to the tablet at which a proximity-out event is generated for
+/* Default max distance to the tablet at which a proximity-out event is generated for
* cursor device (e.g. mouse).
*/
-#define PROXOUT_DISTANCE 256
-/* Hysteresis value would mean that proximity out is generated
- * when distance is more than (for Intuos series and Cintiq 21UX)
- * or less than (for Graphire series) MinDistance + HYSTERESIS
- * ( or MaxDistance - HYSTERESIS) units (this is to produce a prompt
- * relative movement)
- */
-#define PROXOUT_HYSTERESIS 8
+#define PROXOUT_INTUOS_DISTANCE 10
+#define PROXOUT_GRAPHIRE_DISTANCE 42
#define HEADER_BIT 0x80
#define ZAXIS_SIGN_BIT 0x40
@@ -491,8 +485,10 @@ struct _WacomCommonRec
char * wcmEraserID; /* eraser associated with the stylus */
int wcmMMonitor; /* disable/enable moving across screens in multi-monitor desktop */
int wcmTPCButton; /* set Tablet PC button on/off */
+ int wcmTPCButtonDefault; /* Tablet PC button default */
+ int wcmMaxCursorDist; /* Max mouse distance reported so far */
int wcmCursorProxoutDist; /* Max mouse distance for proxy-out max/256 units */
- int wcmCursorProxoutHyst; /* Proxy-out distance hysteresis in max/256 units */
+ int wcmCursorProxoutDistDefault; /* Default max mouse distance for proxy-out */
int bufpos; /* position with buffer */
unsigned char buffer[BUFFER_SIZE]; /* data read from device */