Y-axis inversion with a XBox 360 controller?

Hi! I’ve got a really confusing problem to do with the game controller API and I could do with some clarification.

What I’m seeing, across both Windows and Linux, with both original and clone 360 controllers, is that pressing up on the left joystick, gives me a negative value, and pushing down gives me a positive axis value.

Is this normal?

Sorry I’m not sure how that’s relevant to the question? I’m talking about the axis values from the game controller API - nothing to do with rendering.

Yes, that’s correct. All game controller thumbstick axes have the origin in the center with positive values going to the right and down.

1 Like

Yep, it’s normal. Left and up are negative on both left and right joysticks. Note the min and max values defined in SDL_Joystick.h

#define SDL_JOYSTICK_AXIS_MAX   32767
#define SDL_JOYSTICK_AXIS_MIN   -32768

Triggers stay positive on mapped controllers though, unmapped joysticks are undefined behaviour.

1 Like

Oh OK! I thought it was a bug! Thanks for the clarification!

1 Like