I needed to add some gamepad and joystick support for the new game I am working on, and a quick Google revealed that there isn’t much out there. So I whipped one together in Java using the JNI and put it on Github here.
It’s a real mix of technologies, so I learned a lot. It uses Ant so I can work on both the Java and C code in Eclipse, and it uses regular MinGW to build the 32-bit native library while using mingw-w64 to build the 64-bit target. I couldn’t really get mingw-w64 to make the 32-bit target, so I fell back on the vanilla. I could hack away at it, but I am too lazy.
Eclipse was really snooty about getting things just right for the JDK and which JRE it was using. There is a whole mess with JAVA_HOME and Ant that inspired me to give up and just blast a solution in (e.g., define JAVA_HOME and ignore the built in java.home property in Ant, which I think points to the directory that has the JRE that Eclipse/Ant are using to run, which is useless when you need to use the JDK).
The engine library currently only supports Windows, and I have only really tested it on Windows 7 64-bit. The 32-bit should work too, but I have to find a 32-bit machine to test it on. I think I have a Windows XP box laying around somewhere.
If you get an itch and want to add Linux or Mac support, feel free to do as thou wilt with the Github repository.