From 53f4c06394f49c442237b9555232d7fddd5340a4 Mon Sep 17 00:00:00 2001 From: yokota Date: Thu, 3 Jun 1999 12:42:10 +0000 Subject: [PATCH] Fix PS/2 MouseMan+ protocol. We have been looking at a wrong place for the sign bit for roller movement! --- sys/dev/atkbdc/psm.c | 4 ++-- sys/isa/psm.c | 4 ++-- usr.sbin/moused/moused.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 1d1589c7bbd0..74438dc6de5e 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -20,7 +20,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: psm.c,v 1.9 1999/05/09 13:00:43 phk Exp $ + * $Id: psm.c,v 1.10 1999/05/30 16:52:47 phk Exp $ */ /* @@ -1838,7 +1838,7 @@ psmintr(void *arg) if ((c & ~MOUSE_PS2_BUTTONS) == 0xc8) { /* the extended data packet encodes button and wheel events */ x = y = 0; - z = (sc->ipacket[1] & MOUSE_PS2PLUS_ZNEG) + z = (sc->ipacket[2] & MOUSE_PS2PLUS_ZNEG) ? (sc->ipacket[2] & 0x0f) - 16 : (sc->ipacket[2] & 0x0f); ms.button |= (sc->ipacket[2] & MOUSE_PS2PLUS_BUTTON4DOWN) ? MOUSE_BUTTON4DOWN : 0; diff --git a/sys/isa/psm.c b/sys/isa/psm.c index 1d1589c7bbd0..74438dc6de5e 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -20,7 +20,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: psm.c,v 1.9 1999/05/09 13:00:43 phk Exp $ + * $Id: psm.c,v 1.10 1999/05/30 16:52:47 phk Exp $ */ /* @@ -1838,7 +1838,7 @@ psmintr(void *arg) if ((c & ~MOUSE_PS2_BUTTONS) == 0xc8) { /* the extended data packet encodes button and wheel events */ x = y = 0; - z = (sc->ipacket[1] & MOUSE_PS2PLUS_ZNEG) + z = (sc->ipacket[2] & MOUSE_PS2PLUS_ZNEG) ? (sc->ipacket[2] & 0x0f) - 16 : (sc->ipacket[2] & 0x0f); ms.button |= (sc->ipacket[2] & MOUSE_PS2PLUS_BUTTON4DOWN) ? MOUSE_BUTTON4DOWN : 0; diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index ecb90530333e..91d224f11066 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: moused.c,v 1.25 1999/02/28 09:18:57 yokota Exp $"; + "$Id: moused.c,v 1.26 1999/03/01 04:47:37 gpalmer Exp $"; #endif /* not lint */ #include @@ -1507,7 +1507,7 @@ r_protocol(u_char rBuf, mousestatus_t *act) if ((pBuf[0] & ~MOUSE_PS2_BUTTONS) == 0xc8) { /* the extended data packet encodes button and wheel events */ act->dx = act->dy = 0; - act->dz = (pBuf[1] & MOUSE_PS2PLUS_ZNEG) + act->dz = (pBuf[2] & MOUSE_PS2PLUS_ZNEG) ? (pBuf[2] & 0x0f) - 16 : (pBuf[2] & 0x0f); act->button |= ((pBuf[2] & MOUSE_PS2PLUS_BUTTON4DOWN) ? MOUSE_BUTTON4DOWN : 0);