You need a driver for the controller, or an input library . It doesn't "just work" in this sense.
If you have Steam installed and the controller works fine in games there, this is the issue. Steam runs the Steam input library, and takes the input from the device and translates it into compatible commands for the games.
Try this out: https://github.com/DanielOgorchock/joycond