CFT: evdev-awared moused

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Wed, 30 Jul 2025 08:31:58 UTC
Hi all,

With some non-zero probability FreeBSD15 will have usbhid(4) enabled by default. 
See e.g. https://reviews.freebsd.org/D45659. That results in USB mices stop to 
work in virtual terminals as ums(4) replacement called hms(4) is not compatible 
with current moused(8) due to lack of legacy protocols support.

To fix that I reworked our old good moused(8): https://github.com/wulf7/moused
The new daemon have following properties as compared with previous incarnation:

- evdev protocol support for mices and touchpads. Additionally to relative PS/2 
and USB devices it enables console support for I2C/USB touchpads and bluetooth 
mices.
- Other aged protocols like COM, raw PS/2 and X10 are dropped with only 
exception of sysmouse. For those who still use them there is an utility called 
msconvd.
- single daemon per system where hotplug is processed via devd socket. Per 
device mode still supported too.
- Configuration and quirks files in libinput-compatible format. Actually, the 
new moused config parser is stolen from libinput. No problem here as it is 
MIT-licensed.

https://github.com/wulf7/moused
Recommended installation method is through the port enclosed in port directory

Although distribution bundle includes own rc file, I would prefer to test it as 
direct replacement of system daemon. So do not enable bundled rc file but change 
path to mouse daemon in system /etc/rc.d/moused from /usr/sbin/moused to 
/usr/local/sbin/moused (in two places) and than test it in 2 modes:

1. Sysmouse support mode. All should work as before. No new devices supported 
and no configuration changes required. Just kill and start again all instances 
of moused. In this mode recent (as of July 2025) CURRENT is required for psm(4) 
driver to work. This mode is planned for transition period to follow POLA.

2. Evdev support mode. It enables all previously mentioned devices. To enable it 
add following lines to /etc/rc.conf:

moused_port="auto"
moused_nondefault_enable="NO"

Caveats:
Some drivers are known to be incompatible with the Subj.
1. cyapa(4) - lack of sysmouse protocol support. I prepared a patch for it and 
can send it to any who able to perform a test on real hardware.
2. ams(4) - no evdev and kqueue support. One should implement them or use 
aforementioned msconvd utility.


-- 
WBR
Vladimir Kondratyev