SDL2 has dropped support for the Joystick API (/dev/input/js*) in Linux. It now only uses the Event API (/dev/input/event*) for joysticks. In many cases, these event device files are not readable by unprivileged users, and so your joystick won’t work.
If you use Linux, and your Joystick works with SDL1.2 but not SDL2, the following steps will probably allow you to use your joystick:
0: Make sure your joystick is plugged in.
1: Download the following file and move it to /etc/udev/rules.d/
http://wntrknit.freeshell.org/sdl2-joysticks/99-joystick.rules
2: Download the package input-utils. As root, run the command lsinput. You will get some details about all of your event devices. Look for the one that corresponds to your joystick, and make note of the vendor id and product id. Alternatively, you can run lsusb or dmesg.
3: In the file you downloaded, replace 9999 with the vendor id of your device, and replace 8888 with the product id of your device.
4: For additional joysticks, add lines to the 99-joystick.rules file, one for each joystick.
4: Your joystick devices will have world readable permissions at your next reboot. You can also change the permissions manually, unplug and replug your joysticks, or unload and reload the modules with modprobe.
I think it’s unfortunate that this is necessary. It’s not particularly beginner friendly, and if your joysticks just don’t work you won’t know why. I don’t think SDL should alter permissions of event devices or udev rules, as that is more the responsibility of distro and system maintainers.
However, I think people who run into this problem would appreciate an error message that tells them what the problem is. I have supplied a link to a patch against the latest mercurial that displays a message if there are joysticks detected but SDL can’t use them. It uses different logic with and without libudev, I expect both to be very reliable.
http://wntrknit.freeshell.org/sdl2-joysticks/sdl2-joystick-permission-error-notification.patch