[SDL] Analogue joystick "sticks" on OS X
Ryan C. Gordon
icculus at icculus.org
Tue May 29 13:27:36 PDT 2007
> I was actually going to suggest that one! >.< Stole my idea. What
> was the issue, then, since I saw you have fixed it...?
The OS X code queries the min/max values a given piece of hardware will
supply so it can scale input events to what SDL wants (-32k to 32k).
Since hardware tends to misreport these values, the code is set up to
adjust the min/max values as the stick reports something out of the
bounds it specified.
The problem is that we assigned it backwards (the min value to the max
variable and vice versa).
I think this probably worked in older OS X versions because it always
reported the min/max as zero, and we depended entirely on the code that
adjusts the bounds the first time you moved the stick. Once these values
were reported by the OS correctly, they became seriously bogus in the
wrong direction due to our variables being flipped, so SDL would
overcorrect input in the wrong direction as soon as you moved the stick
(and the bounds-adjusting code would fix it when you moved the stick in
the other direction, hence why rotating the stick fixed it).
--ryan.
More information about the SDL
mailing list