summaryrefslogtreecommitdiff
path: root/src/2.4/wacom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/2.4/wacom.c')
-rw-r--r--src/2.4/wacom.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/src/2.4/wacom.c b/src/2.4/wacom.c
index 5e21f74..7786700 100644
--- a/src/2.4/wacom.c
+++ b/src/2.4/wacom.c
@@ -1,5 +1,5 @@
/*
- * $Id: wacom.c,v 1.21 2006/02/13 05:24:22 pingc Exp $
+ * $Id: wacom.c,v 1.22 2006/03/07 00:29:04 pingc Exp $
*
* Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2000 Andreas Bach Aaen <abach@stofanet.dk>
@@ -342,6 +342,8 @@ static void wacom_graphire_irq(struct urb *urb)
if (urb->status) return;
+ if (data[0] == 99) return; /* for Volito tablets */
+
if (data[0] != 2)
{
printk(KERN_INFO "wacom_graphire_irq: received unknown report #%d\n", data[0]);
@@ -366,10 +368,10 @@ static void wacom_graphire_irq(struct urb *urb)
case 2: /* Mouse with wheel */
input_report_key(dev, BTN_MIDDLE, data[1] & 0x04);
if ( strstr(wacom->features->name, "Graphire4") ) {
- rw = data[7] & 0x04 ? -(data[7] & 0x03) : data[7] & 0x03;
- input_report_rel(dev, REL_WHEEL, rw);
+ rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : data[7] & 0x03;
+ input_report_rel(dev, REL_WHEEL, -rw);
} else
- input_report_rel(dev, REL_WHEEL, (signed char) data[6]);
+ input_report_rel(dev, REL_WHEEL, -(signed char) data[6]);
/* fall through */
case 3: /* Mouse without wheel */
@@ -408,34 +410,20 @@ static void wacom_graphire_irq(struct urb *urb)
/* send pad data */
if ( strstr(wacom->features->name, "Graphire4") )
{
- /* fist time sending pad data */
- if (wacom->tool[1] != BTN_TOOL_FINGER)
- {
- wacom->id[1] = 0;
- wacom->serial[1] = ( data[7] & 0x38 ) >> 2;
- }
- if ( data[7] & 0xf8 )
+ if ( (wacom->serial[1] & 0xc0) != (data[7] & 0xf8) )
{
+ wacom->id[1] = 1;
+ wacom->serial[1] = (data[7] & 0xf8);
input_report_key(dev, BTN_0, (data[7] & 0x40));
input_report_key(dev, BTN_4, (data[7] & 0x80));
- if ( (( data[7] & 0x38 ) >> 2) == (wacom->serial[1] & 0x0e) )
- /* alter REL_WHEEL value so X apps can get it */
- wacom->serial[1] += (wacom->serial[1] & 0x01) ? -1 : 1 ;
- else
- wacom->serial[1] = (data[7] & 0x38 ) >> 2;
- /* don't alter the value when there is no wheel event */
- if ( wacom->serial[1] == 1 ) wacom->serial[1] = 0;
- rw = wacom->serial[1];
- rw = ( rw & 0x08 ) ? -( rw & 0x07 ) : ( rw & 0x07 );
+
+ rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
input_report_rel(dev, REL_WHEEL, rw);
- wacom->tool[1] = BTN_TOOL_FINGER;
- wacom->id[1] = data[7] & 0xf8;
- input_report_key(dev, wacom->tool[1], 0xf0);
+ input_report_key(dev, BTN_TOOL_FINGER, 0xf0);
input_event(dev, EV_MSC, MSC_SERIAL, 0xf0);
} else if ( wacom->id[1] ) {
wacom->id[1] = 0;
- wacom->serial[1] = 0;
- input_report_key(dev, wacom->tool[1], 0);
+ input_report_key(dev, BTN_TOOL_FINGER, 0);
input_event(dev, EV_MSC, MSC_SERIAL, 0xf0);
}
}
@@ -689,8 +677,8 @@ static void wacom_intuos_irq(struct urb *urb)
input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
input_report_key(dev, BTN_RIGHT, data[8] & 0x10);
/* mouse wheel is positive when rolled backwards */
- input_report_rel(dev, REL_WHEEL, (__u32)((data[8] & 0x02) >> 1)
- - (__u32)(data[8] & 0x01));
+ input_report_rel(dev, REL_WHEEL, (__u32)(data[8] & 0x01)
+ - (__u32)((data[8] & 0x02) >> 1));
/* I3 2D mouse side buttons */
if (strstr(wacom->features->name, "Intuos3"))