I have bought a cheap USB gamepad from a market and use it playing TIE fighter in dosbox in windows. It worked fine. But when I plug it in a Ubuntu laptop, it went out of control. The cursor went to top left corner of screen though buttons still worked.
I saw a message descripting dosbox "Using joystick USB Gamepad with 6 axes, 10 buttons and 0 hat(s)". It is strange because this gamepad has only two axis and 4 button on my windows platform. I thought SDL recognized it in different way, then I used "jstest /dev/input/js0" to test the layout of this gamepad.
I found this game pad use axis 4(Rx) and 5(Ry) as x and y axis. That means any configuration setting axis pair 1/2 or 3/4 will receive error signal. So I write this patch with adding a set of configuration for this kind of special USB gamepad. I am not sure if this kind of freak gamepad was popular. But at least I meet one.
Please accept it if you guys think it is useful for linux users.