9fans archive / 1996 / 12 / 7 / prev next
From: miller@ham... miller@ham...
Subject: 3-button mice and clearing dtr
Date: Sun, 1 Dec 1996 14:09:21 GMT
If your mouse is like mine, and reverts to 2-button behaviour
if dtr is reasserted, you'll find that the suggestion from
forsyth@pla...:
> change aux/mouse.c
>
> add a timedwrite(ctl, "d0", 2)
doesn't do the trick. aux/mouse finishes by writing a "serial ..."
command to /dev/mousectl, which causes the kernel to raise dtr
and then lock the serial port so it can't be changed again.
A sensible solution would probably require adding a new parameter
to aux/mouse, and to routines serialmouse() and uartspecial() in the
kernel. Or buying a proper three-button mouse.
A quicker and dirtier way is:
1. Insert at the end of uartspecial() in /sys/src/9/pc/devuart.c:
{ char *p;
if (iq == &mouseq && (p = getconf("mousedtr")))
uartdtr(up, strtoul(p, 0, 0));
}
and rebuild the kernel.
2. Insert into the plan9.ini configuration file the line
mousedtr=0
3. In the /bin/termrc shell script, replace the line
aux/mouse $mouseport
with
echo serial$mouseport >'#b/mousectl'
This works for me.
-- Richard Miller