Re: [AD] mouse bug

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> First of all, if I want these effects in the game I'll implement them in
> the game.

But these effects are the way mouse drivers work: try on your Windows
desktop to move the cursor from the left edge to the right edge, first
quickly then very slowly. You will find two different distances (typically
the second one being twice as large as the first one), hence the speed
[d(pixels)/d(mickeys)] is not constant.

Quoted from the DirectX SDK: (about DirectInput)
"The data returned for the x-axis and y-axis of a mouse indicates the
movement of the mouse itself, not the cursor. The units of measurement are
based on the values returned by the mouse hardware and have nothing to do
with pixels or any other form of screen measurement. Because DirectInput
communicates directly with the mouse driver, the values for mouse speed and
acceleration set by the user in Control Panel do not affect this data."

> Second, if I want the mouse to move quickly around 200 pixels, and I get
> 800 pixel instead, that's a big difference.

Not a problem with a regular enough acceleration function: if you want 200
pixels on the screen, then either you move slowly the mouse by 200 mickeys
(if the speed is set to 1 for small moves) or quickly by 50 mickeys (if the
speed is set to 4 for larger moves).

> Why not change the mouse mode from relative to absolute? This shouldn't be
> a problem regarding my "Inside DirectX" book. (Have no compiler avail.
> right now).

I don't think this will change much things :
"When the axis mode is set to absolute, the coordinates are simply a running
total of all relative motions received by DirectInput."
So basically DirectInput returns only relative datas (mickeys).

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/