- Online Community Forums » Allegro Development » how disable mouse acceleration in visual c ?

This thread is locked; no one can reply to it. rss feed Print
how disable mouse acceleration in visual c ?
mik dighi
Member #7,129
April 2006


I used the function get_mouse_mickeys().

It should be a raw direct input, but it is affected by mouse acceleration, it reads more mickeys for the same distance when I move the mouse faster.

I tried to disable it (in win xp) through control panel with no success.

Is there a function that disables the acceleration ( or speed threshold? ) ?

mik :-/

Member #3,025
December 2002

You will need to turn down the acceleration in the control panel.

If you want to add serial mice to your app, this is not the main pointer, i have code for that.

The more you talk, the more AJ is right. - ML

mik dighi
Member #7,129
April 2006

Turning down the acceleration in control panel let the mouse pointer work without acceleration, but the function get_mouse_mickeys() reads more mickeys when moving faster the mouse (same distance of course), that means maybe that low level acceleration is enabled or the operative system manipulate the data.

Is there a function that let me manipulate the speed or acceleration parameters ?


Member #5,385
January 2005

I think that Direct Input does not return values with acceleration, at least not for fullscreen (I could be wrong, but I seem to remember this is the case). Because of this, there is some code that emulates acceleration in the allegro mouse driver for windows. As far as I remember this is not controlable.

You could tweak the mouse acceleration parameters and recompile allegro

#define MAF_DEFAULT 1                 /* mouse acceleration parameters */
static int mouse_accel_fact = MAF_DEFAULT;
static int mouse_accel_mult = MAF_DEFAULT;
static int mouse_accel_thr1 = 5 * 5;
static int mouse_accel_thr2 = 16 * 16;

Or you could update the acceleration code to make it tweakable (with some config entry probably). Or even better implement a driver that uses windows events (and not direct input) - I think this has been proposed but nobody was up to the task (I tried but did not get far - good luck if you try this!)

The Open Toolkit: a game development library for .Net/Mono.

Member #358
May 2000

This should disable any acceleration done by Allegro (put it before install_mouse):

set_config_int("mouse", "mouse_accel_factor", 0);

But, I remember we had some discussion about this in the past, and it seems that DInput (or the mouse driver itself) does its own acceleration (on some systems/drivers, not on others).

"Either help out or stop whining" - Evert

mik dighi
Member #7,129
April 2006

I tried set_config_int("mouse", "mouse_accel_factor", 0);

but no success.

I try to work on mouse accel parameters hoping to find a solution...

If someone has ideas, let me know...


Go to: