diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/conf/ELBERETH | 3 | ||||
-rw-r--r-- | sys/arch/i386/isa/pms.c | 45 |
2 files changed, 43 insertions, 5 deletions
diff --git a/sys/arch/i386/conf/ELBERETH b/sys/arch/i386/conf/ELBERETH index bca03e0d7ec..08581a98ffd 100644 --- a/sys/arch/i386/conf/ELBERETH +++ b/sys/arch/i386/conf/ELBERETH @@ -1,5 +1,5 @@ # -# $OpenBSD: ELBERETH,v 1.10 1997/08/06 19:31:14 kstailey Exp $ +# $OpenBSD: ELBERETH,v 1.11 1997/08/29 22:40:17 kstailey Exp $ # # # ELBERETH -- 166MHz Pentium PCI @@ -12,6 +12,7 @@ makeoptions CC="cc -Werror" option I586_CPU # CPU classes; at least one is REQUIRED option XSERVER # diddle with console driver +option INTELLIMOUSE # pms support for MS IntelliMouse maxusers 16 # estimated number of users option TIMEZONE=300 # time zone to adjust RTC time by diff --git a/sys/arch/i386/isa/pms.c b/sys/arch/i386/isa/pms.c index f0f376ccbe8..18997ff763a 100644 --- a/sys/arch/i386/isa/pms.c +++ b/sys/arch/i386/isa/pms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pms.c,v 1.15 1997/05/30 19:51:27 deraadt Exp $ */ +/* $OpenBSD: pms.c,v 1.16 1997/08/29 22:40:16 kstailey Exp $ */ /* $NetBSD: pms.c,v 1.29 1996/05/12 23:12:42 mycroft Exp $ */ /*- @@ -229,6 +229,23 @@ pmsattach(parent, self, aux) sc->sc_ih = isa_intr_establish(ic, irq, IST_EDGE, IPL_TTY, pmsintr, sc, sc->sc_dev.dv_xname); + +#ifdef INTELLIMOUSE + /* The Micro$oft IntelliMouse has a wheel that you can turn or + * click stuck in between the left and right buttons. + * By default this mouse acts like a two-button PS/2 mouse. + * If you set the sampling rate to 200, then 100, then 80 + * it changes to a 4-byte-per-packet format and the wheel + * acts like a middle button if you click it. Turing the + * wheel modifies the fourth byte in the packet. + */ + pms_dev_cmd(PMS_SET_SAMPLE); + pms_dev_cmd(200); /* 200 samples/sec */ + pms_dev_cmd(PMS_SET_SAMPLE); + pms_dev_cmd(100); /* 100 samples/sec */ + pms_dev_cmd(PMS_SET_SAMPLE); + pms_dev_cmd(80); /* 80 samples/sec */ +#endif } int @@ -446,12 +463,16 @@ pmsintr(arg) case 2: dy = inb(PMS_DATA); dy = (dy == -128) ? -127 : dy; +#ifdef INTELLIMOUSE + ++state; +#else state = 0; - +#endif buttons = ((buttons & PS2LBUTMASK) << 2) | ((buttons & (PS2RBUTMASK | PS2MBUTMASK)) >> 1); changed = ((buttons ^ sc->sc_status) & BUTSTATMASK) << 3; - sc->sc_status = buttons | (sc->sc_status & ~BUTSTATMASK) | changed; + sc->sc_status = buttons | + (sc->sc_status & ~BUTSTATMASK) | changed; if (dx || dy || changed) { /* Update accumulated movements. */ @@ -473,6 +494,12 @@ pmsintr(arg) } break; +#ifdef INTELLIMOUSE /* discard fourth "wheel" byte */ + case 3: + state = 0; + inb(PMS_DATA); + break; +#endif } } else { /* read data port */ @@ -494,12 +521,17 @@ pmsintr(arg) case 2: dy = buffer[0]; dy = (dy == -128) ? -127 : dy; +#ifdef INTELLIMOUSE + ++state; +#else state = 0; +#endif buttons = ((buttons & PS2LBUTMASK) << 2) | ((buttons & (PS2RBUTMASK | PS2MBUTMASK)) >> 1); changed = ((buttons ^ sc->sc_status) & BUTSTATMASK) << 3; - sc->sc_status = buttons | (sc->sc_status & ~BUTSTATMASK) | changed; + sc->sc_status = buttons | + (sc->sc_status & ~BUTSTATMASK) | changed; if (dx || dy || changed) { /* Update accumulated movements. */ @@ -507,6 +539,11 @@ pmsintr(arg) sc->sc_y += dy; } break; +#ifdef INTELLIMOUSE /* discard fourth "wheel" byte */ + case 3: + state = 0; + return 0; /* XXX 0? -1? */ +#endif } /* add raw data to the queue. */ |