![]() |
|
DirectInput joystick bug |
gnolam
Member #2,030
March 2002
![]() |
While toying around with Allegro's joystick routines with JOY_TYPE_AUTODETECT under Windows, I discovered that I couldn't actually utilize all the axes/sliders on my joystick (a Saitek X-36) - to be specific, Allegro didn't report Rotary #2. After digging around in the sources, I thought I had found the cause of it: /* From joystick.h */ #define MAX_JOYSTICKS 8 #define MAX_JOYSTICK_AXIS 3 #define MAX_JOYSTICK_STICKS 5 #define MAX_JOYSTICK_BUTTONS 32 Since my joystick was being reported as having 5 sticks, I thought I was running into the hardcoded limit and changed MAX_JOYSTICK_STICKS to a higher value, but to no avail. So I did some more testing, and discovered that the problem is with JOY_TYPE_DIRECTX (the default) and not with JOY_TYPE_WIN32. With JOY_TYPE_DIRECTX the joystick gets this layout: Stick 0: Axis 0: X Axis Axis 1: Y Axis Stick 1: Axis 0: Rudder Stick 2: Axis 0: Throttle Stick 3: Axis 0: Rotary #1 Stick 4: Axis 0: Main POV hat X Axis 1: Main POV hat Y + 26 buttons Rotary #2 (identical to Rotary #1) is nowhere to be seen. And with JOY_TYPE_WIN32: Stick 0: Axis 0: X Axis Axis 1: Y Axis Axis 2: Throttle Stick 1: Axis 0: Rudder Stick 2: Axis 0: Rotary #1 Stick 3: Axis 0: Rotary #2 Stick 4: Axis 0: Main POV hat X Axis 1: Main POV hat Y + 26 buttons
Since I figure most people probably haven't tested Allegro's joystick input with more complex joysticks, I feel I may have run into an obscure Allegro bug here... In any case: is there a reason for MAX_JOYSTICK_STICKS to be set at 5? -- |
Chris Katko
Member #1,881
January 2002
![]() |
I'd recommend posting to the developers list or asking someone here to do so. -----sig: |
Evert
Member #794
November 2000
![]() |
Don't worry, I've seen it, and I'm sure Peter and Elias will see it too if they haven't already. Quote: is there a reason for MAX_JOYSTICK_STICKS to be set at 5? I think not. This, I think, is completely arbitrary. |
Peter Wang
Member #23
April 2000
|
Sorry for the delay. I think the problem is in object_enum_callback() in src/win/wjoydx.c. I suspect the missing axis falls under GUID_RxAxis or GUID_RyAxis which is not being tested for there.
|
|