GPM 1.14-2 Graded Acceleration Patch  10/98
Author: Jim Ursetto <ursetto@uiuc.edu>

Contents
  README - this file
  gpm-1.14-2.diff - patch against gpm-1.14-2
  gpm - patched GPM dynamically linked against glibc2

Description
I've been fed up with the abysmal mouse acceleration under XFree86 for
a while.  Traditionally one would use xset to set the mouse
acceleration, but there are only two levels of acceleration (on and
off) and that doesn't lend itself well to fine control of the mouse. 
Recently, it dawned on me that if I used GPM in repeater mode, turned
on its acceleration option, had X use /dev/gpmdata as a mouse device,
and combined that with xset, I could effectively get three levels of
acceleration.  For example,

  gpm -a 2 -d 4 -R
  xset m 3 2

gives you an acceleration multiplier of 3 after 2 pixels (from the
xset) and a multiplier of 6 after 4 pixels (since xset's multiplier
combines with gpm's).

Three levels wasn't enough, though, and the interaction of gpm with
xset was less than desirable (having multipliers of 3 and 5 wasn't
possible).  So I played around with the GPM source.

This patch adds a simple graded-acceleration capability to GPM.   It's
against gpm-1.14-2, but it'll probably patch other versions as well.
With standard GPM you can specify only one acceleration/delta pair; if
the mouse moves farther than delta units in one motion, the value is
multiplied by acceleration.  The patch allows you to specify up to
three accel/delta pairs, providing four levels of acceleration.  It's
quite trivial to add more levels if you need them; just look at the diff.

Acceleration/delta option pairs:

-a accel1      -d delta1
-A accel2      -D delta2
-6 accel3      -7 delta3

I know, why did I use -6 and -7?  Because this was a quick hack.
(You should have delta1 < delta2 < delta3, or you'll get unexpected results.)

Example:

  gpm -a 2 -d 2 -A 4 -D 3 -6 8 -7 4

gives acceleration of 2 after 2 pixels, 4 after 3 pixels, and 8 after
4 pixels.

This is quite an improvement, but I find that the unaccelerated mouse
is still too slow.  Normally you'd use the responsiveness parameter of
gpm to scale the mouse motion linearly by a fraction (make it 150% of
normal, for example) but that parameter isn't used in repeater mode. 
So, I use

  gpm -a 2 -d 2 -A 3 -D 3 -6 4 -7 4
  xset m 2 1

which gives accel of 2 after 1 pixel, 4 after 2 pixels, 6 after 3
pixels, and 8 after 4 pixels.  The drawback to this is that mouse
positioning now has 2-pixel granularity; with scaling, you could
position down to one pixel if you moved _really_ slow.

Still, the mouse handles much better for me now, and having four
levels of acceleration seems pretty reasonable.

Confused?  Have questions or suggestions?  Drop me a line.

Notes
It's quite trivial to add more levels if you need them; just look at
the diff.  Then again, it's quite annoying to modify the source.  It
should be rewritten to support unlimited levels.  One way to do that
is to compute acceleration as a function of delta by passing an
expression on the command line.

Maybe the repeater mode should be modified to take scaling/
responsiveness into account?
