--- drivers/input/mouse/alps.c.orig 2005-01-14 07:33:59.000000000 -0800 +++ drivers/input/mouse/alps.c 2005-03-28 20:10:29.000000000 -0800 @@ -19,9 +19,9 @@ #include "psmouse.h" #include "alps.h" -#define DEBUG +/*don't define DEBUG*/ #ifdef DEBUG -#define dbg(format, arg...) printk(KERN_INFO "alps.c: " format "\n", ## arg) +#define dbg(format, arg...) printk(KERN_DEBUG "alps.c: " format "\n", ## arg) #else #define dbg(format, arg...) do {} while (0) #endif @@ -81,6 +81,8 @@ struct input_dev *dev = &psmouse->dev; int x, y, z; int left = 0, right = 0, middle = 0; + int ges, fin; + static int prev_fin; input_regs(dev, regs); @@ -122,6 +124,27 @@ return; } + dbg("t:%lu x:%3d y:%3d z:%3d %d%d%d %d%d%d %d%d%d", + jiffies, x, y, z, + (packet[0] & 0x04) != 0, (packet[0] & 0x02) != 0, (packet[0] & 0x01) != 0, + (packet[2] & 0x04) != 0, (packet[2] & 0x02) != 0, (packet[2] & 0x01) != 0, + (packet[3] & 0x04) != 0, (packet[3] & 0x02) != 0, (packet[3] & 0x01) != 0); + + ges = packet[2] & 1; + fin = packet[2] & 2; + + if (ges && !fin) + z = 40; + + if (ges && fin && !prev_fin) { + input_report_abs(dev, ABS_X, x); + input_report_abs(dev, ABS_Y, y); + input_report_abs(dev, ABS_PRESSURE, 0); + input_report_key(dev, BTN_TOOL_FINGER, 0); + input_sync(dev); + } + prev_fin = fin; + if (z > 30) input_report_key(dev, BTN_TOUCH, 1); if (z < 25) input_report_key(dev, BTN_TOUCH, 0); @@ -132,7 +155,6 @@ input_report_abs(dev, ABS_PRESSURE, z); input_report_key(dev, BTN_TOOL_FINGER, z > 0); - left |= (packet[2] ) & 1; left |= (packet[3] ) & 1; right |= (packet[3] >> 1) & 1; if (packet[0] == 0xff) { @@ -351,7 +373,7 @@ return -1; if ((model == ALPS_MODEL_DUALPOINT ? param[2] : param[0]) & 0x04) - alps_tap_mode(psmouse, model, 0); + alps_tap_mode(psmouse, model, 1); if (alps_absolute_mode(psmouse)) { printk(KERN_ERR "alps.c: Failed to enable absolute mode\n"); @@ -384,7 +406,7 @@ if ((model == ALPS_MODEL_DUALPOINT ? param[2] : param[0]) & 0x04) { printk(KERN_INFO " Disabling hardware tapping\n"); - if (alps_tap_mode(psmouse, model, 0)) + if (alps_tap_mode(psmouse, model, 1)) printk(KERN_WARNING "alps.c: Failed to disable hardware tapping\n"); }