First, MacOS X gamepad code assumes that number of sticks on device is
equivalent to number of X axes. This is not always true: for my gamepad,
there are 1 reported X axis, 1 Y axis and 2 Z axis. Currently, the extra
Z axis gets lost for Allegro :) I think this piece of code needs to be
rewritten not to assume number of sticks in this way.
MaxOS X gamepad code also can't handle d-pad on my gamepad. It has usage
== kHIDUsage_GD_Hatswitch and needs special handling, because its
element represents both axes at once (or maybe it should be mapped to
four buttons?).
I think I can fix those two problems myself, but first I'd like to talk
about a more general thing: I see that Allegro's idea of separate
"sticks" fails on so many platforms it seems to be useless. Time and
time again I get sticks with 3 axes for my gamepad. Mostly, X-axis of my
right sticks gets reported as Z-axis of the left stick. I think this is
a problem with drivers, but it's a problem Allegro can't correct, and it
leads to confusion. I know that would be a backward compatibility
breaking change, but maybe we should consider abandoning the idea of
sticks, and return to a set of independent axes instead, as with SDL?
The current setup gives end-user false sense of security, he might think
that 0th axis of a stick always will be horizontal, and 1st axis will be
vertical, and there can be no 2nd axis on a standard gamepad. But this
is not true :)