Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/devmouse/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



This does two things (well, three, but I'd delete the third one).
First, it adds "scrollswap" as a ctl for mousectl. The reason is that
some mouses we found send the wrong buttons (5/4) instead of the
usual ones (4/5) for the wheel.

Second (the reason for this patch) it changes buf in mouseread to
hold one extra space after the 4th number and puts an space after
the 4th number in the read buffer. We noticed (the hard way) that
/dev/mouse was not supplying 49 bytes as the man page said. This has
nasty effects when sending mouse events through tcp (that does not
have message delimiters). I'd either fix this, or change the man page.
In any case, I think /dev/mouse is supplying the extra \0 of the string
instead of the extra " ", which is weird.

The third thing (that I'd probably not apply), is to support "M ..."
messages instead of "m ...", to let the user send absolute mouse positions
to the mouse. We use this for the usb touch screen, but we're going to
convert it to use #m/mousein instead. Hope it's not hard for you to
just extract the useful part of this patch.


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.