# Inverted left & right stick axes in SDL2

I've faced a weird problem with SDL2.

case SDL_CONTROLLERAXISMOTION:
switch (e->caxis.axis)
{
/* LEFT && RIGHT Stick Movement */
case SDL_CONTROLLER_AXIS_LEFTY:
puts("Y");
break;
/* UP && DOWN Stick Movement */
case SDL_CONTROLLER_AXIS_LEFTX:
puts("X");
break;
}
break;


Using my Xbox 360 Controller on Windows 10, I just the move the left stick forward and backward which is in the y-axis logically. But it prints X instead.

There's no problem with my controller since it works as it should be with all other games.

I've also used some gamepad tools for debugging and the results are the true y and x axes directions.

What did I miss? It's the same with the right stick too.

• Do you have the last SDL version? – HolyBlackCat Jul 15 '18 at 9:01
• @HolyBlackCat Yes, I have the 2.0.8 version (latest). I can work with them this way but it's just confusing... – X Stylish Jul 15 '18 at 10:37