Re: [AD] Unknown joystick axis problem under Windows

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


> Hello,
Sorry for the delay...

It's fine. I should be thanking you for your work!

[...]
> Does someone familiar enough with Allegro DirectInput layer has an
> idea about this problem? Can anybody reproduce my modified exjoy.c
> inputs? Is the problem already known?

I think you stumbled upon a genuine bug in my code :-(
Could you try the attached patch?

It indeed fixed part of the bug: one "bad" axis is gone.

There's another bug I cannot explain with sliders handling, however.
After a little research, I noticed that rglSlider[] data were always
set to 0. My joystick here has 1 slider, accessed via rglSlider[0]
using DirectInput.

I ran the joystick example provided with DirectX 8 SDK, which display
all joystick state values.
I can move one of my stick axis and see the slider 0 value moving in
the specified range (-1000 to 1000 in the example).
This same slider is detected by Allegro, but its value always stays
to 0.

I have no idea why it is so.

I tried changing to the extended data format: using the DIJOYSTATE2
structure, and passing c_dfDIJoystick2 to IDirectInputDevice2_SetDataFormat(),
but it did not help.

One difference is that the example has DirectInput version 0x0800,
whereas Allegro uses 0x0500. Perhaps version 0x0500 does not handle
sliders well, or differently ?

I don't know much about DirectX, but:

WDXVER.C, WKEYBD.C and WMOUSE.C have the DIRECTINPUT_VERSION definition
set to 0x0300, while WJOYDX.C have it set to 0x0500.

Does using different versions API is well supported?





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