HOWTO : Setting Up a mouse + wheel on a traditional ps/2 port in FBSD 5.3

Ted Mittelstaedt tedm at
Mon Feb 28 11:05:36 GMT 2005

> -----Original Message-----
> From: owner-freebsd-questions at
> [mailto:owner-freebsd-questions at]On Behalf Of Valery
> Sent: Saturday, February 26, 2005 10:35 PM
> To: freebsd-questions at
> Subject: HOWTO : Setting Up a mouse + wheel on a traditional ps/2 port
> in FBSD 5.3
> * Setting Up a mouse + wheel on a traditional ps/2 port in FBSD 5.3
>                            ... and others ... *

Hey Valery, a few things on this:

This only works for mice that support the intellimouse protocol.

Simplest way to find out if your mouse supports this is to kill
the moused daemon, then issue the command:

moused -p /dev/psm0 -t auto -d -f

and read the first line, it will print out the model of the mouse
(for example MouseMan+) then move the
wheel up and down should generate a stream of events on the console

If moving the wheel generates nothing, buy a different mouse.

usb and serial mice with wheels can be tested with the same procedure
except change the port -p  of course.

> 1. Must know
>   ps2 bus   : the ps/2 bus is mapped as /dev/psm0
>   /dev/psm0 : support only 'ps/2' protocol ( moused(8) )
>   moused	   : map /dev/psm0 as a virtual port to
> 	     /dev/sysmouse (ie like /dev/ttyv0 is a virtual tty)
>   X         : work with the /dev/sysmouse virtual device as
> input device.
>   xorg.conf : When setting up "Protocol" to "Auto" the protocol choosed
>               by X is ps/2 which don't work for me (i don't know how to
>               use a wheel with it without setting up parms for
> each apps)
>   xorg.conf : setting up "Protocol" to "sysmouse" is the best
> way i find
>               to use my wheel. /sysmouse/ work "natively" with xterm,
>               Mozilla, and so on. No needs to change anything.

You should NEVER set the protocol for the mouse in either Xfree86 or
xorg to anything other than sysmouse, when using FreeBSD.  And, if
your going to run X you should -always- run moused.

Per the man page if you use moused, ps/2 or auto are the only acceptable
protocols that are allowed to be set for the ps/2 port.

During the FreeBSD installation for 4.X you are asked to set these up.

> 2. Parameters
>   /etc/rc.conf :
> 	moused -p /dev/psm0 -t ps/2

moused -p /dev/psm0 -t auto

is setup by the FreeBSD installation program and it will work just as

Note - many wheel mice use a push on the wheel as a second button.

>   /etc/X11/xorg.conf :
> 	Section "InputDevice"
> 	  Identifier  "Mouse0"
> 	  Driver      "mouse"
> 	  Option	    "Protocol" "sysmouse"
> 	  Option	    "Device" "/dev/sysmouse"
> 	  Option		"Buttons" "5"
> 	  Option		"ZAxisMapping" "X"

This probably should be:

 	  Option		"ZAxisMapping" "4 5"

In fact, the only thing that generally needs to be added to this section

 	  Option		"Buttons" "5"
 	  Option		"ZAxisMapping" "4 5"

> 	EndSection
> 3. Some tips
>   Testing :
>   1 - kill the moused daemon
>   2 - set mouse on console : vidcontrol -m on
>   3 - launch moused on foreground to see if it's work :
>        moused -f -p /dev/psm0 -t ps/2
>   4 - press ^C to end
>   5 - if result are ok, launch moused with your previous parms
>   6 - set up rc.conf && xorg.conf as above.
>   7 - try to use a lightweight wm like IceWM or twm to test,
>       it respect well X parms.

For testing with twm:

fill an xterm with text, scroll up and down.

firefox also supports the scroll wheel.

>    i don't know why, but logoff/login or reboot your computer
> in order to
>   get this stuff working properly : first time i set this parms, they
>   don't work. Because i was almost sure they must work, i rebooted my
>   computer and they work fine. Perhaps some guy from BSD could
>   explain ...

I don't understand how your X server got:

>   My X.log whith the 'sysmouse' protocol :
> 	(**) Option "ZAxisMapping" "4 5"
> 	(**) Mouse0: ZAxisMapping: buttons 4 and 5

when you had configured

 	  Option		"ZAxisMapping" "X"

If I knew I could probably tell you why rebooting worked.


More information about the freebsd-questions mailing list