Why X/Y and A/B on a game controller got swapped on Android via USB-OTG?


Almost a month ago I left the issue. I got found that when I use any gamepad through the SDL_GameController API, I see that the A<->B and X<->Y buttons got swapped (I press B, SDL2 thinks it’s A, and opposite. Same when I press X, SDL2 thinks it’s Y, and opposite). That happens on both of the controllers I have by myself, and also happens at my friend who plays the game on the Retroid Pocket device. However, when I use my Xbox Series X controller through Bluetooth, it works as intended. On other platforms such as Linux and Windows, the same controllers were working properly, the bug happens at Android when a gamepad is connected via USB-OTG. I do build the SDL2 via CMake. Anyway, when I tried to build the SDL2 via the Android.mk file, there is no difference.