[SDL] Analogue joystick "sticks" on OS X

mike stedman ravuya at gmail.com
Thu May 31 08:06:12 PDT 2007


Thanks for the bug fix, Ryan! You rock.

I figured it was something like that (calibrating the bounds automatically)
but wasn't prepared to look through all that scary HID code to get to it.

On 5/29/07, Ryan C. Gordon <icculus at icculus.org> wrote:
>
>
> > 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.
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



-- 
Mike
http://rav.realitybytes.tk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070531/6dd94905/attachment.html 


More information about the SDL mailing list