starsergio: does a fully linux-compatible joypad exist?
I'm afraid it gets very complicated.
There's probably drivers for many popular controllers, providing all the basic functionality like a set of axis and buttons, maybe rumble. But then it depends on the game how easily such a thing can be used to control it. For instance, with the default options for the kernel driver for a x360 pad, the analogue triggers are
axis, and Psychonauts will only let you bind psi abilities into
buttons. So no binding them to triggers unless you alter kernel settings - which is not convenient, and then you lose analogue triggers which you'll miss in Flatout.
There's also a userspace driver xboxdrv that is very useful at times since it is very configurable and you can switch around axis or buttons, emulate square axis for old games expecting such a joystick, make buttons out of triggers, even send mouse and keyboard events. Unfortunately you need to write a configuration manually, which is incredibly confusing, and then start it manually for each game which is a hassle. It also doesn't like xpad.ko being loaded, so further hassle if you'd like to play some game with that instead.
It also looks a bit different to the games even with compatibility settings for some reason. Some games used to expect either the kernel driver or xboxdrv, and the button order was messed up with the wrong one. This seems to be less of a problem now, I'm not sure why or how. You can also use xboxdrv to emulate an x360 pad with some other supported controller, which makes it doubly useful.
Then there's Wine. Oh boy. It's possible to use pads, but there are many many complications.
Even on windows theres two interfaces, a more generic one called directinput and then xinput, that basically describes an x360 or an xbone pad. As a general rule, old games need the former and new games the latter. Wine presents gamepads as generic directinput devices. They won't necessarily appear the same as they would on windows. Wine doesn't support xinput, but an external windows program such as x360ce can help with this.
On Linux there are also two interfaces to just talking to joysticks, the older being
js and the newer being
event. Wine supports both, but this unfortunately easily leads into each controller being shown to the game twice. You should probably block one.
The triggers cause many problems. Some racing games would like them combined to a single throttle axis, while other games would want to treat them as separate axis and others would like buttons. Many older games mistake them for the right stick. It's possible to configure them with the wine registry, xboxdrv, x360ce or a combination of these, but again, it gets very complicated and what documentation there is is very brief and hard to understand. I've managed this sort of thing for several years, yet I failed setting up my controller for Bloodrayne 1 today and I have no idea why.
In conclusion, there is good support for common hardware such as the x360 pad, but this doesn't necessarily translate to a plug and play experience with the games. I'm using an xbone controller these days. I think it should be supported by newer kernels, but Valves tweaked driver was still better the last time I checked, so I'm still using that. New native games are probably going to play okay. Wine is another thing entirely.