I decided to make a quick write up of one of FreeBSD's jewels — moused(8). I stand to be corrected, but I don't think the other BSDs nor linux have anything like it, and it makes mousing under X a lot more pleasant.
If you're a X user you should already be familiar with its builtin mouse acceleration support. Most desktop environments have control panels to configure it, but here's the bad news — it sucks! It's a feature that runs your mouse at a low sensitivity when it's moving slowly, but increases the sensitivity when it accelerates beyond a set threshold to make the pointer move quicker. So it only has only two levels: slow and fast.
FreeBSD's mouse daemon
FreeBSD's mouse daemon has a couple of very neat features:
Preparing...
When you plug your mouse in, FreeBSD should automatically spawn a mouse daemon process and attach it to your ums device:
That's how mine looks after my customising. To change the defaults you need to edit rc.conf:
I'll come back to exactly what settings you'll be playing with in a second. For now you just need to make sure the mouse daemon is running. Next you need to make sure your X configuration is using it:
That should be the only pointing device in xorg.conf (unless you know what you're doing). You'll notice /dev/sysmouse in your dev filesystem — moused creates this. It is a virtual mouse device where the daemon sends all mousey data for X to use.
So moused is running and Xorg is using it. Now you need to disable X's own mouse acceleration. If you're running a desktop environment like GNOME, KDE, or Xfce there is a mouse configuration GUI where you should do this. Set the mouse acceleration and threshold all the way to minimum.
If you don't have a mouse configuration GUI then open a terminal and run
and add that to your startup script.
In a terminal run the following to check that your mouse acceleration is set correctly:
Play time!
Base mouse sensitivity
How does your mouse feel now? Too slow? Too fast? You're going to set the base sensitivity first. The mouse should feel slow at this stage. Too slow to use X, but fast enough to, say, touch up a few pixels of a graphic. To adjust the sensitivity you need to add the -a parameter to rc.conf. Values below 1.0 desensitize your mouse. Values above 1.0 increase sensitivity. Take another look at my -a setting above — I had to desensitize my mouse, hence 0.7. Edit rc.conf as shown above and then run /etc/rc.d/moused restart ums0 (assuming your mouse device is ums0). Your mouse daemon should be running with the new setting and things should be feeling better. If not, try another setting until you're happy. Remember, the mouse must feel slow at this stage.
Mouse acceleration
This is the best part: the -A parameter. It takes two values separated by a comma as seen in my config. The first value is the magnitude of acceleration, the second value is the movement threshold required to activate acceleration. Try my settings (1.5,2.0) to start with and experiment with the values until you're happy. As you're experimenting you should already be thinking, "Damn, how did I live without this for so long??"
Virtual scrolling
And now, the cherry on the top. Virtual scrolling! No more having to motor your mouse wheel like a wheelchair racing gold medallist. Virtual scrolling is enabled with the -V parameter. If you've setup your mouse acceleration and sensitivity nicely, the virtual scrolling defaults should be satisfactory. Now that you've enabled it, click and hold your middle mouse button in your web browser and move the mouse up and down. Awesome huh?
There are a few other useful features you might want to experiment with. Go ahead and browse through the moused(8) manual to find out more. Don't forget to ensure that Xorg's builtin mouse acceleration remains disabled. Enjoy!
(this post is a copy of my blog post)
If you're a X user you should already be familiar with its builtin mouse acceleration support. Most desktop environments have control panels to configure it, but here's the bad news — it sucks! It's a feature that runs your mouse at a low sensitivity when it's moving slowly, but increases the sensitivity when it accelerates beyond a set threshold to make the pointer move quicker. So it only has only two levels: slow and fast.
FreeBSD's mouse daemon
FreeBSD's mouse daemon has a couple of very neat features:
- Multiplexes multiple mice into one mouse device (useful for notebooks).
- Provides mouse support for syscons(4)
- Emulates 3 buttons on a 2 button mouse (same as X's implementation)
- Provides fine grained mouse sensitivity control
- Provides exponential (or dynamic) acceleration
- Provides virtual scrolling
Preparing...
When you plug your mouse in, FreeBSD should automatically spawn a mouse daemon process and attach it to your ums device:
Code:
$ ps -wwp $(pgrep moused)
PID TT STAT TIME COMMAND
98163 ?? Ss 3:27.46 /usr/sbin/moused -F 200 -A 1.5,2.0 -a 0.7 -r high -V -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
That's how mine looks after my customising. To change the defaults you need to edit rc.conf:
Code:
$ grep moused /etc/rc.conf
moused_ums0_flags="-F 200 -A 1.5,2.0 -a 0.7 -r high -V"
I'll come back to exactly what settings you'll be playing with in a second. For now you just need to make sure the mouse daemon is running. Next you need to make sure your X configuration is using it:
Code:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/sysmouse"
Option "Protocol" "auto"
Option "Emulate3Buttons" "false"
EndSection
That should be the only pointing device in xorg.conf (unless you know what you're doing). You'll notice /dev/sysmouse in your dev filesystem — moused creates this. It is a virtual mouse device where the daemon sends all mousey data for X to use.
So moused is running and Xorg is using it. Now you need to disable X's own mouse acceleration. If you're running a desktop environment like GNOME, KDE, or Xfce there is a mouse configuration GUI where you should do this. Set the mouse acceleration and threshold all the way to minimum.
If you don't have a mouse configuration GUI then open a terminal and run
Code:
xset m 1/1 1
In a terminal run the following to check that your mouse acceleration is set correctly:
Code:
$ xset q |grep -A 1 ^Pointer
Pointer Control:
acceleration: 1/1 threshold: 1
Play time!
Base mouse sensitivity
How does your mouse feel now? Too slow? Too fast? You're going to set the base sensitivity first. The mouse should feel slow at this stage. Too slow to use X, but fast enough to, say, touch up a few pixels of a graphic. To adjust the sensitivity you need to add the -a parameter to rc.conf. Values below 1.0 desensitize your mouse. Values above 1.0 increase sensitivity. Take another look at my -a setting above — I had to desensitize my mouse, hence 0.7. Edit rc.conf as shown above and then run /etc/rc.d/moused restart ums0 (assuming your mouse device is ums0). Your mouse daemon should be running with the new setting and things should be feeling better. If not, try another setting until you're happy. Remember, the mouse must feel slow at this stage.
Mouse acceleration
This is the best part: the -A parameter. It takes two values separated by a comma as seen in my config. The first value is the magnitude of acceleration, the second value is the movement threshold required to activate acceleration. Try my settings (1.5,2.0) to start with and experiment with the values until you're happy. As you're experimenting you should already be thinking, "Damn, how did I live without this for so long??"
Virtual scrolling
And now, the cherry on the top. Virtual scrolling! No more having to motor your mouse wheel like a wheelchair racing gold medallist. Virtual scrolling is enabled with the -V parameter. If you've setup your mouse acceleration and sensitivity nicely, the virtual scrolling defaults should be satisfactory. Now that you've enabled it, click and hold your middle mouse button in your web browser and move the mouse up and down. Awesome huh?
There are a few other useful features you might want to experiment with. Go ahead and browse through the moused(8) manual to find out more. Don't forget to ensure that Xorg's builtin mouse acceleration remains disabled. Enjoy!
(this post is a copy of my blog post)