Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pmax/tc Maxine mouse buttons were being mapped inco...



details:   https://anonhg.NetBSD.org/src/rev/1bef48e3a484
branches:  trunk
changeset: 572681:1bef48e3a484
user:      mhitch <mhitch%NetBSD.org@localhost>
date:      Mon Jan 10 04:40:05 2005 +0000

description:
Maxine mouse buttons were being mapped incorrectly (old dtop.c code mapped
them to serial mouse buttons, which were then mapped into events to pass
to the X server).
Also fix bug in mouse motion - putting 2 unsigned bytes into an integer
resulted in a 16-bit unsigned value, so negative mouse motion didn't work.

diffstat:

 sys/arch/pmax/tc/dtms.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r b8a288a14fa0 -r 1bef48e3a484 sys/arch/pmax/tc/dtms.c
--- a/sys/arch/pmax/tc/dtms.c   Mon Jan 10 04:00:50 2005 +0000
+++ b/sys/arch/pmax/tc/dtms.c   Mon Jan 10 04:40:05 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtms.c,v 1.3 2003/12/23 09:39:46 ad Exp $      */
+/*     $NetBSD: dtms.c,v 1.4 2005/01/10 04:40:05 mhitch Exp $  */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtms.c,v 1.3 2003/12/23 09:39:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtms.c,v 1.4 2005/01/10 04:40:05 mhitch Exp $");
 
 #include "locators.h"
 
@@ -147,7 +147,8 @@
 dtms_handler(void *cookie, struct dt_msg *msg)
 {
        struct dtms_softc *sc;
-       int buttons, dx, dy, tmp;
+       int buttons, dx, dy;
+       short tmp;
 
        sc = cookie;
 
@@ -155,7 +156,11 @@
                return;
 
        tmp = DT_GET_SHORT(msg->body[0], msg->body[1]);
-       buttons = ((tmp >> 1) & 0x3) | ((tmp << 2) & 0x4);
+       buttons = tmp & 1;
+       if (tmp & 2)
+               buttons |= 4;
+       if (tmp & 4)
+               buttons |= 2;
 
        tmp = DT_GET_SHORT(msg->body[2], msg->body[3]);
        if (tmp < 0)



Home | Main Index | Thread Index | Old Index