USB Mouse support under 4.0 Release
Benn
Bollay originally placed this article in the Reader Forum, but I
thought it deserved an article of its own. Thanks Benn.
4.0-R: Quick and Dirty USB Mouse support
Gentlebeings —
For your quick and dirty USB Mouse support, please
following these easy steps:
- Add the appropriate entries to your kernel configuration file:
device uhci
device ohci
device usb
device ums
- Add the appropriate lines to your /etc/rc.conf file:
moused_enable="NO"
moused_flags="/dev/ums0"
usbd_enable="YES"
usbd_flags="" (though I like -vv personally, just for the scroll factor) - Make sure your /etc/usbd.conf has these lines in it:
device "Mouse"
devname "ums[0-9]+"
attach "/usr/sbin/moused -p /dev/${DEVNAME} -I
/var/run/moused.${DEVNAME}.pid" - Create the device entry
cd /dev
./MAKEDEV ums0
- Rebuild your kernel
and reboot. As always, I would recommend saving /kernel to /kernel.stable before
trying out the new kernel. It’s a handy thing to have around anyways. - Add the following line to
/etc/rc.conf
which enables the mouse on all
virtual terminals:allscreens_flags="-m on"
I don’t think I forgot anything, but if I did please let me know 🙂
— Benn
References and man pages
Benn recommends the following man pages:
- usb(4)
- usbd(8)
- usbd.conf(5)
- usbdevs(8)
- ums(4)
If you have X11 pointed at sysmouse, then this will work just fine. And it will
support plugging/unplugging the mouse at runtime without the need of a manual HUP.
Addenda
You have to do this:
vidcontrol -m on
to actually enable it on the terminal. Alexander Anderson said he found this
piece of info on the man page for moused(8) by accident. He also suggested step 6
above.