diff -ur linux/drivers/input/mousedev.c linux.mine/drivers/input/mousedev.c --- linux/drivers/input/mousedev.c 2001-09-30 15:26:05.000000000 -0400 +++ linux.mine/drivers/input/mousedev.c 2002-10-26 18:20:19.000000000 -0400 @@ -62,7 +62,7 @@ struct fasync_struct *fasync; struct mousedev *mousedev; struct mousedev_list *next; - int dx, dy, dz, oldx, oldy; + int dw, dx, dy, dz, oldx, oldy; signed char ps2[6]; unsigned long buttons; unsigned char ready, buffer, bufsiz; @@ -117,6 +117,7 @@ case REL_X: list->dx += value; break; case REL_Y: list->dy -= value; break; case REL_WHEEL: if (list->mode) list->dz -= value; break; + case REL_HWHEEL: if (list->mode == 2) list->dw -= value; break; } break; @@ -260,9 +261,22 @@ list->bufsiz = off + 3; if (list->mode == 2) { - list->ps2[off + 3] = (list->dz > 7 ? 7 : (list->dz < -7 ? -7 : list->dz)); - list->dz -= list->ps2[off + 3]; - list->ps2[off + 3] = (list->ps2[off + 3] & 0x0f) | ((list->buttons & 0x18) << 1); + if (!list->dz && !list->dw) { + list->ps2[off + 3] = 0; + } else if (list->dw > 0) { + list->ps2[off + 3] = 0x2; + list->dw--; + } else if (list->dw < 0) { + list->ps2[off + 3] = 0xe; + list->dw++; + } else if (list->dz > 0) { + list->ps2[off + 3] = 0x1; + list->dz--; + } else if (list->dz < 0) { + list->ps2[off + 3] = 0xf; + list->dz++; + } + list->ps2[off + 3] |= (list->buttons & 0x18) << 1; list->bufsiz++; } @@ -272,7 +286,7 @@ list->bufsiz++; } - if (!list->dx && !list->dy && (!list->mode || !list->dz)) list->ready = 0; + if (!list->dx && !list->dy && (!list->mode || !list->dz) && ((list->mode != 2) || !list->dw)) list->ready = 0; list->buffer = list->bufsiz; }