Here I made an example source code with Code::Blocks+MinGW-W64+WINE project directX8 library for using joystick.
You should know this project limited to under Windows32 platform, but You can make fast faced simple game without DirectX surface, only using FLTK and Direct Input.
I recommend to using my FLTK-1.3.3-ts library for compile this example to running without strange graphic crash. (visit here: https://github.com/rageworx/fltk-1.3.3-ts )
Source code is open, you can modify, republish.
To download file, just click below. Compressed with 7z and you may need Code::Blocks and MinGW-W64. And archived library is a part of WINE project – DirectX8.