Min / max axis values for joysticks

Hey all

Got a question for you.
For my joystick SDL gives me -32768 to 32767 on the axis.
Are these min max values the same for all joystick axis used in SDL?

Thanks

Hey Mark,

I can’t quite answer this question authoritatively, but I can give you
some insight.

SDL stores joystick values as SInt16 values, which means their values
can range from -2^15 = -32,768, to 2^15-1 = 32,767.

So these values are the min max values you can ever expect to see
reported by the SDL joystick system. Do all Joysticks under SDL map
their range of values to the full interval [-32,768, 32,767]? I can’t
say for sure, but this would be the most natural thing to do.

  • HolmesOn Sep 17, 2008, at 1:09 PM, Mark wrote:

Hey all

Got a question for you.
For my joystick SDL gives me -32768 to 32767 on the axis.
Are these min max values the same for all joystick axis used in SDL?

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Le Wed, 17 Sep 2008 20:09:32 +0000 (UTC)
Mark a _crit:

Hey all

Got a question for you.
For my joystick SDL gives me -32768 to 32767 on the axis.
Are these min max values the same for all joystick axis used in SDL?

Yep, any joystick should report the full range to your application.
Of course, the joysticks need to be proper calibrated if needed.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Ahh, so does that mean that if it’s calibrated just off of center, testing for these values instead of a range would cause broken control? Does anyone have sample deadzone values for analog joysticks? That would probably be good to use for gamepads instead of the max values if it ends up being important. I’ve just noticed that my Linux build has joystick issues that I haven’t looked into yet, but maybe this is something to look at.

Jonny D----------------------------------------

Date: Wed, 17 Sep 2008 22:32:18 +0200
From: mandin.patrice at orange.fr
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Min / max axis values for joysticks

Le Wed, 17 Sep 2008 20:09:32 +0000 (UTC)
Mark a _crit:

Hey all

Got a question for you.
For my joystick SDL gives me -32768 to 32767 on the axis.
Are these min max values the same for all joystick axis used in SDL?

Yep, any joystick should report the full range to your application.
Of course, the joysticks need to be proper calibrated if needed.


Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Jonathan Dearborn escreveu:

Ahh, so does that mean that if it’s calibrated just off of center,
testing for these values instead of a range would cause broken
control? Does anyone have sample deadzone values for analog
joysticks? That would probably be good to use for gamepads instead
of the max values if it ends up being important. I’ve just noticed
that my Linux build has joystick issues that I haven’t looked into
yet, but maybe this is something to look at.

Isn’t joystick calibration done system-wide? jscal on *nix, and I
believe Windows has something similar in the control panel.–
Daniel K. O.
“The only way to succeed is to build success yourself”

Thank you!