Re: SDL_GameControllerGetAxis() question

Ismael Serrano <[email protected]> Mon, 1 May 2017 17:50:37 +0200
Newsgroups gmane.comp.lib.sdl
Message-ID <CAD64bpPJiKRCB4r-=sb2+DFHY2e4R-8MRVNPAyVjESZWE9Meiw@mail.gmail.com>
--===============4085267396957564210==
Content-Type: multipart/alternative; boundary=001a1141167870464a054e78621b

--001a1141167870464a054e78621b
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello,

That's the called dead zone for the axis and thumbs.

Since they can't be exactly at zero you must ignore the values inside that
dead zone.

More info:
http://www.falukdevelop.com/2016/11/02/sdl2-controller-implementation/

Have a good day.

El 1/5/2017 17:20, "Andreas Falkenhahn" <[email protected]> escribi=C3=
=B3:

> With my Xbox 360 controller I get the following values from
> SDL_GameControllerGetAxis() when the controller is just
> idle:
>
>     LEFTX: -2263
>     LEFTY: 2092
>     RIGHTX: 4681
>     RIGHTY: 7703
>
> Is that normal? I'd expect to get 0 for those axes when
> I don't touch anything on the controller. With the trigger
> buttons the behaviour is as expected and SDL returns 0
> in case I don't touch them but somehow for the left and
> right axes this isn't the case and I get these values from
> above...
>
> Tested on Windows with SDL 2.0.5.
>
> --
> Best regards,
>  Andreas Falkenhahn                          mailto:[email protected]=
m
>
> _______________________________________________
> SDL mailing list
> [email protected]
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>

--001a1141167870464a054e78621b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Hello,<div dir=3D"auto"><br></div><div dir=3D"auto">That&=
#39;s the called dead zone for the axis and thumbs.</div><div dir=3D"auto">=
<br></div><div dir=3D"auto">Since they can&#39;t be exactly at zero you mus=
t ignore the values inside that dead zone.</div><div dir=3D"auto"><br></div=
><div dir=3D"auto">More info:=C2=A0<a href=3D"http://www.falukdevelop.com/2=
016/11/02/sdl2-controller-implementation/">http://www.falukdevelop.com/2016=
/11/02/sdl2-controller-implementation/</a></div><div dir=3D"auto"><br></div=
><div dir=3D"auto">Have a good day.</div></div><div class=3D"gmail_extra"><=
br><div class=3D"gmail_quote">El 1/5/2017 17:20, &quot;Andreas Falkenhahn&q=
uot; &lt;<a href=3D"mailto:[email protected]">[email protected]</=
a>&gt; escribi=C3=B3:<br type=3D"attribution"><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
">With my Xbox 360 controller I get the following values from<br>
SDL_GameControllerGetAxis() when the controller is just<br>
idle:<br>
<br>
=C2=A0 =C2=A0 LEFTX: -2263<br>
=C2=A0 =C2=A0 LEFTY: 2092<br>
=C2=A0 =C2=A0 RIGHTX: 4681<br>
=C2=A0 =C2=A0 RIGHTY: 7703<br>
<br>
Is that normal? I&#39;d expect to get 0 for those axes when<br>
I don&#39;t touch anything on the controller. With the trigger<br>
buttons the behaviour is as expected and SDL returns 0<br>
in case I don&#39;t touch them but somehow for the left and<br>
right axes this isn&#39;t the case and I get these values from<br>
above...<br>
<br>
Tested on Windows with SDL 2.0.5.<br>
<br>
--<br>
Best regards,<br>
=C2=A0Andreas Falkenhahn=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mailto:<a href=3D"mailto:andreas@=
falkenhahn.com">[email protected]</a><br>
<br>
______________________________<wbr>_________________<br>
SDL mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org" rel=3D"nore=
ferrer" target=3D"_blank">http://lists.libsdl.org/<wbr>listinfo.cgi/sdl-lib=
sdl.org</a><br>
</blockquote></div></div>

--001a1141167870464a054e78621b--

--===============4085267396957564210==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

--===============4085267396957564210==--