SDL_GameControllerGetAxis() question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SDL_GameControllerGetAxis() question

Andreas Falkenhahn
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:[hidden email]

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SDL_GameControllerGetAxis() question

Faluk
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.


Have a good day.

El 1/5/2017 17:20, "Andreas Falkenhahn" <[hidden email]> escribió:
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:[hidden email]

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

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SDL_GameControllerGetAxis() question

Andreas Falkenhahn
Thanks!

On 01.05.2017 at 17:50 Ismael Serrano wrote:

> 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" <[hidden email]> escribió:

> 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:[hidden email]
>  
>  _______________________________________________
>  SDL mailing list
>  [hidden email]
>  http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>  


--
Best regards,
 Andreas Falkenhahn                            mailto:[hidden email]

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