summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/2.4.22/wacom.c62
-rw-r--r--src/2.4.30x86-64/wacom.c60
-rw-r--r--src/2.4/wacom.c62
-rw-r--r--src/2.6.10/wacom.c71
-rw-r--r--src/2.6.16/wacom_wac.c73
-rw-r--r--src/2.6.8/wacom.c71
-rw-r--r--src/2.6.9/wacom.c71
-rwxr-xr-xsrc/util/xidump.c1
-rwxr-xr-xsrc/xdrv/wcmCommon.c127
-rwxr-xr-xsrc/xdrv/wcmConfig.c5
-rwxr-xr-xsrc/xdrv/wcmUSB.c2
-rwxr-xr-xsrc/xdrv/xf86Wacom.c66
-rwxr-xr-xsrc/xdrv/xf86Wacom.h1
14 files changed, 428 insertions, 249 deletions
diff --git a/ChangeLog b/ChangeLog
index 09a7835..bac535c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-02 Ping Cheng <pingc@wacom.com>
+ * Updated kernel driver to report full out-prox data
+ * Updated pad in X driver
+ * Fine tuned outbound tracking
+
2007-01-29 Ping Cheng <pingc@wacom.com>
* Added 3 new xsetwacom options
* Updated wacom_wac.c and wacom.c for Intuos outbound tracking
diff --git a/src/2.4.22/wacom.c b/src/2.4.22/wacom.c
index 14ee058..6dc5b0a 100644
--- a/src/2.4.22/wacom.c
+++ b/src/2.4.22/wacom.c
@@ -372,7 +372,7 @@ static void wacom_graphire_irq(struct urb *urb)
}
id = STYLUS_DEVICE_ID;
- if ( data[1] & 0x10 ) /* in prox */
+ if ( data[1] & 0x80 ) /* in prox */
{
switch ((data[1] >> 5) & 3) {
@@ -406,9 +406,6 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_abs(dev, ABS_DISTANCE, data[7]);
break;
}
- }
-
- if (data[1] & 0x90) {
x = data[2] | ((__u32)data[3] << 8);
y = data[4] | ((__u32)data[5] << 8);
input_report_abs(dev, ABS_X, x);
@@ -421,14 +418,22 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
}
input_report_abs(dev, ABS_MISC, id); /* report tool id */
- }
- else
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* report in-prox only when in area */
input_report_key(dev, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report out-prox when physically out */
- input_report_key(dev, wacom->tool[0], 0);
+ } else if (!(data[1] & 0x90)) {
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ }
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0);
+ }
input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01);
/* send pad data */
@@ -533,6 +538,26 @@ static int wacom_intuos_inout(struct urb *urb)
/* Exit report */
if ((data[1] & 0xfe) == 0x80)
{
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_MIDDLE, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_key(dev, BTN_SIDE, 0);
+ input_report_key(dev, BTN_EXTRA, 0);
+ input_report_abs(dev, ABS_THROTTLE, 0);
+ input_report_abs(dev, ABS_RZ, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_abs(dev, ABS_TILT_X, 0);
+ input_report_abs(dev, ABS_TILT_Y, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_abs(dev, ABS_WHEEL, 0);
+ }
input_report_key(dev, wacom->tool[idx], 0);
input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
@@ -626,6 +651,12 @@ static void wacom_intuos_irq(struct urb *urb)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) return;
+ /* Only large I3 supports Lens Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS) && strstr(wacom->features->name, "Intuos3"))
+ if (!(strstr(wacom->features->name, "Intuos3 12x12")
+ || strstr(wacom->features->name, "Intuos3 12x19")))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if (strstr(wacom->features->name, "Cintiq") && !(data[1] & 0x40)) return;
@@ -713,14 +744,7 @@ static void wacom_intuos_irq(struct urb *urb)
}
input_report_abs(dev, ABS_MISC, wacom->id[idx]);
-
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS) && (strstr(wacom->features->name, "Intuos3 12x12")
- || strstr(wacom->features->name, "Intuos3 12x19"))))
- && (data[1] & 0x40))
- input_report_key(dev, wacom->tool[idx], 1);
+ input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
}
diff --git a/src/2.4.30x86-64/wacom.c b/src/2.4.30x86-64/wacom.c
index fdbd4b2..7f40d78 100644
--- a/src/2.4.30x86-64/wacom.c
+++ b/src/2.4.30x86-64/wacom.c
@@ -317,7 +317,7 @@ static void wacom_graphire_irq(struct urb *urb)
}
id = STYLUS_DEVICE_ID;
- if ( data[1] & 0x10 ) /* in prox */
+ if ( data[1] & 0x80 ) /* in prox */
{
switch ((data[1] >> 5) & 3) {
@@ -350,9 +350,6 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_abs(dev, ABS_DISTANCE, data[7]);
break;
}
- }
-
- if (data[1] & 0x90) {
x = data[2] | ((__u32)data[3] << 8);
y = data[4] | ((__u32)data[5] << 8);
input_report_abs(dev, ABS_X, x);
@@ -365,14 +362,23 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
}
input_report_abs(dev, ABS_MISC, id); /* report tool id */
- }
- else
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* report in-prox only when in area */
input_report_key(dev, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report out-prox when physically out */
+ } else if (!(data[1] & 0x90)) {
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ }
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_report_key(dev, wacom->tool[0], 0);
+ }
input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01);
/* send pad data */
@@ -477,6 +483,26 @@ static int wacom_intuos_inout(struct urb *urb)
/* Exit report */
if ((data[1] & 0xfe) == 0x80)
{
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_MIDDLE, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_key(dev, BTN_SIDE, 0);
+ input_report_key(dev, BTN_EXTRA, 0);
+ input_report_abs(dev, ABS_THROTTLE, 0);
+ input_report_abs(dev, ABS_RZ, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_abs(dev, ABS_TILT_X, 0);
+ input_report_abs(dev, ABS_TILT_Y, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_abs(dev, ABS_WHEEL, 0);
+ }
input_report_key(dev, wacom->tool[idx], 0);
input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
@@ -569,6 +595,12 @@ static void wacom_intuos_irq(struct urb *urb)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) return;
+ /* Only large I3 supports Lens Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS) && strstr(wacom->features->name, "Intuos3"))
+ if (!(strstr(wacom->features->name, "Intuos3 12x12")
+ || strstr(wacom->features->name, "Intuos3 12x19")))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if (strstr(wacom->features->name, "Cintiq") && !(data[1] & 0x40)) return;
@@ -656,13 +688,7 @@ static void wacom_intuos_irq(struct urb *urb)
}
input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS) && (strstr(wacom->features->name, "Intuos3 12x12")
- || strstr(wacom->features->name, "Intuos3 12x19"))))
- && (data[1] & 0x40))
- input_report_key(dev, wacom->tool[idx], 1);
+ input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
}
diff --git a/src/2.4/wacom.c b/src/2.4/wacom.c
index 486c5e3..e2be8a6 100644
--- a/src/2.4/wacom.c
+++ b/src/2.4/wacom.c
@@ -371,7 +371,7 @@ static void wacom_graphire_irq(struct urb *urb)
}
id = STYLUS_DEVICE_ID;
- if ( data[1] & 0x10 ) /* in prox */
+ if ( data[1] & 0x80 ) /* in prox */
{
switch ((data[1] >> 5) & 3) {
@@ -404,9 +404,6 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_abs(dev, ABS_DISTANCE, data[7]);
break;
}
- }
-
- if (data[1] & 0x90) {
x = data[2] | ((__u32)data[3] << 8);
y = data[4] | ((__u32)data[5] << 8);
input_report_abs(dev, ABS_X, x);
@@ -419,14 +416,23 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
}
input_report_abs(dev, ABS_MISC, id); /* report tool id */
- }
- else
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* report in-prox only when in area */
input_report_key(dev, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report out-prox when physically out */
- input_report_key(dev, wacom->tool[0], 0);
+ } else if (!(data[1] & 0x90)) {
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ }
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
+ input_report_key(dev, wacom->tool[0], 0);
+ }
input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01);
/* send pad data */
@@ -532,6 +538,26 @@ static int wacom_intuos_inout(struct urb *urb)
/* Exit report */
if ((data[1] & 0xfe) == 0x80)
{
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_MIDDLE, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_key(dev, BTN_SIDE, 0);
+ input_report_key(dev, BTN_EXTRA, 0);
+ input_report_abs(dev, ABS_THROTTLE, 0);
+ input_report_abs(dev, ABS_RZ, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_abs(dev, ABS_TILT_X, 0);
+ input_report_abs(dev, ABS_TILT_Y, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_abs(dev, ABS_WHEEL, 0);
+ }
input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_report_key(dev, wacom->tool[idx], 0);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
@@ -625,6 +651,12 @@ static void wacom_intuos_irq(struct urb *urb)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) return;
+ /* Only large I3 supports Lens Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS) && strstr(wacom->features->name, "Intuos3"))
+ if (!(strstr(wacom->features->name, "Intuos3 12x12")
+ || strstr(wacom->features->name, "Intuos3 12x19")))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if (strstr(wacom->features->name, "Cintiq") && !(data[1] & 0x40)) return;
@@ -713,13 +745,7 @@ static void wacom_intuos_irq(struct urb *urb)
}
input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS) && (strstr(wacom->features->name, "Intuos3 12x12")
- || strstr(wacom->features->name, "Intuos3 12x19"))))
- && (data[1] & 0x40))
- input_report_key(dev, wacom->tool[idx], 1);
+ input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
}
diff --git a/src/2.6.10/wacom.c b/src/2.6.10/wacom.c
index 3b112a8..4c0c4c5 100644
--- a/src/2.6.10/wacom.c
+++ b/src/2.6.10/wacom.c
@@ -419,7 +419,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_regs(dev, regs);
id = STYLUS_DEVICE_ID;
- if ( data[1] & 0x10 ) /* in prox */
+ if ( data[1] & 0x80 ) /* in prox */
{
switch ((data[1] >> 5) & 3) {
@@ -452,9 +452,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_abs(dev, ABS_DISTANCE, data[7]);
break;
}
- }
-
- if (data[1] & 0x90) {
x = le16_to_cpu(*(__le16 *) &data[2]);
y = le16_to_cpu(*(__le16 *) &data[4]);
input_report_abs(dev, ABS_X, x);
@@ -467,14 +464,23 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
}
input_report_abs(dev, ABS_MISC, id); /* report tool id */
- }
- else
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* report in-prox only when in area */
input_report_key(dev, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report out-prox when physically out */
+ } else if (!(data[1] & 0x90)) {
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ }
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_report_key(dev, wacom->tool[0], 0);
+ }
input_sync(dev);
/* send pad data */
@@ -578,14 +584,30 @@ static int wacom_intuos_inout(struct urb *urb)
/* Exit report */
if ((data[1] & 0xfe) == 0x80) {
- if(!((wacom->tool[idx] == BTN_TOOL_LENS) &&
- ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) {
- input_report_key(dev, wacom->tool[idx], 0);
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
- input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
- input_sync(dev);
+ wacom_report_abs(wcombo, ABS_X, 0);
+ wacom_report_abs(wcombo, ABS_Y, 0);
+ wacom_report_abs(wcombo, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ wacom_report_key(wcombo, BTN_LEFT, 0);
+ wacom_report_key(wcombo, BTN_MIDDLE, 0);
+ wacom_report_key(wcombo, BTN_RIGHT, 0);
+ wacom_report_key(wcombo, BTN_SIDE, 0);
+ wacom_report_key(wcombo, BTN_EXTRA, 0);
+ wacom_report_abs(wcombo, ABS_THROTTLE, 0);
+ wacom_report_abs(wcombo, ABS_RZ, 0);
+ } else {
+ wacom_report_abs(wcombo, ABS_PRESSURE, 0);
+ wacom_report_abs(wcombo, ABS_TILT_X, 0);
+ wacom_report_abs(wcombo, ABS_TILT_Y, 0);
+ wacom_report_key(wcombo, BTN_STYLUS, 0);
+ wacom_report_key(wcombo, BTN_STYLUS2, 0);
+ wacom_report_key(wcombo, BTN_TOUCH, 0);
+ wacom_report_abs(wcombo, ABS_WHEEL, 0);
}
+ input_report_key(dev, wacom->tool[idx], 0);
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
+ input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+ input_sync(dev);
return 1;
}
return 0;
@@ -689,6 +711,12 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) goto exit;
+ /* Only large I3 and I1 & I2 support Lense Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS)
+ && ((wacom->features->type == INTUOS3)
+ || (wacom->features->type == INTUOS3S)))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) goto exit;
@@ -771,14 +799,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
}
input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS)
- && ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) &&
- (data[1] & 0x40))
- input_report_key(dev, wacom->tool[idx], 1);
+ input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
input_sync(dev);
diff --git a/src/2.6.16/wacom_wac.c b/src/2.6.16/wacom_wac.c
index aaf184d..d838d1c 100644
--- a/src/2.6.16/wacom_wac.c
+++ b/src/2.6.16/wacom_wac.c
@@ -170,7 +170,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
wacom_input_regs(wcombo);
id = STYLUS_DEVICE_ID;
- if (data[1] & 0x10) { /* in prox */
+ if (data[1] & 0x80) { /* in prox */
switch ((data[1] >> 5) & 3) {
@@ -203,9 +203,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f);
break;
}
- }
-
- if (data[1] & 0x90) {
x = wacom_le16_to_cpu(&data[2]);
y = wacom_le16_to_cpu(&data[4]);
wacom_report_abs(wcombo, ABS_X, x);
@@ -217,14 +214,23 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04);
}
wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */
- }
- else
- wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* only report prox-in when in area */
wacom_report_key(wcombo, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report prox-out when physically out */
+ } else if (!(data[1] & 0x90)) {
+ wacom_report_abs(wcombo, ABS_X, 0);
+ wacom_report_abs(wcombo, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ wacom_report_key(wcombo, BTN_LEFT, 0);
+ wacom_report_key(wcombo, BTN_RIGHT, 0);
+ wacom_report_abs(wcombo, ABS_DISTANCE, 0);
+ } else {
+ wacom_report_abs(wcombo, ABS_PRESSURE, 0);
+ wacom_report_key(wcombo, BTN_TOUCH, 0);
+ wacom_report_key(wcombo, BTN_STYLUS, 0);
+ wacom_report_key(wcombo, BTN_STYLUS2, 0);
+ }
+ wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
wacom_report_key(wcombo, wacom->tool[0], 0);
+ }
/* send pad data */
if (wacom->features->type == WACOM_G4) {
@@ -321,14 +327,30 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
/* Exit report */
if ((data[1] & 0xfe) == 0x80) {
- if(!((wacom->tool[idx] == BTN_TOOL_LENS)
- && ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) {
- wacom_report_key(wcombo, wacom->tool[idx], 0);
- wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
- wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
- return 2;
+ wacom_report_abs(wcombo, ABS_X, 0);
+ wacom_report_abs(wcombo, ABS_Y, 0);
+ wacom_report_abs(wcombo, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ wacom_report_key(wcombo, BTN_LEFT, 0);
+ wacom_report_key(wcombo, BTN_MIDDLE, 0);
+ wacom_report_key(wcombo, BTN_RIGHT, 0);
+ wacom_report_key(wcombo, BTN_SIDE, 0);
+ wacom_report_key(wcombo, BTN_EXTRA, 0);
+ wacom_report_abs(wcombo, ABS_THROTTLE, 0);
+ wacom_report_abs(wcombo, ABS_RZ, 0);
+ } else {
+ wacom_report_abs(wcombo, ABS_PRESSURE, 0);
+ wacom_report_abs(wcombo, ABS_TILT_X, 0);
+ wacom_report_abs(wcombo, ABS_TILT_Y, 0);
+ wacom_report_key(wcombo, BTN_STYLUS, 0);
+ wacom_report_key(wcombo, BTN_STYLUS2, 0);
+ wacom_report_key(wcombo, BTN_TOUCH, 0);
+ wacom_report_abs(wcombo, ABS_WHEEL, 0);
}
+ wacom_report_key(wcombo, wacom->tool[idx], 0);
+ wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
+ wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+ return 2;
}
return 0;
}
@@ -409,6 +431,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
if (result)
return result-1;
+ /* Only large I3 and I1 & I2 support Lense Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS)
+ && ((wacom->features->type == INTUOS3)
+ || (wacom->features->type == INTUOS3S)))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40))
return 0;
@@ -480,17 +508,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x08);
}
}
-
wacom_report_abs(wcombo, ABS_MISC, wacom->id[idx]);
-
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS)
- && ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) &&
- (data[1] & 0x40))
- wacom_report_key(wcombo, wacom->tool[idx], 1);
+ wacom_report_key(wcombo, wacom->tool[idx], 1);
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
return 1;
}
diff --git a/src/2.6.8/wacom.c b/src/2.6.8/wacom.c
index cb90bf5..ba31f44 100644
--- a/src/2.6.8/wacom.c
+++ b/src/2.6.8/wacom.c
@@ -418,7 +418,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_regs(dev, regs);
id = STYLUS_DEVICE_ID;
- if ( data[1] & 0x10 ) /* in prox */
+ if ( data[1] & 0x80 ) /* in prox */
{
switch ((data[1] >> 5) & 3) {
@@ -451,9 +451,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_abs(dev, ABS_DISTANCE, data[7]);
break;
}
- }
-
- if (data[1] & 0x90) {
x = le16_to_cpu(*(u16 *) &data[2]);
y = le16_to_cpu(*(u16 *) &data[4]);
input_report_abs(dev, ABS_X, x);
@@ -466,14 +463,23 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
}
input_report_abs(dev, ABS_MISC, id); /* report tool id */
- }
- else
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* report in-prox only when in area */
input_report_key(dev, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report out-prox when physically out */
+ } else if (!(data[1] & 0x90)) {
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ }
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_report_key(dev, wacom->tool[0], 0);
+ }
input_sync(dev);
/* send pad data */
@@ -577,14 +583,30 @@ static int wacom_intuos_inout(struct urb *urb)
/* Exit report */
if ((data[1] & 0xfe) == 0x80) {
- if(!((wacom->tool[idx] == BTN_TOOL_LENS) &&
- ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) {
- input_report_key(dev, wacom->tool[idx], 0);
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
- input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
- input_sync(dev);
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_MIDDLE, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_key(dev, BTN_SIDE, 0);
+ input_report_key(dev, BTN_EXTRA, 0);
+ input_report_abs(dev, ABS_THROTTLE, 0);
+ input_report_abs(dev, ABS_RZ, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_abs(dev, ABS_TILT_X, 0);
+ input_report_abs(dev, ABS_TILT_Y, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_abs(dev, ABS_WHEEL, 0);
}
+ input_report_key(dev, wacom->tool[idx], 0);
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
+ input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+ input_sync(dev);
return 1;
}
return 0;
@@ -688,6 +710,12 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) goto exit;
+ /* Only large I3 and I1 & I2 support Lense Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS)
+ && ((wacom->features->type == INTUOS3)
+ || (wacom->features->type == INTUOS3S)))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) goto exit;
@@ -770,14 +798,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
}
input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS)
- && ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) &&
- (data[1] & 0x40))
- input_report_key(dev, wacom->tool[idx], 1);
+ input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
input_sync(dev);
diff --git a/src/2.6.9/wacom.c b/src/2.6.9/wacom.c
index 9087b5a..8f323f1 100644
--- a/src/2.6.9/wacom.c
+++ b/src/2.6.9/wacom.c
@@ -418,7 +418,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_regs(dev, regs);
id = STYLUS_DEVICE_ID;
- if ( data[1] & 0x10 ) /* in prox */
+ if ( data[1] & 0x80 ) /* in prox */
{
switch ((data[1] >> 5) & 3) {
@@ -451,9 +451,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_abs(dev, ABS_DISTANCE, data[7]);
break;
}
- }
-
- if (data[1] & 0x90) {
x = le16_to_cpu(*(__le16 *) &data[2]);
y = le16_to_cpu(*(__le16 *) &data[4]);
input_report_abs(dev, ABS_X, x);
@@ -466,14 +463,23 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
}
input_report_abs(dev, ABS_MISC, id); /* report tool id */
- }
- else
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
-
- if (data[1] & 0x10) /* report in-prox only when in area */
input_report_key(dev, wacom->tool[0], 1);
- if (!(data[1] & 0x90)) /* report out-prox when physically out */
+ } else if (!(data[1] & 0x90)) {
+ input_report_abs(dev, ABS_X, 0);
+ input_report_abs(dev, ABS_Y, 0);
+ if (wacom->tool[0] == BTN_TOOL_MOUSE) {
+ input_report_key(dev, BTN_LEFT, 0);
+ input_report_key(dev, BTN_RIGHT, 0);
+ input_report_abs(dev, ABS_DISTANCE, 0);
+ } else {
+ input_report_abs(dev, ABS_PRESSURE, 0);
+ input_report_key(dev, BTN_TOUCH, 0);
+ input_report_key(dev, BTN_STYLUS, 0);
+ input_report_key(dev, BTN_STYLUS2, 0);
+ }
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
input_report_key(dev, wacom->tool[0], 0);
+ }
input_sync(dev);
/* send pad data */
@@ -577,14 +583,30 @@ static int wacom_intuos_inout(struct urb *urb)
/* Exit report */
if ((data[1] & 0xfe) == 0x80) {
- if(!((wacom->tool[idx] == BTN_TOOL_LENS) &&
- ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) {
- input_report_key(dev, wacom->tool[idx], 0);
- input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
- input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
- input_sync(dev);
+ wacom_report_abs(wcombo, ABS_X, 0);
+ wacom_report_abs(wcombo, ABS_Y, 0);
+ wacom_report_abs(wcombo, ABS_DISTANCE, 0);
+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
+ wacom_report_key(wcombo, BTN_LEFT, 0);
+ wacom_report_key(wcombo, BTN_MIDDLE, 0);
+ wacom_report_key(wcombo, BTN_RIGHT, 0);
+ wacom_report_key(wcombo, BTN_SIDE, 0);
+ wacom_report_key(wcombo, BTN_EXTRA, 0);
+ wacom_report_abs(wcombo, ABS_THROTTLE, 0);
+ wacom_report_abs(wcombo, ABS_RZ, 0);
+ } else {
+ wacom_report_abs(wcombo, ABS_PRESSURE, 0);
+ wacom_report_abs(wcombo, ABS_TILT_X, 0);
+ wacom_report_abs(wcombo, ABS_TILT_Y, 0);
+ wacom_report_key(wcombo, BTN_STYLUS, 0);
+ wacom_report_key(wcombo, BTN_STYLUS2, 0);
+ wacom_report_key(wcombo, BTN_TOUCH, 0);
+ wacom_report_abs(wcombo, ABS_WHEEL, 0);
}
+ input_report_key(dev, wacom->tool[idx], 0);
+ input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
+ input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+ input_sync(dev);
return 1;
}
return 0;
@@ -688,6 +710,12 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) goto exit;
+ /* Only large I3 and I1 & I2 support Lense Cursor */
+ if((wacom->tool[idx] == BTN_TOOL_LENS)
+ && ((wacom->features->type == INTUOS3)
+ || (wacom->features->type == INTUOS3S)))
+ return 0;
+
/* Cintiq doesn't send data when RDY bit isn't set */
if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) goto exit;
@@ -770,14 +798,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
}
input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
- /* Only large I3 supports Lens Cursor
- * Report in-prox only when RDY is set
- */
- if((!((wacom->tool[idx] == BTN_TOOL_LENS)
- && ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))) &&
- (data[1] & 0x40))
- input_report_key(dev, wacom->tool[idx], 1);
+ input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
input_sync(dev);
diff --git a/src/util/xidump.c b/src/util/xidump.c
index 8b0efe4..9fccd44 100755
--- a/src/util/xidump.c
+++ b/src/util/xidump.c
@@ -924,7 +924,6 @@ int Run(Display* pDisp, UI* pUI, FORMATTYPE fmt, const char* pszDeviceName)
}
/* open device */
-fprintf(stderr, "claess =%d use =%d type = %d \n", (int)pDevInfo->num_classes, (int)(pDevInfo->use), (int)pDevInfo->type);
pDev = XOpenDevice(pDisp,pDevInfo->id);
if (!pDev)
{
diff --git a/src/xdrv/wcmCommon.c b/src/xdrv/wcmCommon.c
index 3e103f9..266c555 100755
--- a/src/xdrv/wcmCommon.c
+++ b/src/xdrv/wcmCommon.c
@@ -359,9 +359,6 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
return;
}
- DBG(4, ErrorF("sendAButton TPCButton(%s) button=%d state=%d code=%08x, for %s\n",
- common->wcmTPCButton ? "on" : "off", button, mask, priv->button[button], local->name));
-
button_idx = button;
button = priv->button[button];
if (!button)
@@ -372,6 +369,11 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
if (!is_core && (button & AC_CORE))
xf86XInputSetSendCoreEvents (local, TRUE);
+ DBG(4, ErrorF("sendAButton TPCButton(%s) button=%d state=%d"
+ "code=%08x, for %s coreEvent=%s \n", common->wcmTPCButton ?
+ "on" : "off", button_idx, mask, button,
+ local->name, (button & AC_CORE) ? "yes" : "no"));
+
/* Emulate modifier key presses, if required
*/
if (mask != 0)
@@ -482,6 +484,8 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
int v3, v4, v5;
int is_absolute;
+ int no_jitter;
+ double relacc, param;
if (priv->serial && serial != priv->serial)
{
@@ -497,12 +501,12 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
ty = ds->stripy;
}
- DBG(7, ErrorF("[%s] prox=%s x=%d y=%d z=%d "
+ DBG(7, ErrorF("[%s] o_prox=%s x=%d y=%d z=%d "
"b=%s b=%d tx=%d ty=%d wl=%d rot=%d th=%d\n",
(type == STYLUS_ID) ? "stylus" :
(type == CURSOR_ID) ? "cursor" :
(type == ERASER_ID) ? "eraser" : "pad",
- is_proximity ? "true" : "false",
+ priv->oldProximity ? "true" : "false",
x, y, z, is_button ? "true" : "false", buttons,
tx, ty, wheel, rot, throttle));
@@ -527,14 +531,6 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
is_absolute = (priv->flags & ABSOLUTE_FLAG);
- if(!priv->oldProximity && !is_absolute)
- {
- /* initial current max distance */
- priv->common->wcmMaxCursorDist = ds->distance;
- }
- priv->currentX = x;
- priv->currentY = y;
-
if (IsCursor(priv))
{
v3 = rot;
@@ -555,6 +551,57 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
x, y, z, v3, v4, v5, id, serial,
is_button ? "true" : "false", buttons, channel));
+ if (x > priv->bottomX)
+ x = priv->bottomX;
+ if (x < priv->topX)
+ x = priv->topX;
+ if (y > priv->bottomY)
+ y = priv->bottomY;
+ if (y < priv->topY)
+ y = priv->topY;
+ priv->currentX = x;
+ priv->currentY = y;
+ if (!is_absolute)
+ {
+ if(!priv->oldProximity)
+ {
+ /* don't move the cursor */
+ x = 0;
+ y = 0;
+ }
+ else
+ {
+ x -= priv->oldX;
+ y -= priv->oldY;
+ }
+ /* don't apply speed for fairly small increments */
+ no_jitter = (priv->speed*3 > 4) ? priv->speed*3 : 4;
+ relacc = (MAX_ACCEL-priv->accel)*(MAX_ACCEL-priv->accel);
+ if (ABS(x) > no_jitter)
+ {
+ param = priv->speed;
+
+ /* apply acceleration only when priv->speed > DEFAULT_SPEED */
+ if (priv->speed > DEFAULT_SPEED )
+ {
+ param += priv->accel > 0 ? abs(x)/relacc : 0;
+ }
+ /* don't apply acceleration when too fast. */
+ x *= param > 20.00 ? 20.00 : param;
+ }
+ if (ABS(y) > no_jitter)
+ {
+ param = priv->speed;
+ /* apply acceleration only when priv->speed > DEFAULT_SPEED */
+ if (priv->speed > DEFAULT_SPEED )
+ {
+ param += priv->accel > 0 ? abs(y)/relacc : 0;
+
+ }
+ /* don't apply acceleration when too fast. */
+ y *= param > 20.00 ? 20.00 : param;
+ }
+ }
if (type != PAD_ID)
{
/* report tool id in the upper 2 bytes of 4th valuator
@@ -579,6 +626,12 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
xf86WcmSetScreen(local, &x, &y);
}
+ /* unify acceleration in both directions
+ * for relative mode to draw a circle
+ */
+ if (!is_absolute)
+ x *= priv->factorY / priv->factorX;
+
/* don't emit proximity events if device does not support proximity */
if ((local->dev->proximity && !priv->oldProximity))
xf86PostProximityEvent(local->dev, 1, 0, naxes,
@@ -636,8 +689,11 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
is_proximity = 1;
}
if ( v3 || v4 )
- xf86PostMotionEvent(local->dev, is_absolute,
- 0, naxes, x, y, z, v3, v4, v5);
+ {
+ xf86WcmSetScreen(local, &x, &y);
+ xf86PostMotionEvent(local->dev, 0,
+ 0, naxes, 0, 0, z, v3, v4, v5);
+ }
if (priv->oldButtons != buttons)
xf86WcmSendButtons(local, buttons,
x, y, z, v3, v4, v5);
@@ -673,8 +729,8 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne
{
priv->oldButtons = buttons;
priv->oldWheel = wheel;
- priv->oldX = x;
- priv->oldY = y;
+ priv->oldX = priv->currentX;
+ priv->oldY = priv->currentY;
priv->oldZ = z;
priv->oldTiltX = tx;
priv->oldTiltY = ty;
@@ -1032,16 +1088,11 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
if (tool->current)
{
/* Send soft prox-out for the old area */
- WacomDevicePtr priv = outprox->device->private;
+ LocalDevicePtr oDev = outprox->device;
+ WacomDeviceState out = { 0 };
DBG(2, ErrorF("Soft prox-out for %s\n",
outprox->device->name));
- xf86PostProximityEvent(outprox->device->dev,0,0,0);
- /* Set state of the old device to prox-out */
- priv->oldProximity = 0;
- priv->oldButtons = 0;
- /* start over with button-press events */
- pChannel->work.buttons = 0;
- pChannel->valid.state.buttons = 0;
+ xf86WcmSendEvents(oDev, &out, channel);
}
else
tool->current = outprox;
@@ -1067,7 +1118,6 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
WacomDevicePtr priv = pDev->private;
/* Device transformations come first */
-
/* button 1 Threshold test */
int button = 1;
if ( IsStylus(priv) || IsEraser(priv))
@@ -1080,6 +1130,17 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
transPressureCurve(priv,&filtered);
}
+ if (!(priv->flags & ABSOLUTE_FLAG) && !priv->hardProx)
+ {
+ /* initial current max distance */
+ if (strstr(common->wcmModel->name, "Intuos"))
+ common->wcmMaxCursorDist = 256;
+ else
+ common->wcmMaxCursorDist = 0;
+ }
+ /* Store current hard prox for next use */
+ priv->hardProx = ds->proximity;
+
/* User-requested filtering comes next */
/* User-requested transformations come last */
@@ -1154,7 +1215,7 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
}
/* force out-prox when distance is outside wcmCursorProxoutDist. */
- if (!(priv->flags & ABSOLUTE_FLAG) && IsCursor(priv))
+ if (!(priv->flags & ABSOLUTE_FLAG))
{
if (strstr(common->wcmModel->name, "Intuos"))
{
@@ -1166,7 +1227,6 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
if (common->wcmMaxCursorDist < filtered.distance)
common->wcmMaxCursorDist = filtered.distance;
}
-
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));
@@ -1178,15 +1238,12 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
/* 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;
- }
+ if (!ds->proximity)
+ return;
+ }
}
xf86WcmSendEvents(pDev, &filtered, channel);
/* If out-prox, reset the current area pointer */
diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index b471b56..58780ed 100755
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -115,6 +115,7 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag)
priv->factorY = 0.0; /* Y factor */
priv->common = common; /* common info pointer */
priv->oldProximity = 0; /* previous proximity */
+ priv->hardProx = 1; /* previous hardware proximity */
priv->old_serial = 0; /* last active tool's serial */
priv->old_device_id = IsStylus(priv) ? STYLUS_DEVICE_ID :
(IsEraser(priv) ? ERASER_DEVICE_ID :
@@ -497,9 +498,9 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
priv->flags |= ABSOLUTE_FLAG;
}
- /* pad reports absolute value and never moves the cursor */
+ /* pad reports relative value and never moves the cursor */
if (IsPad(priv))
- priv->flags |= ABSOLUTE_FLAG;
+ priv->flags &= ~ABSOLUTE_FLAG;
xf86Msg(X_CONFIG, "%s is in %s mode\n", local->name,
(priv->flags & ABSOLUTE_FLAG) ? "absolute" : "relative");
diff --git a/src/xdrv/wcmUSB.c b/src/xdrv/wcmUSB.c
index 483e612..a26d29b 100755
--- a/src/xdrv/wcmUSB.c
+++ b/src/xdrv/wcmUSB.c
@@ -722,6 +722,8 @@ static void usbParseEvent(WacomCommonPtr common,
{
memset(&common->wcmChannel[i],0,
sizeof(WacomChannel));
+ /* in case the in-prox event was missing */
+ common->wcmChannel[i].work.proximity = 1;
/* Intuos3 or Graphire4 Pad */
if (common->wcmLastToolSerial == 0xffffffff ||
common->wcmLastToolSerial == 0xf0)
diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c
index 9ed439e..8879ce1 100755
--- a/src/xdrv/xf86Wacom.c
+++ b/src/xdrv/xf86Wacom.c
@@ -55,9 +55,10 @@
* 2006-05-03 47-pc0.7.4 - new release
* 2006-07-17 47-pc0.7.5 - Support button/key combined events
* 2006-11-13 47-pc0.7.7 - Updated Xinerama setup support
+ * 2007-01-31 47-pc0.7.7-3 - multiarea support
*/
-static const char identification[] = "$Identification: 47-0.7.7 $";
+static const char identification[] = "$Identification: 47-0.7.7-3 $";
/****************************************************************************/
@@ -863,6 +864,8 @@ static int xf86WcmSetParam(LocalDevicePtr local, int param, int value)
break;
}
case XWACOM_PARAM_MODE:
+ /* don't change pad's mode */
+ if (IsPad(priv)) return Success;
if ((value < 0) || (value > 1)) return BadValue;
if (value)
{
@@ -1390,8 +1393,7 @@ static Bool xf86WcmDevConvert(LocalDevicePtr local, int first, int num,
int v0, int v1, int v2, int v3, int v4, int v5, int* x, int* y)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
- int no_jitter;
- double relacc, param, temp;
+ double temp;
DBG(6, ErrorF("xf86WcmDevConvert v0=%d v1=%d \n", v0, v1));
@@ -1494,59 +1496,11 @@ static Bool xf86WcmDevConvert(LocalDevicePtr local, int first, int num,
}
return TRUE;
}
- temp = (double)v0 * priv->factorX + 0.5;
- *x += temp;
}
- else
- {
- *x = priv->currentSX;
- *y = priv->currentSY;
- if(!priv->oldProximity)
- {
- /* don't move the cursor */
- v0 = 0;
- v1 = 0;
- }
- else
- {
- v0 -= priv->oldX;
- v1 -= priv->oldY;
- }
- /* don't apply speed for fairly small increments */
- no_jitter = (priv->speed*3 > 4) ? priv->speed*3 : 4;
- relacc = (MAX_ACCEL-priv->accel)*(MAX_ACCEL-priv->accel);
- if (ABS(v0) > no_jitter)
- {
- param = priv->speed;
- /* apply acceleration only when priv->speed > DEFAULT_SPEED */
- if (priv->speed > DEFAULT_SPEED )
- {
- param += priv->accel > 0 ? abs(v0)/relacc : 0;
- }
- /* don't apply acceleration when too fast. */
- v0 *= param > 20.00 ? 20.00 : param;
- }
- if (ABS(v1) > no_jitter)
- {
- param = priv->speed;
- /* apply acceleration only when priv->speed > DEFAULT_SPEED */
- if (priv->speed > DEFAULT_SPEED )
- {
- param += priv->accel > 0 ? abs(v1)/relacc : 0;
-
- }
- /* don't apply acceleration when too fast. */
- v1 *= param > 20.00 ? 20.00 : param;
- }
-
- /* unify acceleration in both directions
- * for relative mode to draw a circle
- */
- temp = (double)v0 * priv->factorY + 0.5;
- *x += temp;
- }
- temp = (double)v1 * priv->factorY + 0.5;
+ temp = ((double)v0 * priv->factorX + 0.5);
+ *x += temp;
+ temp = ((double)v1 * priv->factorY + 0.5);
*y += temp;
DBG(6, ErrorF("Wacom converted v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y));
@@ -1572,10 +1526,12 @@ static Bool xf86WcmDevReverseConvert(LocalDevicePtr local, int x, int y,
if (!(priv->flags & ABSOLUTE_FLAG))
{
+ valuators[0] = (((double)x / priv->factorX) + 0.5);
+ valuators[1] = (((double)y / priv->factorY) + 0.5);
if (!priv->devReverseCount)
{
/* reset valuators to report raw values */
- for (i=0; i<priv->naxes; i++)
+ for (i=2; i<priv->naxes; i++)
valuators[i] = 0;
priv->devReverseCount = 1;
diff --git a/src/xdrv/xf86Wacom.h b/src/xdrv/xf86Wacom.h
index 7ab948e..4b07073 100755
--- a/src/xdrv/xf86Wacom.h
+++ b/src/xdrv/xf86Wacom.h
@@ -298,6 +298,7 @@ struct _WacomDeviceRec
int oldThrottle; /* previous throttle value */
int oldButtons; /* previous buttons state */
int oldProximity; /* previous proximity */
+ int hardProx; /* previous hardware proximity */
int old_device_id; /* last in prox device id */
int old_serial; /* last in prox tool serial number */
int devReverseCount; /* Relative ReverseConvert called twice each movement*/