Train Simulator (aka Railworks) is a pretty interesting game for a railroad fan. It has locos, real world routes and a very good graphic compared to similar software. It only lacks a very useful feature: the opportunity to control the train by analog interfaces (joystick, etc…), leaving all the commands on keyboard and mouse. This is acceptable when you have to turn on/off wipers or other buttons, but is an hassle if you have to control the regulator or the brakes (levers). Searching over forums I found that basically anyone shares the same problem, and the only solution was to buy the commercially available RailDriver controller (300€…). A possibility was to interface via the RailDriver.dll file, but it was undocumented and out of my skills.
So, my tricky and buggy solution is to simulate the keyboard control by using and Arduino HID-enabled board. The project is available on GitHub, please post all comments and polls there.