Joystick-like events from Arduino


I am making myself an autopilot box to work with Microsoft Flight Simulator X, and using Arduino to connect up the buttons to the simulator. Currently, pressing a button simulates a keyboard press and that keyboard press is then in the simulator connected to an action. The problem with this is, that there is a limited amount of letters on the keyboard, and it renders my keyboard useless while using it as keyboard strokes then affect the simulator.

I was therefore wondering whether is there a way to assign a joystick-like button press using Arduino, as other joysticks do when being paired to the simulator (i.e. pressing a button would show up as Joystick button 1, rather then for example a press of "A" on the keyboard.)


I’m not a gamer but are you asking if there is a way to read a button press without using any keyboard reading routine . In other words,
read a switch button closure that is just an OPEN/CLOSE (or LOW/HIGH) as opposed to an ASCII value ?

It is not so much about gaming, the problem is that the action in the simulator needs to be connected to either a keystroke or a joystick button press. I know how to simulate a keystroke, and I would like to know whether is it possible to simulate a joystick button press.

It should theoretically be possible for an Arduino Leonardo to be reprogrammed to simulate being a joystick, because it uses the LUFA USB library

However its not as simple as just plugging the Leonardo in and uploading a "sketch", as you'd need to replace the boot loader, to include joystick support, rather than just mouse and keyboard USB support (emulation)

After that however, assuming that the LUFA joystick implementation is the same one that the PC software expects, it would be fairly simple to get the Leonardo to send specific button presses in its guise as a joystick