Subject: Re: X on Z50 working
To: Andrew Diller <dillera@sudanacid.com>
From: Greg Hughes <greg@particle.dyndns.org>
List: port-hpcmips
Date: 01/04/2002 18:48:41
On Fri, 4 Jan 2002, Andrew Diller wrote:

<snip>

> Now -- one last thing: how can you emulate the 3rd mouse button in X?
>
> Blackbox really needs that 3rd button, and I would like to cut and paste. 
> Anyone know a good way?

You can emulate the 3rd button at two levels -- in the mouse driver or in
the X server.  The X server is probably the better of the two places to do
it (truthful hardware and all that).  I have no idea if it's supported
already (ala XFree86) or how difficult it would be to add it.  (sigh... so
little time...)

Adding it in the kernel mouse driver would probably be more of a headache
than it's worth since you have to worry about things like how quickly the
buttons need to be pressed to be considered a chord, or interfacing with
the keyboard driver if you want a key-click modifier for it.  These kinds
of things are really UI issues that should be taken care of by the X
server or even the window manager.
 
> Lastly, I'm amazed at Greg's Aug 17 TP kernel. It works amazingly well on 
> my z50 with 1.5.2. I'm even pulling down a large package (mozilla) and 
> sshing into the z50 and the cursor behaves very well except during high 
> network activity. The disk writes don't seem to bother it.

Thanks for the moral support.  :)

The mouse gets flakey under heavier load because the driver is missing
interrupts and gets serial overruns on the TP port.  The VR4121 CPU
supports a serial debug port with a 1-byte buffer which is what the TP is
connected to.  Unfortunately, because the buffer is 1 byte long (i.e.
there is no FIFO) if you miss any interrupts you start dropping bytes.

I really don't know why this is the case, however, since WinCE seems to
handle the mouse alright and I'm leaving the TP in the mode WinCE
configures it to be in (which is a streaming mode at a fixed rate).  
Perhaps NetBSD just takes longer to handle PCMCIA interrupts than does CE?

It should be possible to eliminate such issues by rewriting the mouse
driver to set the TP to polling mode.  In this mode, it is possible to
request a resend of the last data packet if an error (such as
overrun) occurs.  However, I would like to find out how WinCE can work
(presumably) in streaming mode rather than implementing this 'polling
hack'.

> Now I just need to be able to use the two buttons on the z50 as a chorded 
> middle button and I'm ready to really use this.

I suspect it should just be a configuration option in the X server....  In
any case, I would be interested to know how to get this to work as well (I
don't have the time to investigate myself at the moment!)

- Greg Hughes